Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/AsmParser/LLParser.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 4,706 Lines • ▼ Show 20 Lines | #define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \ | ||||
OPTIONAL(elements, MDField, ); \ | OPTIONAL(elements, MDField, ); \ | ||||
OPTIONAL(runtimeLang, DwarfLangField, ); \ | OPTIONAL(runtimeLang, DwarfLangField, ); \ | ||||
OPTIONAL(vtableHolder, MDField, ); \ | OPTIONAL(vtableHolder, MDField, ); \ | ||||
OPTIONAL(templateParams, MDField, ); \ | OPTIONAL(templateParams, MDField, ); \ | ||||
OPTIONAL(identifier, MDStringField, ); \ | OPTIONAL(identifier, MDStringField, ); \ | ||||
OPTIONAL(discriminator, MDField, ); \ | OPTIONAL(discriminator, MDField, ); \ | ||||
OPTIONAL(dataLocation, MDField, ); \ | OPTIONAL(dataLocation, MDField, ); \ | ||||
OPTIONAL(associated, MDField, ); \ | OPTIONAL(associated, MDField, ); \ | ||||
OPTIONAL(allocated, MDField, ); | OPTIONAL(allocated, MDField, ); \ | ||||
OPTIONAL(rank, MDSignedOrMDField, ); | |||||
PARSE_MD_FIELDS(); | PARSE_MD_FIELDS(); | ||||
#undef VISIT_MD_FIELDS | #undef VISIT_MD_FIELDS | ||||
Metadata *Rank = nullptr; | |||||
if (rank.isMDSignedField()) | |||||
Rank = ConstantAsMetadata::get(ConstantInt::getSigned( | |||||
Type::getInt64Ty(Context), rank.getMDSignedValue())); | |||||
else if (rank.isMDField()) | |||||
Rank = rank.getMDFieldValue(); | |||||
// If this has an identifier try to build an ODR type. | // If this has an identifier try to build an ODR type. | ||||
if (identifier.Val) | if (identifier.Val) | ||||
if (auto *CT = DICompositeType::buildODRType( | if (auto *CT = DICompositeType::buildODRType( | ||||
Context, *identifier.Val, tag.Val, name.Val, file.Val, line.Val, | Context, *identifier.Val, tag.Val, name.Val, file.Val, line.Val, | ||||
scope.Val, baseType.Val, size.Val, align.Val, offset.Val, flags.Val, | scope.Val, baseType.Val, size.Val, align.Val, offset.Val, flags.Val, | ||||
elements.Val, runtimeLang.Val, vtableHolder.Val, templateParams.Val, | elements.Val, runtimeLang.Val, vtableHolder.Val, templateParams.Val, | ||||
discriminator.Val, dataLocation.Val, associated.Val, | discriminator.Val, dataLocation.Val, associated.Val, allocated.Val, | ||||
allocated.Val)) { | Rank)) { | ||||
Result = CT; | Result = CT; | ||||
return false; | return false; | ||||
} | } | ||||
// Create a new node, and save it in the context if it belongs in the type | // Create a new node, and save it in the context if it belongs in the type | ||||
// map. | // map. | ||||
Result = GET_OR_DISTINCT( | Result = GET_OR_DISTINCT( | ||||
DICompositeType, | DICompositeType, | ||||
(Context, tag.Val, name.Val, file.Val, line.Val, scope.Val, baseType.Val, | (Context, tag.Val, name.Val, file.Val, line.Val, scope.Val, baseType.Val, | ||||
size.Val, align.Val, offset.Val, flags.Val, elements.Val, | size.Val, align.Val, offset.Val, flags.Val, elements.Val, | ||||
runtimeLang.Val, vtableHolder.Val, templateParams.Val, identifier.Val, | runtimeLang.Val, vtableHolder.Val, templateParams.Val, identifier.Val, | ||||
discriminator.Val, dataLocation.Val, associated.Val, allocated.Val)); | discriminator.Val, dataLocation.Val, associated.Val, allocated.Val, | ||||
Rank)); | |||||
return false; | return false; | ||||
} | } | ||||
bool LLParser::ParseDISubroutineType(MDNode *&Result, bool IsDistinct) { | bool LLParser::ParseDISubroutineType(MDNode *&Result, bool IsDistinct) { | ||||
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \ | #define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \ | ||||
OPTIONAL(flags, DIFlagField, ); \ | OPTIONAL(flags, DIFlagField, ); \ | ||||
OPTIONAL(cc, DwarfCCField, ); \ | OPTIONAL(cc, DwarfCCField, ); \ | ||||
REQUIRED(types, MDField, ); | REQUIRED(types, MDField, ); | ||||
▲ Show 20 Lines • Show All 4,540 Lines • Show Last 20 Lines |