[llvm] [MC][AArch64][ARM][X86] Push target-dependent assembler flags into targets (PR #139844)

Jessica Clarke via llvm-commits llvm-commits at lists.llvm.org
Sun May 18 12:08:24 PDT 2025


================
@@ -918,8 +918,11 @@ void X86AsmPrinter::emitStartOfAsmFile(Module &M) {
   // If this is not inline asm and we're in 16-bit
   // mode prefix assembly with .code16.
   bool is16 = TT.getEnvironment() == Triple::CODE16;
-  if (M.getModuleInlineAsm().empty() && is16)
-    OutStreamer->emitAssemblerFlag(MCAF_Code16);
+  if (M.getModuleInlineAsm().empty() && is16) {
+    auto *XTS =
+        static_cast<X86TargetStreamer *>(OutStreamer->getTargetStreamer());
----------------
jrtc27 wrote:

Yeah, these targets probably should. I encourage those who care about these backends to do cleanup work there :) Similarly, it would be nice if ARMELFStreamer didn't have its own IsThumb state to keep in sync with the actual subtarget. But those kinds of cleanups are future work.

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


More information about the llvm-commits mailing list