diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-17 16:20:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-18 08:51:07 +0200 |
commit | 9d8d2e0787b8d866a651bcb9778393fb080ab6e8 (patch) | |
tree | 816f0b3452abf1f95c726b928c2ce0008b7e05e1 /compilerplugins | |
parent | loplugin:inlineablemethods in writerfilter (diff) | |
download | core-9d8d2e0787b8d866a651bcb9778393fb080ab6e8.tar.gz core-9d8d2e0787b8d866a651bcb9778393fb080ab6e8.zip |
simplify inlineablemethods loplugin
Change-Id: I72750a14664aa042da232c35cca3373ce367cfb0
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/inlineablemethods.cxx | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/compilerplugins/clang/inlineablemethods.cxx b/compilerplugins/clang/inlineablemethods.cxx index df98463a3547..032853be326e 100644 --- a/compilerplugins/clang/inlineablemethods.cxx +++ b/compilerplugins/clang/inlineablemethods.cxx @@ -103,7 +103,6 @@ private: std::string toString(SourceLocation loc); void functionTouchedFromExpr( const FunctionDecl* calleeFunctionDecl, const Expr* expr ); bool isCalleeFunctionInteresting( const FunctionDecl* ); - void logCalledFrom(SourceLocation calleeSite, const FunctionDecl* functionDecl); // I use traverse and a member variable because I cannot find a reliable way of walking back up the AST tree using the parentStmt() stuff // TODO doesn't cope with nested functions @@ -274,7 +273,7 @@ void InlineableMethods::functionTouchedFromExpr( const FunctionDecl* calleeFunct return; } - logCalledFrom(expr->getLocStart(), canonicalFunctionDecl); + calledFromMap.emplace(toString(expr->getLocStart()), niceName(canonicalFunctionDecl)); if (const UnaryOperator* unaryOp = dyn_cast_or_null<UnaryOperator>(parentStmt(expr))) { if (unaryOp->getOpcode() == UO_AddrOf) { @@ -291,14 +290,6 @@ void InlineableMethods::functionTouchedFromExpr( const FunctionDecl* calleeFunct } } -void InlineableMethods::logCalledFrom(SourceLocation calleeLoc, const FunctionDecl* functionDecl) -{ - functionDecl = functionDecl->getCanonicalDecl(); - while (functionDecl->getTemplateInstantiationPattern()) - functionDecl = functionDecl->getTemplateInstantiationPattern(); - calledFromMap.emplace(toString(calleeLoc), niceName(functionDecl)); -} - bool InlineableMethods::isCalleeFunctionInteresting(const FunctionDecl* functionDecl) { // ignore stuff that forms part of the stable URE interface |