[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 26 13:27:38 PST 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 99335a646bc0b10066d77cec08ae8cab0162efde 0afeea9dcc8b02ade26e6ec0652ae1fa6ec33a7c -- clang/test/CodeGen/attr-llvmfn.c clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CodeGenFunction.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index cb960bf7a3..0d6e1cb512 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2466,11 +2466,12 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
     if (TargetDecl->hasAttr<ArmLocallyStreamingAttr>())
       FuncAttrs.addAttribute("aarch64_pstate_sm_body");
 
-    for(auto Attr: TargetDecl->specific_attrs<LLVMFuncAttr>()) {
+    for (auto Attr : TargetDecl->specific_attrs<LLVMFuncAttr>()) {
       auto name = Attr->getLLVMAttrName();
       auto value = Attr->getLLVMAttrValue();
 
-      auto Attr = llvm::Attribute::parseAttr(getLLVMContext(), AttributeAndValue.first, AttributeAndValue.second);
+      auto Attr = llvm::Attribute::parseAttr(
+          getLLVMContext(), AttributeAndValue.first, AttributeAndValue.second);
       FuncAttrs.addAttribute(Attr);
     }
   }
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 1d8031c1a2..86ada81fac 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -832,11 +832,12 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
       SanOpts.Mask &= ~SanitizerKind::Null;
 
   if (D) {
-    for(auto Attr: TargetDecl->specific_attrs<LLVMFuncAttr>()) {
+    for (auto Attr : TargetDecl->specific_attrs<LLVMFuncAttr>()) {
       auto name = Attr->getLLVMAttrName();
       auto value = Attr->getLLVMAttrValue();
 
-      auto Attr = llvm::Attribute::parseAttr(getLLVMContext(), AttributeAndValue.first, AttributeAndValue.second);
+      auto Attr = llvm::Attribute::parseAttr(
+          getLLVMContext(), AttributeAndValue.first, AttributeAndValue.second);
       Fn->addFnAttr(Attr);
     }
   }

``````````

</details>


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


More information about the cfe-commits mailing list