Skip to content

Commit 2f66fcc

Browse files
[Z80] Remove option for zero offset printing
1 parent 805bc4f commit 2f66fcc

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

llvm/lib/Target/Z80/MCTargetDesc/Z80InstPrinterCommon.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ using namespace llvm;
2525

2626
#define DEBUG_TYPE "asm-printer"
2727

28-
static cl::opt<bool> PrintZeroOffset(
29-
"z80-print-zero-offset",
30-
cl::desc("Print ix + 0 instead of ix"),
31-
cl::init(false),
32-
cl::Hidden);
3328
static cl::opt<bool> AddNegativeOffset(
3429
"z80-add-negative-offset",
3530
cl::desc("Print ix + -1 instead of ix - 1"),
@@ -39,18 +34,9 @@ static cl::opt<bool> AddNegativeOffset(
3934
Z80InstPrinterCommon::Z80InstPrinterCommon(const MCAsmInfo &MAI,
4035
const MCInstrInfo &MII,
4136
const MCRegisterInfo &MRI)
42-
: MCInstPrinter(MAI, MII, MRI), PrintZeroOffset(::PrintZeroOffset),
43-
AddNegativeOffset(::AddNegativeOffset) {}
37+
: MCInstPrinter(MAI, MII, MRI), AddNegativeOffset(::AddNegativeOffset) {}
4438

4539
bool Z80InstPrinterCommon::applyTargetSpecificCLOption(StringRef Opt) {
46-
if (Opt == "print-zero-offset") {
47-
PrintZeroOffset = true;
48-
return true;
49-
}
50-
if (Opt == "no-print-zero-offset") {
51-
PrintZeroOffset = false;
52-
return true;
53-
}
5440
if (Opt == "add-negative-offset") {
5541
AddNegativeOffset = true;
5642
return true;
@@ -137,8 +123,7 @@ void Z80InstPrinterCommon::printOffset(const MCInst *MI, unsigned Op,
137123
printOperand(MI, Op, OS);
138124
auto Offset = MI->getOperand(Op + 1).getImm();
139125
assert(isInt<8>(Offset) && "Offset out of range!");
140-
if (Offset || PrintZeroOffset)
141-
OS << ' ' << (Offset >= 0 || AddNegativeOffset ? '+' : '-') << ' '
126+
OS << ' ' << (Offset >= 0 || AddNegativeOffset ? '+' : '-') << ' '
142127
<< formatImm(AddNegativeOffset ? Offset : std::abs(Offset));
143128
}
144129

llvm/lib/Target/Z80/MCTargetDesc/Z80InstPrinterCommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Z80InstPrinterCommon : public MCInstPrinter {
4343
void printIndirectOffset(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
4444

4545
private:
46-
bool PrintZeroOffset, AddNegativeOffset;
46+
bool AddNegativeOffset;
4747
};
4848
} // namespace llvm
4949

0 commit comments

Comments
 (0)