diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-07-07 00:49:35 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-07-07 00:49:35 +0000 |
commit | 3d2c051cf6535ccaba0ce35befe5ed17cfa6b8cf (patch) | |
tree | e22aee03de13d7e459e35c2b209e2197510f318d /clang/lib/CodeGen | |
parent | 9fe7f2396b5f1960fd3554f0d6c550c17b94b135 (diff) | |
download | bcm5719-llvm-3d2c051cf6535ccaba0ce35befe5ed17cfa6b8cf.tar.gz bcm5719-llvm-3d2c051cf6535ccaba0ce35befe5ed17cfa6b8cf.zip |
Debug info: Emit distinct __block_literal_generic types for blocks with
different function signatures. (Previously clang would emit all block
pointer types with the type of the first block pointer in the compile
unit.)
rdar://problem/21602473
llvm-svn: 241534
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 12 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 1 |
2 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 959c80632a6..ca02313bf58 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -705,9 +705,6 @@ llvm::DIType *CGDebugInfo::getOrCreateStructPtrType(StringRef Name, llvm::DIType *CGDebugInfo::CreateType(const BlockPointerType *Ty, llvm::DIFile *Unit) { - if (BlockLiteralGeneric) - return BlockLiteralGeneric; - SmallVector<llvm::Metadata *, 8> EltTys; QualType FType; uint64_t FieldSize, FieldOffset; @@ -753,12 +750,15 @@ llvm::DIType *CGDebugInfo::CreateType(const BlockPointerType *Ty, FieldOffset += FieldSize; Elements = DBuilder.getOrCreateArray(EltTys); + // The __block_literal_generic structs are marked with a special + // DW_AT_APPLE_BLOCK attribute and are an implementation detail only + // the debugger needs to know about. To allow type uniquing, emit + // them without a name or a location. EltTy = - DBuilder.createStructType(Unit, "__block_literal_generic", nullptr, LineNo, + DBuilder.createStructType(Unit, "", nullptr, LineNo, FieldOffset, 0, Flags, nullptr, Elements); - BlockLiteralGeneric = DBuilder.createPointerType(EltTy, Size); - return BlockLiteralGeneric; + return DBuilder.createPointerType(EltTy, Size); } llvm::DIType *CGDebugInfo::CreateType(const TemplateSpecializationType *Ty, diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 10d3b0d9ab0..d4a5bc80cae 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -65,7 +65,6 @@ class CGDebugInfo { llvm::DIType *OCLImage2dArrayDITy = nullptr; llvm::DIType *OCLImage3dDITy = nullptr; llvm::DIType *OCLEventDITy = nullptr; - llvm::DIType *BlockLiteralGeneric = nullptr; /// \brief Cache of previously constructed Types. llvm::DenseMap<const void *, llvm::TrackingMDRef> TypeCache; |