[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 4 09:10:06 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff ecd65e64e885b0fd2786ca99ea0c42d692275d91 fc22a5a9f2f9678393c563de87d8326112e5e0c9 --extensions cpp -- clang/lib/CodeGen/CGHLSLRuntime.cpp clang/lib/CodeGen/CodeGenFunction.cpp clang/lib/CodeGen/CodeGenModule.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index c2d084f9ab..e62b127c0d 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2475,7 +2475,8 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
// explicitly marked as alwaysinline for semantic reasons, and inlining is
// disabled, mark the function as noinline.
// HLSL functions must be always inlined
- if (!F->hasFnAttribute(llvm::Attribute::AlwaysInline) && !getLangOpts().HLSL &&
+ if (!F->hasFnAttribute(llvm::Attribute::AlwaysInline) &&
+ !getLangOpts().HLSL &&
CodeGenOpts.getInlining() == CodeGenOptions::OnlyAlwaysInlining)
B.addAttribute(llvm::Attribute::NoInline);
``````````
</details>
https://github.com/llvm/llvm-project/pull/106588
More information about the cfe-commits
mailing list