summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/literaltoboolconversion.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-03-23 15:31:04 +0100
committerLuboš Luňák <l.lunak@collabora.com>2014-03-23 16:26:53 +0100
commitf7859e52829a44e04692653079aea3a5df4579da (patch)
tree8ca064ee56051b91a49f76a5b6d54027e80f5d39 /compilerplugins/clang/literaltoboolconversion.cxx
parent59698a4797101a286c177069c41d43762de6a4d5 (diff)
fix filename detection in clang plugins
SourceManager::getFilename() returns "<stdin>" whenever icecream is used. Change-Id: I4e3e1b90880c5fd2b53f20e4ce3e38e3a0486973
Diffstat (limited to 'compilerplugins/clang/literaltoboolconversion.cxx')
-rw-r--r--compilerplugins/clang/literaltoboolconversion.cxx4
1 files changed, 2 insertions, 2 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)