[llvm] r233590 - llvm-dis: Use the new `DebugLoc` API, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Mar 30 13:04:06 PDT 2015


Author: dexonsmith
Date: Mon Mar 30 15:04:06 2015
New Revision: 233590

URL: http://llvm.org/viewvc/llvm-project?rev=233590&view=rev
Log:
llvm-dis: Use the new `DebugLoc` API, NFC

Update tools/llvm-dis to use the new `DebugLoc` API.

Modified:
    llvm/trunk/tools/llvm-dis/llvm-dis.cpp

Modified: llvm/trunk/tools/llvm-dis/llvm-dis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dis/llvm-dis.cpp?rev=233590&r1=233589&r2=233590&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dis/llvm-dis.cpp (original)
+++ llvm/trunk/tools/llvm-dis/llvm-dis.cpp Mon Mar 30 15:04:06 2015
@@ -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;





More information about the llvm-commits mailing list