summaryrefslogtreecommitdiff
path: root/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-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 3be5e0f849..38fc90f865 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();