Skip to content

Commit e180119

Browse files
committed
Fix build
1 parent 15bf5af commit e180119

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ void NVPTXInstPrinter::printRegName(raw_ostream &OS, MCRegister Reg) {
7676
void NVPTXInstPrinter::printInst(const MCInst *MI, uint64_t Address,
7777
StringRef Annot, const MCSubtargetInfo &STI,
7878
raw_ostream &OS) {
79+
this->STI = &STI;
7980
printInstruction(MI, Address, OS);
8081

8182
// Next always print the annotation.
@@ -397,12 +398,11 @@ void NVPTXInstPrinter::printMemOperand(const MCInst *MI, int OpNum,
397398
}
398399

399400
void NVPTXInstPrinter::printUsedBytesMaskPragma(const MCInst *MI, int OpNum,
400-
raw_ostream &O,
401-
const MCSubtargetInfo &STI) {
401+
raw_ostream &O) {
402402
auto &Op = MI->getOperand(OpNum);
403403
assert(Op.isImm() && "Invalid operand");
404404
uint32_t Imm = (uint32_t)Op.getImm();
405-
if (static_cast<const NVPTXSubtarget &>(STI).hasUsedBytesMaskPragma() &&
405+
if (static_cast<const NVPTXSubtarget &>(*STI).hasUsedBytesMaskPragma() &&
406406
Imm != UINT32_MAX)
407407
O << ".pragma \"used_bytes_mask " << format_hex(Imm, 1) << "\";\n\t";
408408
}

llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXInstPrinter.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ namespace llvm {
2020
class MCSubtargetInfo;
2121

2222
class NVPTXInstPrinter : public MCInstPrinter {
23+
const MCSubtargetInfo *STI = nullptr;
24+
2325
public:
2426
NVPTXInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
2527
const MCRegisterInfo &MRI);
@@ -46,8 +48,7 @@ class NVPTXInstPrinter : public MCInstPrinter {
4648
StringRef Modifier = {});
4749
void printMemOperand(const MCInst *MI, int OpNum, raw_ostream &O,
4850
StringRef Modifier = {});
49-
void printUsedBytesMaskPragma(const MCInst *MI, int OpNum, raw_ostream &O,
50-
const MCSubtargetInfo &STI);
51+
void printUsedBytesMaskPragma(const MCInst *MI, int OpNum, raw_ostream &O);
5152
void printRegisterOrSinkSymbol(const MCInst *MI, int OpNum, raw_ostream &O);
5253
void printHexu32imm(const MCInst *MI, int OpNum, raw_ostream &O);
5354
void printProtoIdent(const MCInst *MI, int OpNum, raw_ostream &O);

0 commit comments

Comments
 (0)