summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/saloverride.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/compilerplugins/clang/saloverride.cxx b/compilerplugins/clang/saloverride.cxx
index 6b62fb3e0322..bb6766b64823 100644
--- a/compilerplugins/clang/saloverride.cxx
+++ b/compilerplugins/clang/saloverride.cxx
@@ -25,8 +25,7 @@ class SalOverride:
public:
explicit SalOverride(InstantiationData const & data): RewritePlugin(data) {}
- virtual void run() override
- { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+ virtual void run() override;
bool VisitCXXMethodDecl(CXXMethodDecl const * decl);
@@ -34,6 +33,14 @@ private:
std::set<SourceLocation> insertions_;
};
+void SalOverride::run() {
+ if (compiler.getLangOpts().CPlusPlus
+ && compiler.getPreprocessor().getIdentifierInfo(
+ "LIBO_INTERNAL_ONLY")->hasMacroDefinition())
+ {
+ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+ }
+}
bool SalOverride::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
// As a heuristic, ignore declarations where the name is spelled out in an
// ignored location; that e.g. handles uses of the Q_OBJECT macro from