Kaydet (Commit) 117c7285 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin: rendercontext, limit output for now

we are only currently interested in methods where the first parameter is
RenderContext

Change-Id: Ic505541c93a765e56e920415d3665b7aa4abb10b
üst 8be85ad1
......@@ -37,6 +37,7 @@ private:
bool mbChecking = false;
};
// We use Traverse to set a flag so we can easily ignore certain method calls
bool RenderContext::TraverseFunctionDecl(const FunctionDecl * pFunctionDecl)
{
if (ignoreLocation(pFunctionDecl)) {
......@@ -48,12 +49,18 @@ bool RenderContext::TraverseFunctionDecl(const FunctionDecl * pFunctionDecl)
if ( pFunctionDecl != pFunctionDecl->getCanonicalDecl() ) {
return true;
}
// Ignore methods inside the OutputDevice class
const CXXMethodDecl *pCXXMethodDecl = dyn_cast<CXXMethodDecl>(pFunctionDecl);
if (pCXXMethodDecl) {
std::string aParentName = pCXXMethodDecl->getParent()->getQualifiedNameAsString();
if (aParentName == "OutputDevice")
return true;
}
// we are only currently interested in methods where the first parameter is RenderContext
string arg0 = pFunctionDecl->getParamDecl( 0 )->getType().getAsString();
if ( arg0.find("RenderContext") != std::string::npos ) {
return true;
}
mbChecking = true;
TraverseStmt(pFunctionDecl->getBody());
mbChecking = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment