[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. LGTM, thank you @thakis! Comment at: clang/lib/Analysis/CFG.cpp:2407 + return hasSpecificAttr(A->getAttrs()) && + isa(A->getSubStmt()); +} hans wrote: > thakis wrote: > > hans wrote: > > > Can fallthrough statements ever

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-12 Thread Nico Weber via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc74ab84ea23f: [clang] Omit most AttributedStatements from the CFG (authored by thakis). Herald added a project: clang. Repository: rG LLVM Github

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-12 Thread Nico Weber via Phabricator via cfe-commits
thakis updated this revision to Diff 378996. thakis added a comment. rename param; assert isa CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111568/new/ https://reviews.llvm.org/D111568 Files: clang/lib/Analysis/CFG.cpp clang/test/SemaCXX/switch-implicit-fallthrough.cpp clang/test

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-12 Thread Hans Wennborg via Phabricator via cfe-commits
hans accepted this revision. hans added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Analysis/CFG.cpp:2407 + return hasSpecificAttr(A->getAttrs()) && + isa(A->getSubStmt()); +} thakis wrote: > hans wrote: > > Ca

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-12 Thread Nico Weber via Phabricator via cfe-commits
thakis marked an inline comment as done. thakis added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:2407 + return hasSpecificAttr(A->getAttrs()) && + isa(A->getSubStmt()); +} hans wrote: > Can fallthrough statements ever have children? If not,

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-12 Thread Hans Wennborg via Phabricator via cfe-commits
hans added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:545 CFGBlock *VisitAddrLabelExpr(AddrLabelExpr *A, AddStmtChoice asc); + CFGBlock *VisitAttributedStmt(AttributedStmt *C, AddStmtChoice asc); CFGBlock *VisitBinaryOperator(BinaryOperator *B, AddStmtChoice a

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-11 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:2418-2420 + // also no children, and omit the others. None of the other current StmtAttrs + // have semantic meaning for the CFG. + if (isFallthroughStatement(A) && asc.alwaysAdd(*this, A)) {

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for the fix to this! Comment at: clang/lib/Analysis/CFG.cpp:2418-2420 + // also no children, and omit the others. None of the other current StmtAttrs + // have semantic meaning for the CFG. + if (isFallthroughStatement(A) && asc.alway

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-11 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:2410 + +CFGBlock *CFGBuilder::VisitAttributedStmt(AttributedStmt *A, + AddStmtChoice asc) { (Compare this function to `CFGBuilder::VisitStmt` in this fil

[PATCH] D111568: [clang] Omit most AttributedStatements from the CFG

2021-10-11 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision. thakis added reviewers: hans, aaron.ballman. thakis requested review of this revision. `[[clang::fallthrough]]` has meaning for the CFG, but all other StmtAttrs we currently have don't. So omit them, as AttributedStatements with children cause several issues and there