[dragonegg] r185116 - Fix debug info for std::nullptr_t.
Peter Collingbourne
peter at pcc.me.uk
Thu Jun 27 15:52:53 PDT 2013
Author: pcc
Date: Thu Jun 27 17:52:53 2013
New Revision: 185116
URL: http://llvm.org/viewvc/llvm-project?rev=185116&view=rev
Log:
Fix debug info for std::nullptr_t.
Added:
dragonegg/trunk/test/validator/c++/nullptr_t.cpp
Modified:
dragonegg/trunk/src/Debug.cpp
Modified: dragonegg/trunk/src/Debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Debug.cpp?rev=185116&r1=185115&r2=185116&view=diff
==============================================================================
--- dragonegg/trunk/src/Debug.cpp (original)
+++ dragonegg/trunk/src/Debug.cpp Thu Jun 27 17:52:53 2013
@@ -918,7 +918,6 @@ DIType DebugInfo::getOrCreateType(tree t
DIType Ty;
switch (TREE_CODE(type)) {
case ERROR_MARK:
- case LANG_TYPE:
case TRANSLATION_UNIT_DECL:
default:
llvm_unreachable("Unsupported type");
@@ -926,6 +925,13 @@ DIType DebugInfo::getOrCreateType(tree t
#if (GCC_MINOR > 5)
case NULLPTR_TYPE:
#endif
+ case LANG_TYPE: {
+ tree name = TYPE_NAME(type);
+ if (TREE_CODE(name) == TYPE_DECL)
+ name = DECL_NAME(name);
+ return Builder.createUnspecifiedType(IDENTIFIER_POINTER(name));
+ }
+
case OFFSET_TYPE:
case POINTER_TYPE:
case REFERENCE_TYPE:
Added: dragonegg/trunk/test/validator/c++/nullptr_t.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/validator/c%2B%2B/nullptr_t.cpp?rev=185116&view=auto
==============================================================================
--- dragonegg/trunk/test/validator/c++/nullptr_t.cpp (added)
+++ dragonegg/trunk/test/validator/c++/nullptr_t.cpp Thu Jun 27 17:52:53 2013
@@ -0,0 +1,7 @@
+// RUN: %dragonegg -std=c++0x -g -S -o - %s | FileCheck %s
+// XFAIL: gcc-4.5
+
+// CHECK: [ DW_TAG_unspecified_type ] [decltype(nullptr)]
+decltype(nullptr) f() {
+ return nullptr;
+}
More information about the llvm-commits
mailing list