[PATCH] demangle undefined symbol names in error message

kledzik at apple.com kledzik at apple.com
Tue Sep 30 14:08:31 PDT 2014


Hi ruiu, t.p.northover, shankar.easwaran,

The darwin linker has the -demangle option which directs it to demangle C++ (and soon Swift) mangled symbol names.  Long term we need some Diagnostics object for formatting errors and warnings.  But for now we have the Core linker just writing messages to llvm::errs().  So, to enable demangling, I changed the Resolver to call a LinkingContext method on the symbol name.

To make this more interesting, the demangling code is done via __cxa_demangle() which is part of the C++ ABI, which is only supported on some platforms, so I had to conditionalize the code with the config generated HAVE_CXXABI_H.

http://reviews.llvm.org/D5549

Files:
  include/lld/Core/LinkingContext.h
  include/lld/ReaderWriter/MachOLinkingContext.h
  lib/Core/Resolver.cpp
  lib/Driver/DarwinLdDriver.cpp
  lib/Driver/DarwinLdOptions.td
  lib/ReaderWriter/MachO/MachOLinkingContext.cpp
  test/mach-o/demangle.yaml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5549.14246.patch
Type: text/x-patch
Size: 7081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140930/43dc4427/attachment.bin>


More information about the llvm-commits mailing list