summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 23aee723205..36f4f3aa876 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -2294,11 +2294,15 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Metadata *MD,
Machine = MachineStorage.get();
}
int Slot = Machine->getMetadataSlot(N);
- if (Slot == -1)
+ if (Slot == -1) {
+ if (const DILocation *Loc = dyn_cast<DILocation>(N)) {
+ writeDILocation(Out, Loc, TypePrinter, Machine, Context);
+ return;
+ }
// Give the pointer value instead of "badref", since this comes up all
// the time when debugging.
Out << "<" << N << ">";
- else
+ } else
Out << '!' << Slot;
return;
}
OpenPOWER on IntegriCloud