return cast_or_null<MDString>(getMDOrNull(ID));
};
-#define GET_OR_DISTINCT(CLASS, DISTINCT, ARGS) \
- (DISTINCT ? CLASS::getDistinct ARGS : CLASS::get ARGS)
+#define GET_OR_DISTINCT(CLASS, ARGS) \
+ (IsDistinct ? CLASS::getDistinct ARGS : CLASS::get ARGS)
// Read all the records.
while (1) {
if (Record.size() != 5)
return error("Invalid record");
+ IsDistinct = Record[0];
unsigned Line = Record[1];
unsigned Column = Record[2];
Metadata *Scope = getMD(Record[3]);
Metadata *InlinedAt = getMDOrNull(Record[4]);
MetadataList.assignValue(
- GET_OR_DISTINCT(DILocation, Record[0],
+ GET_OR_DISTINCT(DILocation,
(Context, Line, Column, Scope, InlinedAt)),
NextMetadataNo++);
break;
if (Record.size() < 4)
return error("Invalid record");
+ IsDistinct = Record[0];
unsigned Tag = Record[1];
unsigned Version = Record[2];
for (unsigned I = 4, E = Record.size(); I != E; ++I)
DwarfOps.push_back(getMDOrNull(Record[I]));
MetadataList.assignValue(
- GET_OR_DISTINCT(GenericDINode, Record[0],
- (Context, Tag, Header, DwarfOps)),
+ GET_OR_DISTINCT(GenericDINode, (Context, Tag, Header, DwarfOps)),
NextMetadataNo++);
break;
}
if (Record.size() != 3)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DISubrange, Record[0],
+ GET_OR_DISTINCT(DISubrange,
(Context, Record[1], unrotateSign(Record[2]))),
NextMetadataNo++);
break;
if (Record.size() != 3)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(
- DIEnumerator, Record[0],
- (Context, unrotateSign(Record[1]), getMDString(Record[2]))),
+ GET_OR_DISTINCT(DIEnumerator, (Context, unrotateSign(Record[1]),
+ getMDString(Record[2]))),
NextMetadataNo++);
break;
}
if (Record.size() != 6)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIBasicType, Record[0],
+ GET_OR_DISTINCT(DIBasicType,
(Context, Record[1], getMDString(Record[2]),
Record[3], Record[4], Record[5])),
NextMetadataNo++);
if (Record.size() != 12)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIDerivedType, Record[0],
+ GET_OR_DISTINCT(DIDerivedType,
(Context, Record[1], getMDString(Record[2]),
getMDOrNull(Record[3]), Record[4],
getMDOrNull(Record[5]), getMDOrNull(Record[6]),
// If we have a UUID and this is not a forward declaration, lookup the
// mapping.
- bool IsDistinct = Record[0];
+ IsDistinct = Record[0];
unsigned Tag = Record[1];
MDString *Name = getMDString(Record[2]);
Metadata *File = getMDOrNull(Record[3]);
// Create a node if we didn't get a lazy ODR type.
if (!CT)
- CT = GET_OR_DISTINCT(DICompositeType, IsDistinct,
+ CT = GET_OR_DISTINCT(DICompositeType,
(Context, Tag, Name, File, Line, Scope, BaseType,
SizeInBits, AlignInBits, OffsetInBits, Flags,
Elements, RuntimeLang, VTableHolder,
if (Record.size() != 3)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DISubroutineType, Record[0],
+ GET_OR_DISTINCT(DISubroutineType,
(Context, Record[1], getMDOrNull(Record[2]))),
NextMetadataNo++);
break;
if (Record.size() != 6)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIModule, Record[0],
+ GET_OR_DISTINCT(DIModule,
(Context, getMDOrNull(Record[1]),
getMDString(Record[2]), getMDString(Record[3]),
getMDString(Record[4]), getMDString(Record[5]))),
if (Record.size() != 3)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIFile, Record[0], (Context, getMDString(Record[1]),
- getMDString(Record[2]))),
+ GET_OR_DISTINCT(DIFile, (Context, getMDString(Record[1]),
+ getMDString(Record[2]))),
NextMetadataNo++);
break;
}
// Ignore Record[0], which indicates whether this compile unit is
// distinct. It's always distinct.
+ IsDistinct = true;
auto *CU = DICompileUnit::getDistinct(
Context, Record[1], getMDOrNull(Record[2]), getMDString(Record[3]),
Record[4], getMDString(Record[5]), Record[6], getMDString(Record[7]),
if (Record.size() != 18 && Record.size() != 19)
return error("Invalid record");
+ IsDistinct =
+ Record[0] || Record[8]; // All definitions should be distinct.
// Version 1 has a Function as Record[15].
// Version 2 has removed Record[15].
// Version 3 has the Unit as Record[15].
bool HasCU = Offset && !HasFn;
DISubprogram *SP = GET_OR_DISTINCT(
DISubprogram,
- Record[0] || Record[8], // All definitions should be distinct.
(Context, getMDOrNull(Record[1]), getMDString(Record[2]),
getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],
getMDOrNull(Record[6]), Record[7], Record[8], Record[9],
if (Record.size() != 5)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DILexicalBlock, Record[0],
+ GET_OR_DISTINCT(DILexicalBlock,
(Context, getMDOrNull(Record[1]),
getMDOrNull(Record[2]), Record[3], Record[4])),
NextMetadataNo++);
if (Record.size() != 4)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DILexicalBlockFile, Record[0],
+ GET_OR_DISTINCT(DILexicalBlockFile,
(Context, getMDOrNull(Record[1]),
getMDOrNull(Record[2]), Record[3])),
NextMetadataNo++);
if (Record.size() != 5)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DINamespace, Record[0],
- (Context, getMDOrNull(Record[1]),
- getMDOrNull(Record[2]), getMDString(Record[3]),
- Record[4])),
+ GET_OR_DISTINCT(DINamespace, (Context, getMDOrNull(Record[1]),
+ getMDOrNull(Record[2]),
+ getMDString(Record[3]), Record[4])),
NextMetadataNo++);
break;
}
if (Record.size() != 5)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIMacro, Record[0],
+ GET_OR_DISTINCT(DIMacro,
(Context, Record[1], Record[2],
getMDString(Record[3]), getMDString(Record[4]))),
NextMetadataNo++);
if (Record.size() != 5)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIMacroFile, Record[0],
+ GET_OR_DISTINCT(DIMacroFile,
(Context, Record[1], Record[2],
getMDOrNull(Record[3]), getMDOrNull(Record[4]))),
NextMetadataNo++);
if (Record.size() != 3)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(GET_OR_DISTINCT(DITemplateTypeParameter,
- Record[0],
(Context, getMDString(Record[1]),
getMDOrNull(Record[2]))),
NextMetadataNo++);
if (Record.size() != 5)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DITemplateValueParameter, Record[0],
+ GET_OR_DISTINCT(DITemplateValueParameter,
(Context, Record[1], getMDString(Record[2]),
getMDOrNull(Record[3]), getMDOrNull(Record[4]))),
NextMetadataNo++);
if (Record.size() != 11)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIGlobalVariable, Record[0],
+ GET_OR_DISTINCT(DIGlobalVariable,
(Context, getMDOrNull(Record[1]),
getMDString(Record[2]), getMDString(Record[3]),
getMDOrNull(Record[4]), Record[5],
// 2nd field used to be an artificial tag, either DW_TAG_auto_variable or
// DW_TAG_arg_variable.
+ IsDistinct = Record[0];
bool HasTag = Record.size() > 8;
MetadataList.assignValue(
- GET_OR_DISTINCT(DILocalVariable, Record[0],
+ GET_OR_DISTINCT(DILocalVariable,
(Context, getMDOrNull(Record[1 + HasTag]),
getMDString(Record[2 + HasTag]),
getMDOrNull(Record[3 + HasTag]), Record[4 + HasTag],
if (Record.size() < 1)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIExpression, Record[0],
+ GET_OR_DISTINCT(DIExpression,
(Context, makeArrayRef(Record).slice(1))),
NextMetadataNo++);
break;
if (Record.size() != 8)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIObjCProperty, Record[0],
+ GET_OR_DISTINCT(DIObjCProperty,
(Context, getMDString(Record[1]),
getMDOrNull(Record[2]), Record[3],
getMDString(Record[4]), getMDString(Record[5]),
if (Record.size() != 6)
return error("Invalid record");
+ IsDistinct = Record[0];
MetadataList.assignValue(
- GET_OR_DISTINCT(DIImportedEntity, Record[0],
+ GET_OR_DISTINCT(DIImportedEntity,
(Context, Record[1], getMDOrNull(Record[2]),
getMDOrNull(Record[3]), Record[4],
getMDString(Record[5]))),