diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-23 21:08:27 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-23 21:08:27 +0000 |
commit | 383f8413cf901c8ea026318b4f95ab00107fd38c (patch) | |
tree | ce01f4128a4169db0dfec840c355d05f60e18b43 /clang/lib | |
parent | a59d3e5af889662139b8b08f2175f12567491441 (diff) | |
download | bcm5719-llvm-383f8413cf901c8ea026318b4f95ab00107fd38c.tar.gz bcm5719-llvm-383f8413cf901c8ea026318b4f95ab00107fd38c.zip |
DebugInfo: Adapt to loss of DITypeRef in LLVM r267296
LLVM stopped using MDString-based type references, and DIBuilder no
longer fills 'retainedTypes:' with every DICompositeType that has an
'identifier:' field. There are just minor changes to keep the same
behaviour in CFE.
Leaving 'retainedTypes:' unfilled has a dramatic impact on the output
order of the IR though. There are a huge number of testcase changes,
which were unfortunately not really scriptable.
llvm-svn: 267297
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 9e8abdc2f5c..70a5f619aad 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1451,11 +1451,6 @@ llvm::DIType *CGDebugInfo::getOrCreateStandaloneType(QualType D, llvm::DIType *T = getOrCreateType(D, getOrCreateFile(Loc)); assert(T && "could not create debug info for type"); - // Composite types with UIDs were already retained by DIBuilder - // because they are only referenced by name in the IR. - if (auto *CTy = dyn_cast<llvm::DICompositeType>(T)) - if (!CTy->getIdentifier().empty()) - return T; RetainedTypes.push_back(D.getAsOpaquePtr()); return T; } @@ -3435,6 +3430,9 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, auto *RD = cast<RecordDecl>(VarD->getDeclContext()); getDeclContextDescriptor(VarD); // Ensure that the type is retained even though it's otherwise unreferenced. + // + // FIXME: This is probably unnecessary, since Ty should reference RD + // through its scope. RetainedTypes.push_back( CGM.getContext().getRecordType(RD).getAsOpaquePtr()); return; |