[clang] [Clang][counted_by] Add support for 'counted_by' on struct pointers (PR #137250)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 24 14:25:40 PDT 2025


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 HEAD~1 HEAD --extensions cpp,h,c -- clang/test/CodeGen/attr-counted-by-for-pointers.c clang/lib/CodeGen/CGBuiltin.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CodeGenFunction.h
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 683fc488c..04c9e9e4f 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -1088,7 +1088,8 @@ static llvm::Value *EmitPositiveResultOrZero(CodeGenFunction &CGF,
     Cmp = CGF.Builder.CreateAnd(CGF.Builder.CreateIsNotNeg(Index), Cmp);
 
   //  return cmp ? result : 0
-  return CGF.Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned));
+  return CGF.Builder.CreateSelect(Cmp, Res,
+                                  ConstantInt::get(ResType, 0, IsSigned));
 }
 
 static std::pair<llvm::Value *, llvm::Value *>

``````````

</details>


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


More information about the cfe-commits mailing list