[llvm] r351942 - [llvm-objdump] - Move variable. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 23 02:52:39 PST 2019


Author: grimar
Date: Wed Jan 23 02:52:38 2019
New Revision: 351942

URL: http://llvm.org/viewvc/llvm-project?rev=351942&view=rev
Log:
[llvm-objdump] - Move variable. NFC.

It was too far from the place where it is used.

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

Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=351942&r1=351941&r2=351942&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Wed Jan 23 02:52:38 2019
@@ -890,9 +890,6 @@ static void disassembleObject(const Targ
                               const MCInstrAnalysis *MIA, MCInstPrinter *IP,
                               const MCSubtargetInfo *STI, PrettyPrinter &PIP,
                               SourcePrinter &SP, bool InlineRelocs) {
-  StringRef Fmt = Obj->getBytesInAddress() > 4 ? "\t\t%016" PRIx64 ":  "
-                                               : "\t\t\t%08" PRIx64 ":  ";
-
   std::map<SectionRef, std::vector<RelocationRef>> RelocMap;
   if (InlineRelocs)
     RelocMap = getRelocsMap(*Obj);
@@ -1338,7 +1335,10 @@ static void disassembleObject(const Targ
         outs() << "\n";
 
         // Hexagon does this in pretty printer
-        if (Obj->getArch() != Triple::hexagon)
+        if (Obj->getArch() != Triple::hexagon) {
+          StringRef Fmt = Obj->getBytesInAddress() > 4 ? "\t\t%016" PRIx64 ":  "
+                                                       : "\t\t\t%08" PRIx64
+                                                         ":  ";
           // Print relocation for instruction.
           while (RelCur != RelEnd) {
             uint64_t Addr = RelCur->getOffset();
@@ -1360,6 +1360,7 @@ static void disassembleObject(const Targ
                    << Val << "\n";
             ++RelCur;
           }
+        }
       }
     }
   }




More information about the llvm-commits mailing list