summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/constantparam.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-05-18 09:56:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-05-18 09:56:01 +0200
commitdf8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d (patch)
treeea5daefc9c1665ab14aeeedc0de4298c7c85a8b1 /compilerplugins/clang/constantparam.cxx
parent33cbc99fea5a3e4b87e883fd60ec97d4503109f3 (diff)
Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
Diffstat (limited to 'compilerplugins/clang/constantparam.cxx')
-rw-r--r--compilerplugins/clang/constantparam.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/compilerplugins/clang/constantparam.cxx b/compilerplugins/clang/constantparam.cxx
index 59f3d45b92a9..5f80b80358f3 100644
--- a/compilerplugins/clang/constantparam.cxx
+++ b/compilerplugins/clang/constantparam.cxx
@@ -64,8 +64,8 @@ public:
std::string fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() );
normalizeDotDotInFilePath(fn);
- if (fn == SRCDIR "/basegfx/source/matrix/b2dhommatrix.cxx"
- || fn == SRCDIR "/basegfx/source/matrix/b3dhommatrix.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/basegfx/source/matrix/b2dhommatrix.cxx")
+ || loplugin::isSamePathname(fn, SRCDIR "/basegfx/source/matrix/b3dhommatrix.cxx"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
@@ -118,7 +118,7 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde
return;
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( functionDecl->getLocation() );
StringRef filename = compiler.getSourceManager().getFilename(expansionLoc);
- if (!filename.startswith(SRCDIR))
+ if (!loplugin::hasPathnamePrefix(filename, SRCDIR))
return;
filename = filename.substr(strlen(SRCDIR)+1);