summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index f1c0d8ef2ad..2fdc2bcaa42 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1619,11 +1619,8 @@ void MachineInstr::print(raw_ostream &OS, bool SkipOpers) const {
}
if (isDebugValue() && MO.isMetadata()) {
// Pretty print DBG_VALUE instructions.
- const MDNode *MD = MO.getMetadata();
- DIDescriptor DI(MD);
- DIVariable DIV(MD);
-
- if (DI.isVariable() && !DIV.getName().empty())
+ DIVariable DIV = dyn_cast<MDLocalVariable>(MO.getMetadata());
+ if (DIV && !DIV.getName().empty())
OS << "!\"" << DIV.getName() << '\"';
else
MO.print(OS, TRI);
@@ -1713,7 +1710,7 @@ void MachineInstr::print(raw_ostream &OS, bool SkipOpers) const {
// Print debug location information.
if (isDebugValue() && getOperand(e - 2).isMetadata()) {
if (!HaveSemi) OS << ";";
- DIVariable DV(getOperand(e - 2).getMetadata());
+ DIVariable DV = cast<MDLocalVariable>(getOperand(e - 2).getMetadata());
OS << " line no:" << DV.getLineNumber();
if (auto *InlinedAt = DV.getInlinedAt()) {
DebugLoc InlinedAtDL(InlinedAt);
OpenPOWER on IntegriCloud