@@ -43,8 +43,8 @@ namespace {
4343 bool runOnMachineFunction (MachineFunction &MF) override ;
4444
4545 void PrintSymbolOperand (const MachineOperand &MO, raw_ostream &O) override ;
46- void printOperand (const MachineInstr *MI, int OpNum,
47- raw_ostream &O, const char * Modifier = nullptr );
46+ void printOperand (const MachineInstr *MI, int OpNum, raw_ostream &O,
47+ bool NoHash = false );
4848 void printSrcMemOperand (const MachineInstr *MI, int OpNum,
4949 raw_ostream &O);
5050 bool PrintAsmOperand (const MachineInstr *MI, unsigned OpNo,
@@ -70,15 +70,15 @@ void MSP430AsmPrinter::PrintSymbolOperand(const MachineOperand &MO,
7070}
7171
7272void MSP430AsmPrinter::printOperand (const MachineInstr *MI, int OpNum,
73- raw_ostream &O, const char *Modifier ) {
73+ raw_ostream &O, bool NoHash ) {
7474 const MachineOperand &MO = MI->getOperand (OpNum);
7575 switch (MO.getType ()) {
7676 default : llvm_unreachable (" Not implemented yet!" );
7777 case MachineOperand::MO_Register:
7878 O << MSP430InstPrinter::getRegisterName (MO.getReg ());
7979 return ;
8080 case MachineOperand::MO_Immediate:
81- if (!Modifier || strcmp (Modifier, " nohash " ) )
81+ if (!NoHash )
8282 O << ' #' ;
8383 O << MO.getImm ();
8484 return ;
@@ -90,7 +90,7 @@ void MSP430AsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
9090 // register base, we should not emit any prefix symbol here, e.g.
9191 // mov.w glb(r1), r2
9292 // Otherwise (!) msp430-as will silently miscompile the output :(
93- if (!Modifier || strcmp (Modifier, " nohash " ) )
93+ if (!NoHash )
9494 O << ' #' ;
9595 PrintSymbolOperand (MO, O);
9696 return ;
@@ -108,7 +108,7 @@ void MSP430AsmPrinter::printSrcMemOperand(const MachineInstr *MI, int OpNum,
108108 // Imm here is in fact global address - print extra modifier.
109109 if (Disp.isImm () && Base.getReg () == MSP430::SR)
110110 O << ' &' ;
111- printOperand (MI, OpNum+ 1 , O, " nohash " );
111+ printOperand (MI, OpNum + 1 , O, /* NoHash= */ true );
112112
113113 // Print register base field
114114 if (Base.getReg () != MSP430::SR && Base.getReg () != MSP430::PC) {
0 commit comments