summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/salbool.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/salbool.cxx')
-rw-r--r--compilerplugins/clang/salbool.cxx13
1 files changed, 1 insertions, 12 deletions
diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx
index f5ee945db673..933f80fc7839 100644
--- a/compilerplugins/clang/salbool.cxx
+++ b/compilerplugins/clang/salbool.cxx
@@ -153,8 +153,6 @@ public:
private:
bool isInSpecialMainFile(SourceLocation spellingLocation) const;
- bool isMacroBodyExpansion(SourceLocation location) const;
-
bool rewrite(SourceLocation location);
std::set<VarDecl const *> varDecls_;
@@ -274,7 +272,7 @@ bool SalBool::VisitCStyleCastExpr(CStyleCastExpr * expr) {
while (compiler.getSourceManager().isMacroArgExpansion(loc)) {
loc = compiler.getSourceManager().getImmediateMacroCallerLoc(loc);
}
- if (isMacroBodyExpansion(loc)) {
+ if (compat::isMacroBodyExpansion(compiler, loc)) {
StringRef name { Lexer::getImmediateMacroName(
loc, compiler.getSourceManager(), compiler.getLangOpts()) };
if (name == "sal_False" || name == "sal_True") {
@@ -580,15 +578,6 @@ bool SalBool::isInSpecialMainFile(SourceLocation spellingLocation) const {
== SRCDIR "/cppu/qa/test_any.cxx");
}
-bool SalBool::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
-}
-
bool SalBool::rewrite(SourceLocation location) {
if (rewriter != nullptr) {
//TODO: "::sal_Bool" -> "bool", not "::bool"