IR: Require DICompositeType for ODR uniquing type map

Tighten up the API for debug info ODR type uniquing in LLVMContext.  The
only reason to allow other DIType subclasses is to make the unit tests
prettier :/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2016-04-19 14:42:55 +00:00
parent ee5f5d934b
commit ef55fa5ba5
6 changed files with 22 additions and 19 deletions

View File

@@ -2192,12 +2192,12 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
// mapping.
unsigned Flags = Record[10];
auto *Identifier = getMDString(Record[15]);
DIType **MappedT = nullptr;
DICompositeType **MappedT = nullptr;
if (!(Flags & DINode::FlagFwdDecl) && Identifier)
MappedT = Context.getOrInsertODRUniquedType(*Identifier);
// Use the mapped type node, or create a new one if necessary.
DIType *CT = MappedT ? *MappedT : nullptr;
DICompositeType *CT = MappedT ? *MappedT : nullptr;
if (!CT) {
CT = GET_OR_DISTINCT(
DICompositeType, Record[0],