summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDaniel Malea <daniel.malea@intel.com>2013-05-08 20:44:14 +0000
committerDaniel Malea <daniel.malea@intel.com>2013-05-08 20:44:14 +0000
commit3c5bed167085d74389b1f27cb6d358c62d4ed599 (patch)
tree280a5c2ac9e457fd1e9f1030450282d79d4a0bce /llvm/lib/IR/DebugInfo.cpp
parentded9f932489936c8342590c2570ff28d93ba42af (diff)
downloadbcm5719-llvm-3c5bed167085d74389b1f27cb6d358c62d4ed599.tar.gz
bcm5719-llvm-3c5bed167085d74389b1f27cb6d358c62d4ed599.zip
Add DebugIR pass -- emits IR file and replace source lines with IR lines in MD
- requires existing debug information to be present - fixes up file name and line number information in metadata - emits a "<orig_filename>-debug.ll" succinct IR file (without !dbg metadata or debug intrinsics) that can be read by a debugger - initialize pass in opt tool to enable the "-debug-ir" flag - lit tests to follow llvm-svn: 181467
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 3be5e0f8496..38fc90f865e 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -695,6 +695,13 @@ DIArray DISubprogram::getVariables() const {
return DIArray();
}
+void DIScope::setFilename(StringRef Name, LLVMContext &Context) {
+ if (!DbgNode)
+ return;
+ MDString *MDName(MDString::get(Context, Name));
+ const_cast<MDNode*>(getNodeField(DbgNode, 1))->replaceOperandWith(0, MDName);
+}
+
StringRef DIScope::getFilename() const {
if (!DbgNode)
return StringRef();
OpenPOWER on IntegriCloud