aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/CodeGen/MachineFunctionCloner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/CodeGen/MachineFunctionCloner.cpp')
-rw-r--r--backend/lib/CodeGen/MachineFunctionCloner.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/MachineFunctionCloner.cpp b/backend/lib/CodeGen/MachineFunctionCloner.cpp
index e12e33e..dcf9712 100644
--- a/backend/lib/CodeGen/MachineFunctionCloner.cpp
+++ b/backend/lib/CodeGen/MachineFunctionCloner.cpp
@@ -386,6 +386,12 @@ cloneMemOperand(const MachineMemOperand &SourceOperand, CloneState &State) {
if (SourceInstruction->sourceLocation()) {
NewInstruction->setSourceLocation(*SourceInstruction->sourceLocation());
}
+ if (SourceInstruction->debugLocation()) {
+ auto DebugLocationResult =
+ NewInstruction->setDebugLocation(*SourceInstruction->debugLocation());
+ if (!DebugLocationResult)
+ return std::unexpected(DebugLocationResult.error());
+ }
if (SourceInstruction->origin())
NewInstruction->setOrigin(*SourceInstruction->origin());
if (SourceInstruction->debugInstrNumber() != 0) {