summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-02-27 01:24:56 +0000
committerEric Christopher <echristo@gmail.com>2014-02-27 01:24:56 +0000
commit75d49db19b009cccb47bbd6e7dbee251bfeb3dad (patch)
tree4da2b28b5c2f8f8984bafdb38641ed97267ca4f9 /llvm/lib
parentd7895aca994e058a9c258c212c87bdc1803992c7 (diff)
downloadbcm5719-llvm-75d49db19b009cccb47bbd6e7dbee251bfeb3dad.tar.gz
bcm5719-llvm-75d49db19b009cccb47bbd6e7dbee251bfeb3dad.zip
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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp7
-rw-r--r--llvm/lib/IR/DebugInfo.cpp2
2 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index fc80ba9e64a..4bb75bdb0df 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -97,7 +97,9 @@ DICompileUnit DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
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 @@ DICompileUnit DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
TempSubprograms,
TempGVs,
TempImportedModules,
- MDString::get(VMContext, SplitName)
+ MDString::get(VMContext, SplitName),
+ ConstantInt::get(Type::getInt32Ty(VMContext), Kind)
};
MDNode *CUNode = MDNode::get(VMContext, Elts);
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 0617f672e61..506f2dd926e 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -382,7 +382,7 @@ bool DICompileUnit::Verify() const {
if (getFilename().empty())
return false;
- return DbgNode->getNumOperands() == 13;
+ return DbgNode->getNumOperands() == 14;
}
/// Verify - Verify that an ObjC property is well formed.
OpenPOWER on IntegriCloud