[PATCH] D56855: Add ___Z demangling to new common demangle function
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 18 05:22:52 PST 2019
jhenderson marked 4 inline comments as done.
jhenderson added inline comments.
================
Comment at: lib/Demangle/Demangle.cpp:17
+static bool isItaniumEncoding(const std::string &MangledName) {
+ std::size_t FirstNonUnderscore = MangledName.find_first_not_of('_');
+ // A valid Itanium encoding requires 1-4 leading underscores, followed by 'Z'.
----------------
grimar wrote:
> Using just `size_t` form seems to be much more common. But I see `std::size_t` is also used sometimes.
> Up to you. FTR in LLD we use `size_t`.
Looks like ItaniumDemangle.cpp exclusively uses just `size_t`, so I'll do that.
================
Comment at: lib/Demangle/Demangle.cpp:20
+ return FirstNonUnderscore > 0 && FirstNonUnderscore <= 4 &&
+ MangledName[FirstNonUnderscore] == 'Z';
+}
----------------
grimar wrote:
> Up to you again, but I would use just `I` or `Pos` for shortness:
>
> `std::size_t I = MangledName.find_first_not_of('_');`
> `return I > 0 && I <= 4 && MangledName[I] == 'Z';`
`Pos` is fine by me.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56855/new/
https://reviews.llvm.org/D56855
More information about the llvm-commits
mailing list