[PATCH] D142037: [RISCV] Make it explicit that attributes use the MCSubtargetInfo from TargetMachine.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 10:37:17 PST 2023


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/comment addressed.



================
Comment at: llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp:220
       static_cast<RISCVTargetStreamer &>(*OutStreamer->getTargetStreamer());
-  RTS.emitTargetAttributes(*MCSTI);
+  RTS.emitTargetAttributes(*TM.getMCSubtargetInfo());
 }
----------------
I think this needs a comment.  The fact that we specifically *don't* want some arbitrary functions copy of the sub-target info is surprising, and worth a word or two here.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142037



More information about the llvm-commits mailing list