[llvm] [RISCV][MC] Implement ISA mapping symbols (PR #67541)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 12:10:38 PST 2024


================
@@ -66,6 +86,69 @@ void RISCVTargetELFStreamer::emitAttribute(unsigned Attribute, unsigned Value) {
 void RISCVTargetELFStreamer::emitTextAttribute(unsigned Attribute,
                                                StringRef String) {
   getStreamer().setAttributeItem(Attribute, String, /*OverwriteExisting=*/true);
+  if (Attribute == RISCVAttrs::ARCH)
+    setArchString(String);
+}
+
+void RISCVTargetELFStreamer::emitDirectiveOptionArch(
+    ArrayRef<RISCVOptionArchArg> Args) {
+  if (Args.size() == 1) {
+    RISCVOptionArchArg Arg = Args[0];
----------------
topperc wrote:

I'm not sure how big `RISCVOptionArchArg` is and how expensive it is to copy. Maybe this should be `const RISCVOptionArchArg &Arg`

https://github.com/llvm/llvm-project/pull/67541


More information about the llvm-commits mailing list