diff options
Diffstat (limited to 'compilerplugins/clang/literaltoboolconversion.cxx')
-rw-r--r-- | compilerplugins/clang/literaltoboolconversion.cxx | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/compilerplugins/clang/literaltoboolconversion.cxx b/compilerplugins/clang/literaltoboolconversion.cxx index 65fe53cdcfba..00ecdd8045c1 100644 --- a/compilerplugins/clang/literaltoboolconversion.cxx +++ b/compilerplugins/clang/literaltoboolconversion.cxx @@ -29,8 +29,6 @@ public: private: bool isFromCIncludeFile(SourceLocation spellingLocation) const; - - bool isMacroBodyExpansion(SourceLocation location) const; }; bool LiteralToBoolConversion::VisitImplicitCastExpr( @@ -64,7 +62,7 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr( while (compiler.getSourceManager().isMacroArgExpansion(loc)) { loc = compiler.getSourceManager().getImmediateMacroCallerLoc(loc); } - if (isMacroBodyExpansion(loc)) { + if (isMacroBodyExpansion(compiler, loc)) { StringRef name { Lexer::getImmediateMacroName( loc, compiler.getSourceManager(), compiler.getLangOpts()) }; if (name == "sal_False" || name == "sal_True") { @@ -166,17 +164,6 @@ bool LiteralToBoolConversion::isFromCIncludeFile( .endswith(".h")); } -bool LiteralToBoolConversion::isMacroBodyExpansion(SourceLocation location) - const -{ -#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3 - return compiler.getSourceManager().isMacroBodyExpansion(location); -#else - return location.isMacroID() - && !compiler.getSourceManager().isMacroArgExpansion(location); -#endif -} - loplugin::Plugin::Registration<LiteralToBoolConversion> X( "literaltoboolconversion", true); |