[PATCH] D111415: [Demangle] Add support for D simple qualified names
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 8 15:26:52 PDT 2021
dblaikie added a comment.
This patch still looks pretty long - perhaps it could be split up. Could support a single identifier first, then multiple identifiers (qualifiers) and then the LName things? (could be one at a time, but might be easy enough to check them all together there if they're really regularly structured)
================
Comment at: llvm/lib/Demangle/DLangDemangle.cpp:432-433
+ unsigned long Len) {
+ switch (Len) {
+ case 6:
+ if (strncmp(Mangled, "__ctor", Len) == 0) {
----------------
Might be easier to read with a StringSwitch (could make a StringRef from the Mnagled pointer and the length - maybe pass as StringRef here, rather than as the decomposed components) rather than a switch over length + strncmps?
================
Comment at: llvm/lib/Demangle/DLangDemangle.cpp:438-439
+ Mangled += Len;
+ return Mangled;
+ } else if (strncmp(Mangled, "__dtor", Len) == 0) {
+ /* Destructor symbol for a class/struct. */
----------------
Remove else-after-return(s)
================
Comment at: llvm/lib/Demangle/DLangDemangle.cpp:470-476
+ if (strncmp(Mangled, "__postblitMFZ", Len + 3) == 0) {
+ /* Postblit symbol for a struct. */
+ Decl->append("this(this)");
+ Mangled += Len + 3;
+ return Mangled;
+ }
+ break;
----------------
This appears to be unstested
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111415/new/
https://reviews.llvm.org/D111415
More information about the llvm-commits
mailing list