[libcxx] r292541 - Fix demangle helper after r286788

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 16:00:32 PST 2017


Author: ericwf
Date: Thu Jan 19 18:00:31 2017
New Revision: 292541

URL: http://llvm.org/viewvc/llvm-project?rev=292541&view=rev
Log:
Fix demangle helper after r286788

Modified:
    libcxx/trunk/test/support/demangle.h
    libcxx/trunk/test/support/test.support/test_demangle.pass.cpp

Modified: libcxx/trunk/test/support/demangle.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/demangle.h?rev=292541&r1=292540&r2=292541&view=diff
==============================================================================
--- libcxx/trunk/test/support/demangle.h (original)
+++ libcxx/trunk/test/support/demangle.h Thu Jan 19 18:00:31 2017
@@ -34,9 +34,7 @@ inline std::string demangle(const char*
 template <size_t N> struct Printer;
 inline std::string demangle(const char* mangled_name) {
   int status = 0;
-  std::string input(mangled_name);
-  input.insert(0, "_Z");
-  char* out = __cxxabiv1::__cxa_demangle(input.c_str(), nullptr, nullptr, &status);
+  char* out = __cxxabiv1::__cxa_demangle(mangled_name, nullptr, nullptr, &status);
   if (out != nullptr) {
     std::string res(out);
     std::free(out);

Modified: libcxx/trunk/test/support/test.support/test_demangle.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test.support/test_demangle.pass.cpp?rev=292541&r1=292540&r2=292541&view=diff
==============================================================================
--- libcxx/trunk/test/support/test.support/test_demangle.pass.cpp (original)
+++ libcxx/trunk/test/support/test.support/test_demangle.pass.cpp Thu Jan 19 18:00:31 2017
@@ -20,7 +20,7 @@ int main() {
     const char* raw;
     const char* expect;
   } TestCases[] = {
-      {typeid(int).name(), "i"}, // FIXME
+      {typeid(int).name(), "int"},
       {typeid(MyType).name(), "MyType"},
       {typeid(ArgumentListID<int, MyType>).name(), "ArgumentListID<int, MyType>"}
   };




More information about the cfe-commits mailing list