[PATCH] D123934: MachineModuleInfo: Remove UsesMorestackAddr

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 12:45:04 PDT 2022


rnk added inline comments.


================
Comment at: llvm/lib/Target/X86/X86AsmPrinter.cpp:832
+  // Emit __morestack address if needed for indirect calls.
+  if (TT.getArch() == Triple::x86_64 && TM.getCodeModel() == CodeModel::Large) {
+    if (MCSymbol *AddrSymbol = OutContext.lookupSymbol("__morestack_addr")) {
----------------
arsenm wrote:
> rnk wrote:
> > I suggest `getSubtarget().is64Bit()` instead of `TT.getArch() == ...x86_64`, it's marginally more explicit. My first (silly) thought was "why are we checking if we're targetting x86, we are already in the x86 backend... oh right, we don't do this for 32-bit".
> This is in module level code. There's not supposed to be a subtarget
Got it, sounds fine then. I only got as far as confirming that `X86AsmPrinter::getSubtarget` exists. I never liked the `TT.is64BitArch()` predicates, those always seemed silly.


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

https://reviews.llvm.org/D123934



More information about the llvm-commits mailing list