This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5918ef8b1aac: [clangd] Handle duplicate enum constants in
PopulateSwitch tweak (authored by njames93).
Changed prior to commit:
https://reviews.ll
sammccall accepted this revision.
sammccall added a comment.
Fantastic, thanks!
Still LG, comments optional.
Comment at: clang-tools-extra/clangd/refactor/tweaks/PopulateSwitch.cpp:61
private:
+ class EnumAndCovered {
+ public:
for this kind of purpose, we'
njames93 updated this revision to Diff 303580.
njames93 marked 3 inline comments as done.
njames93 added a comment.
Address comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90555/new/
https://reviews.llvm.org/D90555
Files:
clang-tools-extr
njames93 marked 6 inline comments as done.
njames93 added inline comments.
Comment at: clang-tools-extra/clangd/refactor/tweaks/PopulateSwitch.cpp:127
+ unsigned EnumIntWidth = Ctx.getIntWidth(QualType(EnumT, 0));
+ bool EnumIsSigned = EnumT->isSignedIntegerOrEnumerationType();
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
Comment at: clang-tools-extra/clangd/refactor/tweaks/PopulateSwitch.cpp:68
+ // Maps the Enum values to the EnumConstantDecl and a bool signifying if its
+ // cov
njames93 marked 6 inline comments as done.
njames93 added inline comments.
Comment at: clang-tools-extra/clangd/refactor/tweaks/PopulateSwitch.cpp:117
- // We trigger if there are fewer cases than enum values (and no case covers
- // multiple values). This guarantees we'll ha
njames93 updated this revision to Diff 303502.
njames93 added a comment.
Addressed comments.
Now using a MapVector to collect all uncovered cases in prepare, then just loop
over that in apply.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90555/new
sammccall added a comment.
Thanks!
This makes sense to me, I assumed at first that the expr could be something
complicated that we'd have to const-evaluate, thought clearly this already
happens (and we do assume it's a ConstantExpr).
Comment at: clang-tools-extra/clangd/refac
njames93 updated this revision to Diff 302191.
njames93 added a comment.
Herald added subscribers: llvm-commits, dexonsmith.
Herald added a project: LLVM.
Fix bug where prepare would return true erroneously when enum contains
duplicated constants
Repository:
rG LLVM Github Monorepo
CHANGES S
njames93 created this revision.
njames93 added a reviewer: sammccall.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman.
Herald added a project: clang.
njames93 requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.
If an enum has different names fo
10 matches
Mail list logo