[llvm] cbd3969 - [PPCInstPrinter] Delete an unneeded overload of printBranchOperand. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 22:45:46 PDT 2020


Author: Fangrui Song
Date: 2020-04-01T22:45:25-07:00
New Revision: cbd3969e8cd13aba23e843ab72b8807d68804f71

URL: https://github.com/llvm/llvm-project/commit/cbd3969e8cd13aba23e843ab72b8807d68804f71
DIFF: https://github.com/llvm/llvm-project/commit/cbd3969e8cd13aba23e843ab72b8807d68804f71.diff

LOG: [PPCInstPrinter] Delete an unneeded overload of printBranchOperand. NFC

It was added by D76591 for migration purposes (not all
printBranchOperand users have migrated to the overload with `uint64_t Address`).
Now that all have been migrated, the parameter can go away.

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp
    llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp
index 743bbd9167fb..60558a67c52b 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp
@@ -414,12 +414,11 @@ void PPCInstPrinter::printU16ImmOperand(const MCInst *MI, unsigned OpNo,
 }
 
 void PPCInstPrinter::printBranchOperand(const MCInst *MI, uint64_t Address,
-                                        unsigned OpNo, raw_ostream &O,
-                                        bool RelativeForm) {
+                                        unsigned OpNo, raw_ostream &O) {
   if (!MI->getOperand(OpNo).isImm())
     return printOperand(MI, OpNo, O);
   int32_t Imm = SignExtend32<32>((unsigned)MI->getOperand(OpNo).getImm() << 2);
-  if (PrintBranchImmAsAddress && !RelativeForm) {
+  if (PrintBranchImmAsAddress) {
     uint64_t Target = Address + Imm;
     if (!TT.isPPC64())
       Target &= 0xffffffff;

diff  --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.h b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.h
index 95fbb5a69d47..9763aeceef94 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.h
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.h
@@ -65,10 +65,7 @@ class PPCInstPrinter : public MCInstPrinter {
   void printU16ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
   void printImmZeroOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
   void printBranchOperand(const MCInst *MI, uint64_t Address, unsigned OpNo,
-                          raw_ostream &O, bool RelativeForm = false);
-  void printBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
-    printBranchOperand(MI, 0, OpNo, O, true);
-  }
+                          raw_ostream &O);
   void printAbsBranchOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
   void printTLSCall(const MCInst *MI, unsigned OpNo, raw_ostream &O);
 


        


More information about the llvm-commits mailing list