This conversion does indeed save some code, but i plan to add support for more kinds of terminators that aren't necessarily based on statements, and as i do, it becomes more and more confusing to have it implicitly convertible to a Stmt *.
Details
Details
- Reviewers
dcoughlin xazax.hun a_sidorin rnkovacs mikhail.ramalho Szelethus baloghadamsoftware Charusso - Commits
- rG4e53032d9bdb: [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *.
rC361586: [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *.
rL361586: [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
The conversion operator indeed looks non-evident.
clang/include/clang/Analysis/CFG.h | ||
---|---|---|
521–522 | It seems to me that isStmt() and isTemporaryDtorBranch() methods can make the code a bit cleaner in few places by avoiding comparisons with enums. |
Comment Actions
LGTM!
clang/include/clang/Analysis/CFG.h | ||
---|---|---|
522 | Can we add something to check that the integer part of Data is actually large enough to store an object of type Kind, even if we add more values to the enum? |
clang/lib/Analysis/ReachableCode.cpp | ||
---|---|---|
465 | isStmtBranch()? |
It seems to me that isStmt() and isTemporaryDtorBranch() methods can make the code a bit cleaner in few places by avoiding comparisons with enums.