OSDN Git Service

[llvm-objdump] - Move variable. NFC.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 23 Jan 2019 10:52:38 +0000 (10:52 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 23 Jan 2019 10:52:38 +0000 (10:52 +0000)
It was too far from the place where it is used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351942 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objdump/llvm-objdump.cpp

index fe873c0..7d9f616 100644 (file)
@@ -890,9 +890,6 @@ static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj,
                               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 Target *TheTarget, const ObjectFile *Obj,
         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 Target *TheTarget, const ObjectFile *Obj,
                    << Val << "\n";
             ++RelCur;
           }
+        }
       }
     }
   }