summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-09-21 17:48:37 +0000
committerAdrian Prantl <aprantl@apple.com>2015-09-21 17:48:37 +0000
commit85d938aadbea1ba16d893b49f94620bd6d706f98 (patch)
treed8f10a161f19f0a01a6b1fb104aa1f7ab83eb8f9 /clang/lib/CodeGen/CGDebugInfo.cpp
parent53d5cea648d8db7ceeedced4309e8ddd2c715578 (diff)
downloadbcm5719-llvm-85d938aadbea1ba16d893b49f94620bd6d706f98.tar.gz
bcm5719-llvm-85d938aadbea1ba16d893b49f94620bd6d706f98.zip
Debug Info: When building a module, emit skeleton CUs for imported modules.
llvm-svn: 248184
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 6af8d6626b4..ae1f5e7ecfa 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2161,7 +2161,14 @@ ObjCInterfaceDecl *CGDebugInfo::getObjCInterfaceDecl(QualType Ty) {
llvm::DIModule *CGDebugInfo::getParentModuleOrNull(const Decl *D) {
ExternalASTSource::ASTSourceDescriptor Info;
- if (ClangModuleMap) {
+ if (DebugTypeExtRefs && D->isFromASTFile()) {
+ // Record a reference to an imported clang module or precompiled header.
+ auto *Reader = CGM.getContext().getExternalSource();
+ auto Idx = D->getOwningModuleID();
+ auto Info = Reader->getSourceDescriptor(Idx);
+ if (Info)
+ return getOrCreateModuleRef(*Info, /*SkeletonCU=*/true);
+ } else if (ClangModuleMap) {
// We are building a clang module or a precompiled header.
//
// TODO: When D is a CXXRecordDecl or a C++ Enum, the ODR applies
@@ -2179,14 +2186,6 @@ llvm::DIModule *CGDebugInfo::getParentModuleOrNull(const Decl *D) {
}
}
- if (DebugTypeExtRefs && D->isFromASTFile()) {
- // Record a reference to an imported clang module or precompiled header.
- auto *Reader = CGM.getContext().getExternalSource();
- auto Idx = D->getOwningModuleID();
- auto Info = Reader->getSourceDescriptor(Idx);
- if (Info)
- return getOrCreateModuleRef(*Info, /*SkeletonCU=*/true);
- }
return nullptr;
}
OpenPOWER on IntegriCloud