[llvm] [AArch64] Fix wrong AArch64Subtarget construction. (PR #172942)

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 19 15:06:58 PST 2025


================
@@ -749,10 +749,9 @@ void AArch64AsmPrinter::emitHwasanMemaccessSymbols(Module &M) {
 
   const Triple &TT = TM.getTargetTriple();
   assert(TT.isOSBinFormatELF());
-  std::unique_ptr<MCSubtargetInfo> STI(
-      TM.getTarget().createMCSubtargetInfo(TT, "", ""));
-  assert(STI && "Unable to create subtarget info");
-  this->STI = static_cast<const AArch64Subtarget *>(&*STI);
+  AArch64Subtarget STI(TT, TM.getTargetCPU(), TM.getTargetCPU(),
----------------
pcc wrote:

I see, it looks like these subtarget fields on the TargetMachine are intended to be used for things like module-level inline asm. This sounds fine to me then because that's more or less what we are generating here. I guess we'll end up having to do something else if we ever develop a concept of subtargets for module-level inline asm, but this is okay for now.

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


More information about the llvm-commits mailing list