Add a debug info code generation level to the compile unit metadata
and update everything accordingly. This can be used to conditionalize
the amount of output in the backend based on the amount of debug
requested/metadata emission scheme by a front end (e.g. clang).
Paired with a commit to clang.
llvm-svn: 202332
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index fc80ba9..4bb75bd 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -97,7 +97,9 @@
StringRef Directory,
StringRef Producer, bool isOptimized,
StringRef Flags, unsigned RunTimeVer,
- StringRef SplitName) {
+ StringRef SplitName,
+ DebugEmissionKind Kind) {
+
assert(((Lang <= dwarf::DW_LANG_Python && Lang >= dwarf::DW_LANG_C89) ||
(Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) &&
"Invalid Language tag");
@@ -127,7 +129,8 @@
TempSubprograms,
TempGVs,
TempImportedModules,
- MDString::get(VMContext, SplitName)
+ MDString::get(VMContext, SplitName),
+ ConstantInt::get(Type::getInt32Ty(VMContext), Kind)
};
MDNode *CUNode = MDNode::get(VMContext, Elts);