diff options
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/constantparam.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compilerplugins/clang/constantparam.cxx b/compilerplugins/clang/constantparam.cxx index db82bc4df9ce..fd8f8f4e7992 100644 --- a/compilerplugins/clang/constantparam.cxx +++ b/compilerplugins/clang/constantparam.cxx @@ -116,10 +116,14 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde // ignore stuff that forms part of the stable URE interface if (isInUnoIncludeFile(functionDecl)) return; + SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( functionDecl->getLocation() ); - StringRef filename = getFilenameOfLocation(expansionLoc); + std::string filename = getFilenameOfLocation(expansionLoc).str(); + loplugin::normalizeDotDotInFilePath(filename); if (!loplugin::hasPathnamePrefix(filename, SRCDIR "/")) return; + if (loplugin::hasPathnamePrefix(filename, WORKDIR "/")) + return; filename = filename.substr(strlen(SRCDIR)+1); MyCallSiteInfo aInfo; @@ -149,8 +153,7 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde aInfo.paramType = functionDecl->getParamDecl(paramIndex)->getType().getCanonicalType().getAsString(); aInfo.callValue = callValue; - aInfo.sourceLocation = filename.str() + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); - loplugin::normalizeDotDotInFilePath(aInfo.sourceLocation); + aInfo.sourceLocation = filename + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); callSet.insert(aInfo); } |