[cfe-commits] r145461 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenObjC/debug-info-fwddecl.m

Eric Christopher echristo at apple.com
Tue Nov 29 15:57:40 PST 2011


Author: echristo
Date: Tue Nov 29 17:57:40 2011
New Revision: 145461

URL: http://llvm.org/viewvc/llvm-project?rev=145461&view=rev
Log:
Make sure that forward declarations are marked as such in the debug info
for the structure type.

rdar://10499337

Added:
    cfe/trunk/test/CodeGenObjC/debug-info-fwddecl.m
Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=145461&r1=145460&r2=145461&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Nov 29 17:57:40 2011
@@ -1214,7 +1214,8 @@
   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;
   }

Added: cfe/trunk/test/CodeGenObjC/debug-info-fwddecl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-fwddecl.m?rev=145461&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-fwddecl.m (added)
+++ cfe/trunk/test/CodeGenObjC/debug-info-fwddecl.m Tue Nov 29 17:57:40 2011
@@ -0,0 +1,5 @@
+// RUN: %clang -fverbose-asm -g -S -emit-llvm %s -o - | FileCheck %s
+ at 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 ]





More information about the cfe-commits mailing list