create TraverseSyntacticInitListExpr and TraverseSemanticInitListExpr.
Details
Diff Detail
Event Timeline
include/clang/AST/RecursiveASTVisitor.h | ||
---|---|---|
2083 | Did you try putting an assert(S->isSemanticForm()); (or the reverse) here? |
Yes, it breaks a few tests:
FAIL: Clang :: Analysis/operator-calls.cpp (598 of 8596)
FAIL: Clang :: Analysis/misc-ps-region-store.cpp (599 of 8596)
FAIL: Clang :: Analysis/array-struct-region.c (602 of 8596)
I think it's worth figuring out when this is called with the semantic or
syntactic version and why this can't lead to double visitation. Then add a
comment while you're changing the method so the next person doesn't have to
figure it all out :)
Use only one function.
I find somewhat frustating that getSemanticForm() returns nullptr if the object is already in its semantic form (and the same for isSyntacticForm()). Something like QualType::getNonReferenceType(), that returns the object itself if it is already a non-reference type, would be more intuitive.
Ok, I'd now pull out the first line of these functions into the TraverseInitListExpr, and then we only need one function here, right?