Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Yeah, I think this makes sense.
I think this sort of thing should ideally be captured in the include-cleaner design doc if there was one. (Doesn't make sense to create one just for this issue, but it seems like a doc that should exist).
| clang-tools-extra/include-cleaner/lib/WalkAST.cpp | ||
|---|---|---|
| 69 | Rather than override TraverseCXXOperatorCallExpr to do everything *except* call WalkUpFrom, maybe override WalkUpFromCXXOperatorCallExpr to call VisitCXXOperatorCallExpr but not WalkUpFromCallExpr? (With a comment that we don't want to treat operators as calls) | |
| 71 | maybe motivate this a little: (generally the type should provide them) | |
update
| clang-tools-extra/include-cleaner/lib/WalkAST.cpp | ||
|---|---|---|
| 69 |
Ah, not really (it is my fault that I missed to call WalkUpFrom, but it is not the key point) . -CXXOperatorCallExpr 0x5591a97f5280 <col:9, col:27> 'int' '+'
|-ImplicitCastExpr 0x5591a97f5268 <col:18> 'int (*)(string, string)' <FunctionToPointerDecay>
| `-DeclRefExpr 0x5591a97f51e8 <col:18> 'int (string, string)' lvalue Function 0x5591a97f4878 'operator+' 'int (string, string)'
|-CXXTemporaryObjectExpr 0x5591a97f5068 <col:9, col:16> 'string':'string' 'void () noexcept' zeroing
`-CXXTemporaryObjectExpr 0x5591a97f51b8 <col:20, col:27>I added the WalkUpFromCXXOperatorCallExpr back (I think it doesn't have any effect on the current code because we don't do anything on the CXXOperatorCallExpr hierarchy classes). | |
| clang-tools-extra/include-cleaner/lib/WalkAST.cpp | ||
|---|---|---|
| 69 | Yeah, sorry I was confused and thought we handled function refs in CallExpr instead of DeclRefExpr | |
| 75 | This comment doesn't mention the callee at all, and the callee is the point. Maybe: "Don't traverse the callee." and add a newline before the arguments() loop? | |
Rather than override TraverseCXXOperatorCallExpr to do everything *except* call WalkUpFrom, maybe override WalkUpFromCXXOperatorCallExpr to call VisitCXXOperatorCallExpr but not WalkUpFromCallExpr? (With a comment that we don't want to treat operators as calls)