Author: Nikita Popov Date: 2025-03-20T15:04:03+01:00 New Revision: e6a87da8fe314a009eed769f9737b4b281a06fba
URL: https://github.com/llvm/llvm-project/commit/e6a87da8fe314a009eed769f9737b4b281a06fba DIFF: https://github.com/llvm/llvm-project/commit/e6a87da8fe314a009eed769f9737b4b281a06fba.diff LOG: [CodeGen] Don't explicitly set intrinsic attributes (NFCI) The intrinsic attributes are automatically set when the function is created, there is no need to assign them explicitly. Added: Modified: clang/lib/CodeGen/CodeGenModule.cpp Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e26c6c3da3091..257b7b40fd19e 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2936,9 +2936,8 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F, bool IsThunk) { if (llvm::Intrinsic::ID IID = F->getIntrinsicID()) { - // If this is an intrinsic function, set the function's attributes - // to the intrinsic's attributes. - F->setAttributes(llvm::Intrinsic::getAttributes(getLLVMContext(), IID)); + // If this is an intrinsic function, the attributes will have been set + // when the function was created. return; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits