diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:16:29 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:16:47 +0100 |
commit | 78ad5ecd988270f3308fe98cc128ddf832c0c00b (patch) | |
tree | 94074dc6e4bca25f1823f07f0651d21d0885eebd /compilerplugins/clang/salbool.cxx | |
parent | c1434d6826aec313854072c9614a2d281762f5e1 (diff) |
Clean up isMacroBodyExpansion
Change-Id: I745b320dd5f44d54371d8a0b961c49793e3e0ad6
Diffstat (limited to 'compilerplugins/clang/salbool.cxx')
-rw-r--r-- | compilerplugins/clang/salbool.cxx | 13 |
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" |