[PATCH] D61814: [CFG] NFC: Remove implicit conversion from CFGTerminator to Stmt *, make it a variant class instead.
Aleksei Sidorin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat May 11 11:17:33 PDT 2019
a_sidorin accepted this revision.
a_sidorin added a comment.
This revision is now accepted and ready to land.
The conversion operator indeed looks non-evident.
================
Comment at: clang/include/clang/Analysis/CFG.h:513
public:
- CFGTerminator() = default;
- CFGTerminator(Stmt *S, bool TemporaryDtorsBranch = false)
- : Data(S, TemporaryDtorsBranch) {}
+ CFGTerminator() { assert(!isValid()); }
+ CFGTerminator(Stmt *S, Kind K = StmtBranch) : Data(S, K) {}
----------------
It seems to me that `isStmt()` and `isTemporaryDtorBranch()` methods can make the code a bit cleaner in few places by avoiding comparisons with enums.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61814/new/
https://reviews.llvm.org/D61814
More information about the cfe-commits
mailing list