r285870 - Update manglings for C++17 noexcept function types to match Jason Merrill's

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 2 17:27:55 PDT 2016


Author: rsmith
Date: Wed Nov  2 19:27:54 2016
New Revision: 285870

URL: http://llvm.org/viewvc/llvm-project?rev=285870&view=rev
Log:
Update manglings for C++17 noexcept function types to match Jason Merrill's
proposal on cxx-abi-dev earlier today.

Modified:
    cfe/trunk/lib/AST/ItaniumMangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle-exception-spec.cpp
    cfe/trunk/test/CodeGenCXX/rtti-qualfn.cpp

Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=285870&r1=285869&r2=285870&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Wed Nov  2 19:27:54 2016
@@ -2585,18 +2585,18 @@ void CXXNameMangler::mangleType(const Fu
   // per cxx-abi-dev proposal on 2016-10-11.
   if (T->hasInstantiationDependentExceptionSpec()) {
     if (T->getExceptionSpecType() == EST_ComputedNoexcept) {
-      Out << "nX";
+      Out << "DO";
       mangleExpression(T->getNoexceptExpr());
       Out << "E";
     } else {
       assert(T->getExceptionSpecType() == EST_Dynamic);
-      Out << "tw";
+      Out << "Dw";
       for (auto ExceptTy : T->exceptions())
         mangleType(ExceptTy);
       Out << "E";
     }
   } else if (T->isNothrow(getASTContext())) {
-    Out << "nx";
+    Out << "Do";
   }
 
   Out << 'F';

Modified: cfe/trunk/test/CodeGenCXX/mangle-exception-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-exception-spec.cpp?rev=285870&r1=285869&r2=285870&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-exception-spec.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-exception-spec.cpp Wed Nov  2 19:27:54 2016
@@ -4,35 +4,35 @@
 // CHECK: define {{.*}} @_Z1aPFivE(
 void a(int() throw(int, float)) {}
 // CHECK-CXX11: define {{.*}} @_Z1bPFivE(
-// CHECK-CXX17: define {{.*}} @_Z1bPnxFivE(
+// CHECK-CXX17: define {{.*}} @_Z1bPDoFivE(
 void b(int() noexcept) {}
 // CHECK-CXX11: define {{.*}} @_Z1cPFivE(
-// CHECK-CXX17: define {{.*}} @_Z1cPnxFivE(
+// CHECK-CXX17: define {{.*}} @_Z1cPDoFivE(
 void c(int() throw()) {}
 // CHECK: define {{.*}} @_Z1dPFivE(
 void d(int() noexcept(false)) {}
 // CHECK-CXX11: define {{.*}} @_Z1ePFivE(
-// CHECK-CXX17: define {{.*}} @_Z1ePnxFivE(
+// CHECK-CXX17: define {{.*}} @_Z1ePDoFivE(
 void e(int() noexcept(true)) {}
 
 template<bool B> void f(int() noexcept(B)) {}
-// CHECK: define {{.*}} @_Z1fILb0EEvPnXT_EFivE(
+// CHECK: define {{.*}} @_Z1fILb0EEvPDOT_EFivE(
 template void f<false>(int());
-// CHECK: define {{.*}} @_Z1fILb1EEvPnXT_EFivE(
+// CHECK: define {{.*}} @_Z1fILb1EEvPDOT_EFivE(
 template void f<true>(int() noexcept);
 
 template<typename...T> void g(int() throw(T...)) {}
-// CHECK: define {{.*}} @_Z1gIJEEvPtwDpT_EFivE(
+// CHECK: define {{.*}} @_Z1gIJEEvPDwDpT_EFivE(
 template void g<>(int() noexcept);
-// CHECK: define {{.*}} @_Z1gIJfEEvPtwDpT_EFivE(
+// CHECK: define {{.*}} @_Z1gIJfEEvPDwDpT_EFivE(
 template void g<float>(int());
 
 // We consider the exception specifications in parameter and return type here
 // to be different.
 template<typename...T> auto h(int() throw(int, T...)) -> int (*)() throw(T..., int) { return nullptr; }
-// CHECK: define {{.*}} @_Z1hIJEEPtwDpT_iEFivEPtwiS1_EFivE(
+// CHECK: define {{.*}} @_Z1hIJEEPDwDpT_iEFivEPDwiS1_EFivE(
 template auto h<>(int()) -> int (*)();
-// CHECK: define {{.*}} @_Z1hIJfEEPtwDpT_iEFivEPtwiS1_EFivE(
+// CHECK: define {{.*}} @_Z1hIJfEEPDwDpT_iEFivEPDwiS1_EFivE(
 template auto h<float>(int()) -> int (*)();
 
 // FIXME: The C++11 manglings here are wrong; they should be the same as the
@@ -41,9 +41,9 @@ template auto h<float>(int()) -> int (*)
 // differ only in type sugar that is not relevant for mangling. (In this case,
 // the types differ in presence/absence of ParenType nodes under the pointer.)
 template<typename...T> auto i(int() throw(int, T...)) -> int (*)() throw(int, T...) { return nullptr; }
-// CHECK-CXX11: define {{.*}} @_Z1iIJEEPtwiDpT_EFivEPS2_(
-// CHECK-CXX17: define {{.*}} @_Z1iIJEEPtwiDpT_EFivES3_(
+// CHECK-CXX11: define {{.*}} @_Z1iIJEEPDwiDpT_EFivEPS2_(
+// CHECK-CXX17: define {{.*}} @_Z1iIJEEPDwiDpT_EFivES3_(
 template auto i<>(int()) -> int (*)();
-// CHECK-CXX11: define {{.*}} @_Z1iIJfEEPtwiDpT_EFivEPS2_(
-// CHECK-CXX17: define {{.*}} @_Z1iIJfEEPtwiDpT_EFivES3_(
+// CHECK-CXX11: define {{.*}} @_Z1iIJfEEPDwiDpT_EFivEPS2_(
+// CHECK-CXX17: define {{.*}} @_Z1iIJfEEPDwiDpT_EFivES3_(
 template auto i<float>(int()) -> int (*)();

Modified: cfe/trunk/test/CodeGenCXX/rtti-qualfn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/rtti-qualfn.cpp?rev=285870&r1=285869&r2=285870&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/rtti-qualfn.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/rtti-qualfn.cpp Wed Nov  2 19:27:54 2016
@@ -24,8 +24,8 @@ auto &ti_lref = typeid(void (A::*)() &);
 // CHECK-DAG: @_ZTIM1AFvvOE = [[PMFTI]] {{.*}}), i32 0, {{.*}} @_ZTIFvvOE
 auto &ti_rref = typeid(void (A::*)() &&);
 
-// CHECK-DAG: @_ZTInxFvvE = [[QFTI]] {{.*}} @_ZTIFvvE {{.*}}, i32 32 }, comdat
-// CHECK-DAG: @_ZTIM1AnxFvvE = [[PMFTI]] {{.*}}), i32 0, {{.*}} @_ZTInxFvvE
+// CHECK-DAG: @_ZTIDoFvvE = [[QFTI]] {{.*}} @_ZTIFvvE {{.*}}, i32 32 }, comdat
+// CHECK-DAG: @_ZTIM1ADoFvvE = [[PMFTI]] {{.*}}), i32 0, {{.*}} @_ZTIDoFvvE
 auto &ti_noexcept = typeid(void (A::*)() noexcept);
 
 //auto &ti_txsafe = typeid(void (A::*)() transaction_safe);
@@ -34,18 +34,18 @@ auto &ti_noexcept = typeid(void (A::*)()
 // CHECK-DAG: @_ZTIM1AFvvE = [[PMFTI]] {{.*}}), i32 0, {{.*}} @_ZTIFvvE
 auto &ti_noreturn = typeid(void __attribute__((noreturn)) (A::*)());
 
-// CHECK-DAG: @_ZTIrVKnxFvvRE = [[QFTI]] {{.*}} @_ZTIFvvE {{.*}}, i32 47 }, comdat
-// CHECK-DAG: @_ZTIM1ArVKnxFvvRE = [[PMFTI]] {{.*}}), i32 0, {{.*}} @_ZTIrVKnxFvvRE
+// CHECK-DAG: @_ZTIrVKDoFvvRE = [[QFTI]] {{.*}} @_ZTIFvvE {{.*}}, i32 47 }, comdat
+// CHECK-DAG: @_ZTIM1ArVKDoFvvRE = [[PMFTI]] {{.*}}), i32 0, {{.*}} @_ZTIrVKDoFvvRE
 auto &ti_rainbow = typeid(void (A::*)() const volatile __restrict & noexcept);
 
 // CHECK-LABEL: define void @_Z1fv(
 __attribute__((noreturn)) void f() noexcept {
-  // CHECK: call void @__cxa_throw({{.*}}@_ZTIPnxFvvE
+  // CHECK: call void @__cxa_throw({{.*}}@_ZTIPDoFvvE
   throw f;
 }
 
-// CHECK-LABEL: define void @_Z1gM1AnxFvvE(
+// CHECK-LABEL: define void @_Z1gM1ADoFvvE(
 void g(__attribute__((noreturn)) void (A::*p)() noexcept) {
-  // CHECK: call void @__cxa_throw({{.*}}@_ZTIM1AnxFvvE
+  // CHECK: call void @__cxa_throw({{.*}}@_ZTIM1ADoFvvE
   throw p;
 }




More information about the cfe-commits mailing list