diff options
-rw-r--r-- | compilerplugins/clang/literaltoboolconversion.cxx | 4 | ||||
-rw-r--r-- | compilerplugins/clang/store/referencecasting.cxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compilerplugins/clang/literaltoboolconversion.cxx b/compilerplugins/clang/literaltoboolconversion.cxx index 5c87f474ec23..c94e0d1b014b 100644 --- a/compilerplugins/clang/literaltoboolconversion.cxx +++ b/compilerplugins/clang/literaltoboolconversion.cxx @@ -160,8 +160,8 @@ bool LiteralToBoolConversion::isFromCIncludeFile( return false; } #endif - return compiler.getSourceManager().getFilename(spellingLocation).endswith( - ".h"); + return StringRef(compiler.getSourceManager().getPresumedLoc(spellingLocation) + .getFilename()).endswith(".h"); } bool LiteralToBoolConversion::isMacroBodyExpansion(SourceLocation location) diff --git a/compilerplugins/clang/store/referencecasting.cxx b/compilerplugins/clang/store/referencecasting.cxx index 113002cf22eb..e6a1391c9040 100644 --- a/compilerplugins/clang/store/referencecasting.cxx +++ b/compilerplugins/clang/store/referencecasting.cxx @@ -97,7 +97,7 @@ static const Type* extractTemplateType(Expr* cce); bool ReferenceCasting::VisitCXXConstructExpr( CXXConstructExpr* cce ) { // don't bother processing anything in the Reference.h file. Makes my life easier when debugging this. - if( compiler.getSourceManager().getFilename( cce->getSourceRange().getBegin() ).find( "Reference.h" ) != StringRef::npos ) + if( StringRef(compiler.getSourceManager().getPresumedLoc( cce->getSourceRange().getBegin() )).find( "Reference.h" ) != StringRef::npos ) return true; // look for calls to the Reference<T>(x,UNO_something) constructor |