mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Hook up verbose asm comment printing for SOImm operands in MC printer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114215 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
196b48b708
commit
74d7e6c64e
@ -1524,7 +1524,7 @@ static MCInstPrinter *createARMMCInstPrinter(const Target &T,
|
||||
unsigned SyntaxVariant,
|
||||
const MCAsmInfo &MAI) {
|
||||
if (SyntaxVariant == 0)
|
||||
return new ARMInstPrinter(MAI, false);
|
||||
return new ARMInstPrinter(MAI);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ void ARMInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
|
||||
}
|
||||
}
|
||||
|
||||
static void printSOImm(raw_ostream &O, int64_t V, bool VerboseAsm,
|
||||
static void printSOImm(raw_ostream &O, int64_t V, raw_ostream *CommentStream,
|
||||
const MCAsmInfo *MAI) {
|
||||
// Break it up into two parts that make up a shifter immediate.
|
||||
V = ARM_AM::getSOImmVal(V);
|
||||
@ -174,9 +174,8 @@ static void printSOImm(raw_ostream &O, int64_t V, bool VerboseAsm,
|
||||
if (Rot) {
|
||||
O << "#" << Imm << ", " << Rot;
|
||||
// Pretty printed version.
|
||||
if (VerboseAsm)
|
||||
O << ' ' << MAI->getCommentString()
|
||||
<< ' ' << (int)ARM_AM::rotr32(Imm, Rot);
|
||||
if (CommentStream)
|
||||
*CommentStream << (int)ARM_AM::rotr32(Imm, Rot) << "\n";
|
||||
} else {
|
||||
O << "#" << Imm;
|
||||
}
|
||||
@ -189,7 +188,7 @@ void ARMInstPrinter::printSOImmOperand(const MCInst *MI, unsigned OpNum,
|
||||
raw_ostream &O) {
|
||||
const MCOperand &MO = MI->getOperand(OpNum);
|
||||
assert(MO.isImm() && "Not a valid so_imm value!");
|
||||
printSOImm(O, MO.getImm(), VerboseAsm, &MAI);
|
||||
printSOImm(O, MO.getImm(), CommentStream, &MAI);
|
||||
}
|
||||
|
||||
/// printSOImm2PartOperand - SOImm is broken into two pieces using a 'mov'
|
||||
|
@ -22,8 +22,7 @@ namespace llvm {
|
||||
class ARMInstPrinter : public MCInstPrinter {
|
||||
bool VerboseAsm;
|
||||
public:
|
||||
ARMInstPrinter(const MCAsmInfo &MAI, bool verboseAsm)
|
||||
: MCInstPrinter(MAI), VerboseAsm(verboseAsm) {}
|
||||
ARMInstPrinter(const MCAsmInfo &MAI) : MCInstPrinter(MAI) {}
|
||||
|
||||
virtual void printInst(const MCInst *MI, raw_ostream &O);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user