summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/redundantcast.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-05-30 14:39:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-05-30 14:39:23 +0200
commit3dda91dda8764adb3f6cc229236281bb270bba92 (patch)
tree5a593c5b7da9a4382b46af2451c423064b585f36 /compilerplugins/clang/redundantcast.cxx
parent81318b9a7b1d0f17250b15d6a65c7c04abc59193 (diff)
Traverse InitListExpr only once
Arbitrarily chosing to traverse the semantic instead of the syntactic form. Change-Id: Id1b4e49421a5550bb2fa9f0d7e6f83bf7abb6ebb
Diffstat (limited to 'compilerplugins/clang/redundantcast.cxx')
-rw-r--r--compilerplugins/clang/redundantcast.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index 6a554a774ee2..4ffef355bd6a 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -79,6 +79,15 @@ public:
}
}
+ bool TraverseInitListExpr(
+ InitListExpr * expr, DataRecursionQueue * queue = nullptr)
+ {
+ return WalkUpFromInitListExpr(expr)
+ && TraverseSynOrSemInitListExpr(
+ expr->isSemanticForm() ? expr : expr->getSemanticForm(),
+ queue);
+ }
+
bool VisitImplicitCastExpr(ImplicitCastExpr const * expr);
bool VisitCXXStaticCastExpr(CXXStaticCastExpr const * expr);