[PATCH] D67301: [LLD] [COFF] Use the unified llvm demangle frontend function. NFC.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 13:31:06 PDT 2019


mstorsjo added a comment.

In D67301#1684515 <https://reviews.llvm.org/D67301#1684515>, @rnk wrote:

> OK, so this is NFC for ELF, but has the relaxed __Z handling for COFF. lgtm


Yup, it uses the relaxed `_Z` handling which can match `__Z` as well (which should be not too plausible, and that's reserved identifiers in C). But on i386, I manually still strip out the leading underscore, if present, so a C level identifier which just starts with capital Z, which as an cdecl symbol on i386 ends up as `_Z...`, won't match. (This is a slightly more plausible scenario in my opinion.)

This extra handling just uses two pretty harmless lines of code, which I don't even touch in this patch, `if (config->machine == I386) demangleInput.consume_front("_");`. They could be dropped, making the demangling even more lax, but I don't see much harm in keeping them.

I'll push this (plus the two other smaller ELF related cleanups that were ok'd) tomorrow then.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67301/new/

https://reviews.llvm.org/D67301





More information about the llvm-commits mailing list