summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-dis/llvm-dis.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 20:04:06 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 20:04:06 +0000
commitb8afdd604423f852fb1935855d4dd16e03fea987 (patch)
treef87660525114902bf3403bf26a1394a50733b42a /llvm/tools/llvm-dis/llvm-dis.cpp
parent2809cc74931e03f52fe2739b246677b71742b67f (diff)
downloadbcm5719-llvm-b8afdd604423f852fb1935855d4dd16e03fea987.tar.gz
bcm5719-llvm-b8afdd604423f852fb1935855d4dd16e03fea987.zip
llvm-dis: Use the new `DebugLoc` API, NFC
Update tools/llvm-dis to use the new `DebugLoc` API. llvm-svn: 233590
Diffstat (limited to 'llvm/tools/llvm-dis/llvm-dis.cpp')
-rw-r--r--llvm/tools/llvm-dis/llvm-dis.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp
index 1c3a9ced0ff..35a1cbd1506 100644
--- a/llvm/tools/llvm-dis/llvm-dis.cpp
+++ b/llvm/tools/llvm-dis/llvm-dis.cpp
@@ -58,12 +58,9 @@ namespace {
static void printDebugLoc(const DebugLoc &DL, formatted_raw_ostream &OS) {
OS << DL.getLine() << ":" << DL.getCol();
- if (MDNode *N = DL.getInlinedAt(getGlobalContext())) {
- DebugLoc IDL = DebugLoc::getFromDILocation(N);
- if (!IDL.isUnknown()) {
- OS << "@";
- printDebugLoc(IDL,OS);
- }
+ if (MDLocation *IDL = DL.getInlinedAt()) {
+ OS << "@";
+ printDebugLoc(IDL, OS);
}
}
class CommentWriter : public AssemblyAnnotationWriter {
@@ -81,8 +78,7 @@ public:
OS << "; [#uses=" << V.getNumUses() << " type=" << *V.getType() << "]"; // Output # uses and type
}
if (const Instruction *I = dyn_cast<Instruction>(&V)) {
- const DebugLoc &DL = I->getDebugLoc();
- if (!DL.isUnknown()) {
+ if (const DebugLoc &DL = I->getDebugLoc()) {
if (!Padded) {
OS.PadToColumn(50);
Padded = true;
OpenPOWER on IntegriCloud