From: Duncan P. N. Exon Smith Date: Mon, 30 Mar 2015 20:04:06 +0000 (+0000) Subject: llvm-dis: Use the new `DebugLoc` API, NFC X-Git-Tag: android-x86-7.1-r4~49794 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=68338f833e30e64f166ab92890fff45596b5eaa4;p=android-x86%2Fexternal-llvm.git llvm-dis: Use the new `DebugLoc` API, NFC Update tools/llvm-dis to use the new `DebugLoc` API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233590 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp index 1c3a9ced0ff..35a1cbd1506 100644 --- a/tools/llvm-dis/llvm-dis.cpp +++ b/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(&V)) { - const DebugLoc &DL = I->getDebugLoc(); - if (!DL.isUnknown()) { + if (const DebugLoc &DL = I->getDebugLoc()) { if (!Padded) { OS.PadToColumn(50); Padded = true;