aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR
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
commit13ace6664fad8b4d0277d16690674f4e1f176642 (patch)
tree07e183914fcea6659f8e2d4fa527d109a2e703cb /lib/IR
parentd0fef32e5f3700c7de6dfc50a1a3815659b7d19e (diff)
downloadexternal_llvm-13ace6664fad8b4d0277d16690674f4e1f176642.zip
external_llvm-13ace6664fad8b4d0277d16690674f4e1f176642.tar.gz
external_llvm-13ace6664fad8b4d0277d16690674f4e1f176642.tar.bz2
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/DebugInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index 3be5e0f..38fc90f 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/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();