summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-06 23:27:40 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-06 23:27:40 +0000
commite686f1591fde0d3394dd3be40d06281252f108fa (patch)
tree6f5e3ce7d39e4509af379d4bbe238e79e27ce2d6 /llvm/lib/CodeGen/MachineInstr.cpp
parent6186fb2cd008ea9445ebc1dddced644cdbaeead5 (diff)
downloadbcm5719-llvm-e686f1591fde0d3394dd3be40d06281252f108fa.tar.gz
bcm5719-llvm-e686f1591fde0d3394dd3be40d06281252f108fa.zip
CodeGen: Stop using DIDescriptor::is*() and auto-casting
Same as r234255, but for lib/CodeGen and lib/Target. llvm-svn: 234258
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