[cfe-commits] r139752 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenCXX/debug-info-char16.cpp test/CodeGenCXX/debug-info-nullptr.cpp

Devang Patel dpatel at apple.com
Wed Sep 14 16:14:14 PDT 2011


Author: dpatel
Date: Wed Sep 14 18:14:14 2011
New Revision: 139752

URL: http://llvm.org/viewvc/llvm-project?rev=139752&view=rev
Log:
Emit debug info for c++0x nullptr.

Added:
    cfe/trunk/test/CodeGenCXX/debug-info-nullptr.cpp
Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=139752&r1=139751&r2=139752&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Sep 14 18:14:14 2011
@@ -302,8 +302,8 @@
     assert(0 && "Unexpected builtin type UnknownAny");
     return llvm::DIType();
   case BuiltinType::NullPtr:
-    assert(0 && "Unexpected builtin type NullPtr");
-    return llvm::DIType();
+    return DBuilder.
+      createNullPtrType(BT->getName(CGM.getContext().getLangOptions()));
   case BuiltinType::Void:
     return llvm::DIType();
   case BuiltinType::ObjCClass:

Modified: cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp?rev=139752&r1=139751&r2=139752&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-char16.cpp Wed Sep 14 18:14:14 2011
@@ -1,7 +1,8 @@
 // RUN: %clang_cc1 -S -std=c++0x -masm-verbose -g %s -o -| FileCheck %s
 
-//CHECK:	.byte	16
-//CHECK-NEXT: 	.ascii	 "char16_t"
+//CHECK: 	.ascii	 "char16_t"
+//CHECK-NEXT:	.byte	0
+//CHECK-NEXT:	.byte	16
 
 // 16 is DW_ATE_UTF (0x10) encoding attribute.
 char16_t char_a = u'h';

Added: cfe/trunk/test/CodeGenCXX/debug-info-nullptr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-nullptr.cpp?rev=139752&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-nullptr.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/debug-info-nullptr.cpp Wed Sep 14 18:14:14 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -S -std=c++0x -masm-verbose -g %s -o -| FileCheck %s
+
+//CHECK: DW_TAG_unspecified_type
+//CHECK-NEXT: "nullptr_t"
+
+void foo() {
+  decltype(nullptr) t = 0;
+ }





More information about the cfe-commits mailing list