[PATCH] D155155: [RISCV] emit .option directive for functions with target features which differ from module default

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 10:12:50 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp:257
+
+    if ((STI->hasFeature(Feature.Value) && MCSTI.hasFeature(Feature.Value)) ||
+        (!STI->hasFeature(Feature.Value) && !MCSTI.hasFeature(Feature.Value)))
----------------
Please use `STI->hasFeature(Feature.Value) == MCSTI.hasFeature(Feature.Value)` here


================
Comment at: llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp:265
+  }
+  RTS.emitDirectiveOptionArch(NeedEmitStdOptionArgs);
+}
----------------
`NeedEmitStdOptionArgs` can be empty here. `emitDirectiveOptionArch` does not handle an empty list gracefully.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155155/new/

https://reviews.llvm.org/D155155



More information about the llvm-commits mailing list