Kaydet (Commit) a349a476 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:saloverride does not make sense for external code

...where SAL_OVERRIDE is not available

Change-Id: I49d447ba90516f4f744c21302607bff97ad3c4d5
üst df35af41
...@@ -25,8 +25,7 @@ class SalOverride: ...@@ -25,8 +25,7 @@ class SalOverride:
public: public:
explicit SalOverride(InstantiationData const & data): RewritePlugin(data) {} explicit SalOverride(InstantiationData const & data): RewritePlugin(data) {}
virtual void run() override virtual void run() override;
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
bool VisitCXXMethodDecl(CXXMethodDecl const * decl); bool VisitCXXMethodDecl(CXXMethodDecl const * decl);
...@@ -34,6 +33,14 @@ private: ...@@ -34,6 +33,14 @@ private:
std::set<SourceLocation> insertions_; 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) { bool SalOverride::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
// As a heuristic, ignore declarations where the name is spelled out in an // 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 // ignored location; that e.g. handles uses of the Q_OBJECT macro from
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment