[clang] [CodeGen] Set target features in StartFunction() (PR #207691)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 18:19:02 PDT 2026


================
@@ -1124,6 +1124,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
         getLLVMContext(), VScaleRange->first, VScaleRange->second));
   }
 
+  llvm::AttrBuilder Attrs(getLLVMContext());
+  CGM.GetCPUAndFeaturesAttributes(GD, Attrs);
+  Fn->addFnAttrs(Attrs);
----------------
efriedma-quic wrote:

The right thing to do is to call SetInternalFunctionAttributes() from generateAwaitSuspendWrapper().

The helpers for setting attributes for declarations/definitions could use some refactoring, but it's hard to enforce consistency here.

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


More information about the cfe-commits mailing list