aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-11-29 23:57:40 +0000
committerEric Christopher <echristo@apple.com>2011-11-29 23:57:40 +0000
commitd5a3b7804f1594c9f21c7f2cee0920a66feeb93a (patch)
treee4798b211e008dcb288a3a2f8f4a3d2af984f587
parent5c2a1f741e133fcad4782b855a18d3b220243b11 (diff)
Make sure that forward declarations are marked as such in the debug info
for the structure type. rdar://10499337 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145461 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp3
-rw-r--r--test/CodeGenObjC/debug-info-fwddecl.m5
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index efffd2ca4c..922b725d9d 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1214,7 +1214,8 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
if (ID->isForwardDecl()) {
llvm::DIType FwdDecl =
DBuilder.createStructType(Unit, ID->getName(),
- DefUnit, Line, 0, 0, 0,
+ DefUnit, Line, 0, 0,
+ llvm::DIDescriptor::FlagFwdDecl,
llvm::DIArray(), RuntimeLang);
return FwdDecl;
}
diff --git a/test/CodeGenObjC/debug-info-fwddecl.m b/test/CodeGenObjC/debug-info-fwddecl.m
new file mode 100644
index 0000000000..bed632dff8
--- /dev/null
+++ b/test/CodeGenObjC/debug-info-fwddecl.m
@@ -0,0 +1,5 @@
+// RUN: %clang -fverbose-asm -g -S -emit-llvm %s -o - | FileCheck %s
+@class ForwardObjcClass;
+ForwardObjcClass *ptr = 0;
+
+// CHECK: !8 = metadata !{i32 720915, metadata !6, metadata !"ForwardObjcClass", metadata !6, i32 2, i64 0, i64 0, i32 0, i32 4, i32 0, null, i32 16, i32 0} ; [ DW_TAG_structure_type ]