[PATCH] D11785: [llvm-symbolizer] Remove underscores and other C mangling on Windows

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 12:39:09 PDT 2015


rnk added inline comments.

================
Comment at: tools/llvm-symbolizer/LLVMSymbolize.cpp:226
@@ -180,1 +225,3 @@
       }
+      if (Opts.Demangle && isWin32Module())
+        demangleCOFFExternCFunc(LineInfo);
----------------
samsonov wrote:
> rnk wrote:
> > samsonov wrote:
> > > This is not the place we demangle the function names - see `LLVMSymbolizer::DemangleName`. At that point we already lose the knowledge of whether the module was ELF, or COFF, or MachO, but is it that important? Also, why doesn't `::UnDecorateSymbolName` work for you?
> > Yes, it's important that we only do this for 32-bit x86 symbols, which requires looking at the machine type of the module. See isWin32Module().
> > 
> > UnDecorateSymbolName only handles C++ symbols. This won't interfere because C++ symbols all start with '?'.
> Still, let's keep all the demangling work in a single place - where we actually render DILineInfo entries. If you need to know smth. about the object file that produced these DILineInfo entries (which looks reasonable - demangling is obviously format-dependent) - just pass it down to printDILineInfo/DemangleName.
I can do that, but it seems kind of silly to add a field to DILineInfo that is only used in LLVMSymbolize.cpp. There are other platforms with underscore prefixes, like MachO, that don't go this way. The underscore is removed earlier under an isMachO() in addSymbol().


http://reviews.llvm.org/D11785





More information about the llvm-commits mailing list