mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Print "X-42" instead of "X+-42".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be73e8c4e7
commit
d19ceb9b12
@ -51,7 +51,17 @@ void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
|
||||
|
||||
switch (BE.getOpcode()) {
|
||||
default: assert(0 && "Invalid opcode!");
|
||||
case MCBinaryExpr::Add: OS << '+'; break;
|
||||
case MCBinaryExpr::Add:
|
||||
// Print "X-42" instead of "X+-42".
|
||||
if (const MCConstantExpr *RHSC = dyn_cast<MCConstantExpr>(BE.getRHS())) {
|
||||
if (RHSC->getValue() < 0) {
|
||||
OS << RHSC->getValue();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
OS << '+';
|
||||
break;
|
||||
case MCBinaryExpr::And: OS << '&'; break;
|
||||
case MCBinaryExpr::Div: OS << '/'; break;
|
||||
case MCBinaryExpr::EQ: OS << "=="; break;
|
||||
|
Loading…
Reference in New Issue
Block a user