[llvm-commits] [llvm-gcc-4.2] r80062 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Tue Aug 25 17:41:19 PDT 2009
Author: dpatel
Date: Tue Aug 25 19:41:19 2009
New Revision: 80062
URL: http://llvm.org/viewvc/llvm-project?rev=80062&view=rev
Log:
set llvm::DIType::FlagClosure for BLOCK structs.
Patch by Caroline Tice.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=80062&r1=80061&r2=80062&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue Aug 25 19:41:19 2009
@@ -584,13 +584,16 @@
if (TYPE_CONTEXT(type))
FwdName = GetNodeName(TYPE_CONTEXT(type));
FwdName = FwdName + GetNodeName(type);
+ unsigned Flags = llvm::DIType::FlagFwdDecl;
+ if (TYPE_BLOCK_IMPL_STRUCT(type))
+ Flags |= llvm::DIType::FlagClosure;
llvm::DICompositeType FwdDecl =
DebugFactory.CreateCompositeType(Tag,
findRegion(type),
FwdName,
getOrCreateCompileUnit(Loc.file),
Loc.line,
- 0, 0, 0, llvm::DIType::FlagFwdDecl,
+ 0, 0, 0, Flags,
llvm::DIType(), llvm::DIArray(),
RunTimeLang);
@@ -699,7 +702,7 @@
getOrCreateCompileUnit(Loc.file),
Loc.line,
NodeSizeInBits(type), NodeAlignInBits(type),
- 0, 0, llvm::DIType(), Elements,
+ 0, Flags, llvm::DIType(), Elements,
RunTimeLang);
// Now that we have a real decl for the struct, replace anything using the
@@ -803,10 +806,17 @@
case POINTER_TYPE:
case REFERENCE_TYPE:
- case BLOCK_POINTER_TYPE:
Ty = createPointerType(type);
break;
-
+
+ case BLOCK_POINTER_TYPE: {
+ DEBUGASSERT (generic_block_literal_struct_type &&
+ "Generic struct type for Blocks is missing!");
+ tree tmp_type = build_pointer_type(generic_block_literal_struct_type);
+ Ty = createPointerType(tmp_type);
+ break;
+ }
+
case OFFSET_TYPE: {
// gen_type_die(TYPE_OFFSET_BASETYPE(type), context_die);
// gen_type_die(TREE_TYPE(type), context_die);
More information about the llvm-commits
mailing list