AsmWriter/Bitcode: MDGlobalVariable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229020 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-02-13 01:35:40 +00:00
parent 8921bbca59
commit fbc547da81
8 changed files with 127 additions and 10 deletions

View File

@@ -3548,9 +3548,33 @@ bool LLParser::ParseMDTemplateValueParameter(MDNode *&Result, bool IsDistinct) {
return false;
}
/// ParseMDGlobalVariable:
/// ::= !MDGlobalVariable(scope: !0, name: "foo", linkageName: "foo",
/// file: !1, line: 7, type: !2, isLocal: false,
/// isDefinition: true, variable: i32* @foo,
/// declaration: !3)
bool LLParser::ParseMDGlobalVariable(MDNode *&Result, bool IsDistinct) {
return TokError("unimplemented parser");
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
OPTIONAL(scope, MDField, ); \
REQUIRED(name, MDStringField, ); \
OPTIONAL(linkageName, MDStringField, ); \
OPTIONAL(file, MDField, ); \
OPTIONAL(line, LineField, ); \
OPTIONAL(type, MDField, ); \
OPTIONAL(isLocal, MDBoolField, ); \
OPTIONAL(isDefinition, MDBoolField, (true)); \
OPTIONAL(variable, MDConstant, ); \
OPTIONAL(declaration, MDField, );
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS
Result = GET_OR_DISTINCT(MDGlobalVariable,
(Context, scope.Val, name.Val, linkageName.Val,
file.Val, line.Val, type.Val, isLocal.Val,
isDefinition.Val, variable.Val, declaration.Val));
return false;
}
bool LLParser::ParseMDLocalVariable(MDNode *&Result, bool IsDistinct) {
return TokError("unimplemented parser");
}