[PATCH] D102926: [RISCV] Fix wrong objfile attribute bug.
Zakk Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 23 18:22:02 PDT 2021
khchen updated this revision to Diff 347282.
khchen added a comment.
Rebase
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102926/new/
https://reviews.llvm.org/D102926
Files:
llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
llvm/test/CodeGen/RISCV/subtarget-features-obj-bug.ll
Index: llvm/test/CodeGen/RISCV/subtarget-features-obj-bug.ll
===================================================================
--- llvm/test/CodeGen/RISCV/subtarget-features-obj-bug.ll
+++ llvm/test/CodeGen/RISCV/subtarget-features-obj-bug.ll
@@ -3,7 +3,7 @@
; RUN: | FileCheck %s -check-prefix=ATTRIBUTE
; ATTRIBUTE: TagName: arch
-; ATTRIBUTE: Value: rv64i2p0
+; ATTRIBUTE: Value: rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0
target triple = "riscv64-unknown-linux-gnu"
Index: llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
+++ llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
@@ -65,11 +65,7 @@
return LowerRISCVMachineOperandToMCOperand(MO, MCOp, *this);
}
- void emitStartOfAsmFile(Module &M) override;
void emitEndOfAsmFile(Module &M) override;
-
-private:
- void emitAttributes();
};
}
@@ -177,23 +173,14 @@
return false;
}
-void RISCVAsmPrinter::emitStartOfAsmFile(Module &M) {
- if (TM.getTargetTriple().isOSBinFormatELF())
- emitAttributes();
-}
-
void RISCVAsmPrinter::emitEndOfAsmFile(Module &M) {
RISCVTargetStreamer &RTS =
static_cast<RISCVTargetStreamer &>(*OutStreamer->getTargetStreamer());
- if (TM.getTargetTriple().isOSBinFormatELF())
+ if (TM.getTargetTriple().isOSBinFormatELF()) {
+ RTS.emitTargetAttributes(*STI);
RTS.finishAttributeSection();
-}
-
-void RISCVAsmPrinter::emitAttributes() {
- RISCVTargetStreamer &RTS =
- static_cast<RISCVTargetStreamer &>(*OutStreamer->getTargetStreamer());
- RTS.emitTargetAttributes(*STI);
+ }
}
// Force static initialization.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102926.347282.patch
Type: text/x-patch
Size: 1657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210524/fc41a8b1/attachment.bin>
More information about the llvm-commits
mailing list