fix filename detection in clang plugins
SourceManager::getFilename() returns "<stdin>" whenever icecream is used. Change-Id: I4e3e1b90880c5fd2b53f20e4ce3e38e3a0486973
This commit is contained in:
@@ -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)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user