[cfe-commits] r118236 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle.cpp

Anders Carlsson andersca at mac.com
Wed Nov 3 21:31:32 PDT 2010


Author: andersca
Date: Wed Nov  3 23:31:32 2010
New Revision: 118236

URL: http://llvm.org/viewvc/llvm-project?rev=118236&view=rev
Log:
Mangle std::nullptr_t as specified by the Itanium C++ ABI.

Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=118236&r1=118235&r2=118236&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Wed Nov  3 23:31:32 2010
@@ -1219,9 +1219,8 @@
   // UNSUPPORTED:    ::= Dh # IEEE 754r half-precision floating point (16 bits)
   //                 ::= Di # char32_t
   //                 ::= Ds # char16_t
+  //                 ::= Dn # std::nullptr_t (i.e., decltype(nullptr))
   //                 ::= u <source-name>    # vendor extended type
-  // From our point of view, std::nullptr_t is a builtin, but as far as mangling
-  // is concerned, it's a type called std::nullptr_t.
   switch (T->getKind()) {
   case BuiltinType::Void: Out << 'v'; break;
   case BuiltinType::Bool: Out << 'b'; break;
@@ -1244,7 +1243,7 @@
   case BuiltinType::Float: Out << 'f'; break;
   case BuiltinType::Double: Out << 'd'; break;
   case BuiltinType::LongDouble: Out << 'e'; break;
-  case BuiltinType::NullPtr: Out << "St9nullptr_t"; break;
+  case BuiltinType::NullPtr: Out << "Dn"; break;
 
   case BuiltinType::Overload:
   case BuiltinType::Dependent:

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=118236&r1=118235&r2=118236&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Wed Nov  3 23:31:32 2010
@@ -630,3 +630,8 @@
   // CHECK: define void @_ZN6test2112vla_arg_funcEiPA_i(
   void vla_arg_func(int X, int a[X][X]) {}
 }
+
+namespace test22 {
+  // CHECK: define void @_ZN6test221fEDn(
+  void f(decltype(nullptr)) { }
+}





More information about the cfe-commits mailing list