summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:25:10 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-13 01:25:10 +0000
commitc1f1acc7514fc534f72e55220463cfdedfdd1cb2 (patch)
tree968d6df67474a629a2fbfb74652ece926f6f6fe9 /llvm/lib/AsmParser/LLParser.cpp
parent2a5c0a27b6fe45e2c556ff94987be39220abfc09 (diff)
downloadbcm5719-llvm-c1f1acc7514fc534f72e55220463cfdedfdd1cb2.tar.gz
bcm5719-llvm-c1f1acc7514fc534f72e55220463cfdedfdd1cb2.zip
AsmWriter/Bitcode: MDCompileUnit
llvm-svn: 229013
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 24442ef127b..d7bf205ce00 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -3352,9 +3352,39 @@ bool LLParser::ParseMDFile(MDNode *&Result, bool IsDistinct) {
return false;
}
+/// ParseMDCompileUnit:
+/// ::= !MDCompileUnit(language: DW_LANG_C99, file: !0, producer: "clang",
+/// isOptimized: true, flags: "-O2", runtimeVersion: 1,
+/// splitDebugFilename: "abc.debug", emissionKind: 1,
+/// enums: !1, retainedTypes: !2, subprograms: !3,
+/// globals: !4, imports: !5)
bool LLParser::ParseMDCompileUnit(MDNode *&Result, bool IsDistinct) {
- return TokError("unimplemented parser");
+#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
+ REQUIRED(language, DwarfLangField, ); \
+ REQUIRED(file, MDField, ); \
+ OPTIONAL(producer, MDStringField, ); \
+ OPTIONAL(isOptimized, MDBoolField, ); \
+ OPTIONAL(flags, MDStringField, ); \
+ OPTIONAL(runtimeVersion, MDUnsignedField, (0, UINT32_MAX)); \
+ OPTIONAL(splitDebugFilename, MDStringField, ); \
+ OPTIONAL(emissionKind, MDUnsignedField, (0, UINT32_MAX)); \
+ OPTIONAL(enums, MDField, ); \
+ OPTIONAL(retainedTypes, MDField, ); \
+ OPTIONAL(subprograms, MDField, ); \
+ OPTIONAL(globals, MDField, ); \
+ OPTIONAL(imports, MDField, );
+ PARSE_MD_FIELDS();
+#undef VISIT_MD_FIELDS
+
+ Result = GET_OR_DISTINCT(MDCompileUnit,
+ (Context, language.Val, file.Val, producer.Val,
+ isOptimized.Val, flags.Val, runtimeVersion.Val,
+ splitDebugFilename.Val, emissionKind.Val, enums.Val,
+ retainedTypes.Val, subprograms.Val, globals.Val,
+ imports.Val));
+ return false;
}
+
bool LLParser::ParseMDSubprogram(MDNode *&Result, bool IsDistinct) {
return TokError("unimplemented parser");
}
OpenPOWER on IntegriCloud