summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-04-20 23:59:32 +0000
committerAdrian Prantl <aprantl@apple.com>2016-04-20 23:59:32 +0000
commit50fd1a87c4d1a5a78e0dab6f8d6ca5db7960de0e (patch)
tree0ab8d932308f2c94c175a3b4fcfcfbd5cf6097da /clang/lib/CodeGen
parenta8bae8237321a37f2412a00a46ea8d005b82809b (diff)
downloadbcm5719-llvm-50fd1a87c4d1a5a78e0dab6f8d6ca5db7960de0e.tar.gz
bcm5719-llvm-50fd1a87c4d1a5a78e0dab6f8d6ca5db7960de0e.zip
Module Debugging: Emit the canonical debug info for Objective-C classes
in the compile unit that contains their implementation even if their interface is declared in a module. The private @implementation of an @interface may have additional hidden ivars so we should not defer to the public version of the type that is found in the module. <rdar://problem/25541798> llvm-svn: 266937
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 0c61496162a..9e8abdc2f5c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1664,8 +1664,11 @@ llvm::DIType *CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
if (!ID)
return nullptr;
- // Return a forward declaration if this type was imported from a clang module.
- if (DebugTypeExtRefs && ID->isFromASTFile() && ID->getDefinition())
+ // Return a forward declaration if this type was imported from a clang module,
+ // and this is not the compile unit with the implementation of the type (which
+ // may contain hidden ivars).
+ if (DebugTypeExtRefs && ID->isFromASTFile() && ID->getDefinition() &&
+ !ID->getImplementation())
return DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
ID->getName(),
getDeclContextDescriptor(ID), Unit, 0);
OpenPOWER on IntegriCloud