summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-07-06 21:31:35 +0000
committerAdrian Prantl <aprantl@apple.com>2015-07-06 21:31:35 +0000
commit498fff661d9b762bdb883742c582a9fcaadfa443 (patch)
treed25c6f4ceb698f0327961248cef2dc1402f01718 /clang
parentf2ea7e1d0219e68df0cdaf379d3046e5df3e85ca (diff)
downloadbcm5719-llvm-498fff661d9b762bdb883742c582a9fcaadfa443.tar.gz
bcm5719-llvm-498fff661d9b762bdb883742c582a9fcaadfa443.zip
Debug info: Don't emit a bogus location for the global block pointer type
(__block_literal_generic). The arbitrary nature of the location confuses lldb and prevents type uniquing. rdar://problem/21602473 llvm-svn: 241511
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp8
-rw-r--r--clang/test/CodeGen/debug-info-block.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 8c4b4b3d061..959c80632a6 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -723,10 +723,10 @@ llvm::DIType *CGDebugInfo::CreateType(const BlockPointerType *Ty,
EltTys.clear();
unsigned Flags = llvm::DINode::FlagAppleBlock;
- unsigned LineNo = getLineNumber(CurLoc);
+ unsigned LineNo = 0;
auto *EltTy =
- DBuilder.createStructType(Unit, "__block_descriptor", Unit, LineNo,
+ DBuilder.createStructType(Unit, "__block_descriptor", nullptr, LineNo,
FieldOffset, 0, Flags, nullptr, Elements);
// Bit size, align and offset of the type.
@@ -746,7 +746,7 @@ llvm::DIType *CGDebugInfo::CreateType(const BlockPointerType *Ty,
FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);
FieldSize = CGM.getContext().getTypeSize(Ty);
FieldAlign = CGM.getContext().getTypeAlign(Ty);
- EltTys.push_back(DBuilder.createMemberType(Unit, "__descriptor", Unit, LineNo,
+ EltTys.push_back(DBuilder.createMemberType(Unit, "__descriptor", nullptr, LineNo,
FieldSize, FieldAlign, FieldOffset,
0, DescTy));
@@ -754,7 +754,7 @@ llvm::DIType *CGDebugInfo::CreateType(const BlockPointerType *Ty,
Elements = DBuilder.getOrCreateArray(EltTys);
EltTy =
- DBuilder.createStructType(Unit, "__block_literal_generic", Unit, LineNo,
+ DBuilder.createStructType(Unit, "__block_literal_generic", nullptr, LineNo,
FieldOffset, 0, Flags, nullptr, Elements);
BlockLiteralGeneric = DBuilder.createPointerType(EltTy, Size);
diff --git a/clang/test/CodeGen/debug-info-block.c b/clang/test/CodeGen/debug-info-block.c
index c4930bfc3c8..697ed9ce7da 100644
--- a/clang/test/CodeGen/debug-info-block.c
+++ b/clang/test/CodeGen/debug-info-block.c
@@ -1,9 +1,11 @@
// RUN: %clang_cc1 -fblocks -g -emit-llvm -o - %s | FileCheck %s
// Verify that the desired debugging type is generated for a structure
-// member that is a pointer to a block.
+// member that is a pointer to a block.
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "__block_literal_generic"
+// CHECK-NOT: line
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "__block_descriptor"
+// CHECK-NOT: line
struct inStruct {
void (^genericBlockPtr)();
} is;
OpenPOWER on IntegriCloud