[lld] r257678 - Update comment for __cxa_demangle.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 13:39:40 PST 2016


Author: ruiu
Date: Wed Jan 13 15:39:40 2016
New Revision: 257678

URL: http://llvm.org/viewvc/llvm-project?rev=257678&view=rev
Log:
Update comment for __cxa_demangle.

Modified:
    lld/trunk/ELF/Symbols.cpp

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=257678&r1=257677&r2=257678&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Wed Jan 13 15:39:40 2016
@@ -146,7 +146,10 @@ std::string elf2::demangle(StringRef Nam
   if (!Config->Demangle)
     return Name;
 
-  // Return if it does not look like a C++ symbol.
+  // Don't call __cxa_demangle if the name does not look like a C++
+  // symbol name. We need this check because some implementations of the
+  // function try to demangle a name as something different (e.g. type name)
+  // if it is not a mangled symbol name.
   if (!Name.startswith("_Z"))
     return Name;
 




More information about the llvm-commits mailing list