[llvm] 446ed63 - [RISCV][NFC] Don't need to create a new STI in RISCVAsmPrinter.
Zakk Chen via llvm-commits
llvm-commits at lists.llvm.org
Sun May 9 18:49:23 PDT 2021
Author: Zakk Chen
Date: 2021-05-10T09:33:23+08:00
New Revision: 446ed6394bd36631508056ffac08bd740d401a00
URL: https://github.com/llvm/llvm-project/commit/446ed6394bd36631508056ffac08bd740d401a00
DIFF: https://github.com/llvm/llvm-project/commit/446ed6394bd36631508056ffac08bd740d401a00.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp b/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
index 1b7a923e23b18..bdf30f8eb1b37 100644
--- a/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
+++ b/llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
@@ -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.
More information about the llvm-commits
mailing list