summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/unusedenumconstants.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/unusedenumconstants.cxx')
-rw-r--r--compilerplugins/clang/unusedenumconstants.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/compilerplugins/clang/unusedenumconstants.cxx b/compilerplugins/clang/unusedenumconstants.cxx
index 0c56314af888..692faa0fb5e9 100644
--- a/compilerplugins/clang/unusedenumconstants.cxx
+++ b/compilerplugins/clang/unusedenumconstants.cxx
@@ -12,8 +12,8 @@
#include <iostream>
#include <fstream>
#include <set>
+#include "config_clang.h"
#include "plugin.hxx"
-#include "compat.hxx"
/**
This looks for unused enum constants
@@ -67,6 +67,8 @@ public:
virtual void run() override
{
+ handler.enableTreeWideAnalysisMode();
+
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
if (!isUnitTestMode())
@@ -246,9 +248,7 @@ walk_up:
|| isa<ParenExpr>(parent)
|| isa<MaterializeTemporaryExpr>(parent)
|| isa<ExprWithCleanups>(parent)
-#if CLANG_VERSION >= 80000
|| isa<ConstantExpr>(parent)
-#endif
|| isa<CXXBindTemporaryExpr>(parent))
{
goto walk_up;
@@ -267,6 +267,10 @@ walk_up:
{
goto walk_up;
}
+ else if (isa<ParenListExpr>(parent))
+ {
+ goto walk_up;
+ }
else if (isa<UnresolvedLookupExpr>(parent)
|| isa<CompoundStmt>(parent))
{
@@ -284,7 +288,7 @@ walk_up:
declRefExpr->dump();
report( DiagnosticsEngine::Warning,
"unhandled clang AST node type",
- compat::getBeginLoc(parent));
+ parent->getBeginLoc());
}
if (bWrite) {