[clang] [clang] Add use-sample-profile attribute to thread-local wrapper (PR #245514)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 27 16:13:32 PST 2026


================
@@ -4185,6 +4185,8 @@ MicrosoftCXXABI::getAddrOfCXXCtorClosure(const CXXConstructorDecl *CD,
     ThunkFn->setComdat(CGM.getModule().getOrInsertComdat(ThunkFn->getName()));
   bool IsCopy = CT == Ctor_CopyingClosure;
 
+  CGM.SetLLVMFunctionAttributesForDefinition(CD, ThunkFn);
----------------
XinlongZHANG-Bob wrote:

`setNonAliasAttributes` is private member, I changed to `SetCommonAttributes`.
The manual`setCallingConv` is now redundant and removed. I also moved the`WeakODR` linkage handling into`getAddrOfCXXCtorClosure` and simplified`EmitCXXConstructors` accordingly, so the linkage is finalized before`setNonAliasAttributes` runs and the attributes aren't set twice.

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


More information about the cfe-commits mailing list