[RISCV][NFC] Don't need to create a new STI in RISCVAsmPrinter.

RISCVAsmPrinter already has MCSubtargetInfo.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D101889
This commit is contained in:
Zakk Chen 2021-05-05 15:53:41 +08:00
parent 34b5482b33
commit 446ed6394b
1 changed files with 1 additions and 10 deletions

View File

@ -193,16 +193,7 @@ void RISCVAsmPrinter::emitEndOfAsmFile(Module &M) {
void RISCVAsmPrinter::emitAttributes() {
RISCVTargetStreamer &RTS =
static_cast<RISCVTargetStreamer &>(*OutStreamer->getTargetStreamer());
const Triple &TT = TM.getTargetTriple();
StringRef CPU = TM.getTargetCPU();
StringRef FS = TM.getTargetFeatureString();
const RISCVTargetMachine &RTM = static_cast<const RISCVTargetMachine &>(TM);
/* TuneCPU doesn't impact emission of ELF attributes, ELF attributes only
care about arch related features, so we can set TuneCPU as CPU. */
const RISCVSubtarget STI(TT, CPU, /*TuneCPU=*/CPU, FS, /*ABIName=*/"", RTM);
RTS.emitTargetAttributes(STI);
RTS.emitTargetAttributes(*STI);
}
// Force static initialization.