Add an c++ itanium demangler to llvm.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 6 Sep 2016 19:16:48 +0000 (19:16 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 6 Sep 2016 19:16:48 +0000 (19:16 +0000)
commitb940b66c6032096d40dfd1859e2598749a30378c
tree8bbfb87f1e7b0e4584ca5d6b4096e13827addaf9
parent34ecf42bffe57ed1f4c45ac1ff0a3be2d5ed0dd1
Add an c++ itanium demangler to llvm.

This adds a copy of the demangler in libcxxabi.

The code also has no dependencies on anything else in LLVM. To enforce
that I added it as another library. That way a BUILD_SHARED_LIBS will
fail if anyone adds an use of StringRef for example.

The no llvm dependency combined with the fact that this has to build
on linux, OS X and Windows required a few changes to the code. In
particular:

    No constexpr.
    No alignas

On OS X at least this library has only one global symbol:
__ZN4llvm16itanium_demangleEPKcPcPmPi

My current plan is:

    Commit something like this
    Change lld to use it
    Change lldb to use it as the fallback

    Add a few #ifdefs so that exactly the same file can be used in
    libcxxabi to export abi::__cxa_demangle.

Once the fast demangler in lldb can handle any names this
implementation can be replaced with it and we will have the one true
demangler.

llvm-svn: 280732
20 files changed:
llvm/cmake/config-ix.cmake
llvm/include/llvm/Config/config.h.cmake
llvm/include/llvm/Demangle/Demangle.h [new file with mode: 0644]
llvm/lib/CMakeLists.txt
llvm/lib/Demangle/CMakeLists.txt [new file with mode: 0644]
llvm/lib/Demangle/ItaniumDemangle.cpp [new file with mode: 0644]
llvm/lib/Demangle/LLVMBuild.txt [new file with mode: 0644]
llvm/lib/LLVMBuild.txt
llvm/lib/Support/LLVMBuild.txt
llvm/lib/Support/Unix/Signals.inc
llvm/test/CMakeLists.txt
llvm/test/Demangle/lit.local.cfg [new file with mode: 0644]
llvm/test/Demangle/simple.test [new file with mode: 0644]
llvm/test/lit.cfg
llvm/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
llvm/tools/llvm-cxxfilt/CMakeLists.txt [new file with mode: 0644]
llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp [new file with mode: 0644]
llvm/tools/llvm-objdump/CMakeLists.txt
llvm/tools/llvm-objdump/LLVMBuild.txt
llvm/tools/llvm-objdump/MachODump.cpp