[PATCH] D56855: Add ___Z demangling to new common demangle function

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 18 02:30:18 PST 2019


grimar added inline comments.


================
Comment at: lib/Demangle/Demangle.cpp:19
+  if (MangledName.compare(0, 2, "_Z") == 0 ||
+      MangledName.compare(0, 4, "___Z") == 0)
     Demangled = itaniumDemangle(MangledName.c_str(), nullptr, nullptr, nullptr);
----------------
grimar wrote:
> I wonder if
> 
> ```
> MangledName.compare(0, string::npos, "___Z")
> ```
>  
> would be a bit more readable way here?
> ("A value of string::npos indicates all characters until the end of the string.",
> http://www.cplusplus.com/reference/string/string/compare/)
I think there is no much difference. I just had to count the amount of '_`, but the initial version is better I think now.


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