[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 04:17:59 PST 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 32bc029be6265838833623fdd88cc665d5658dc7 0711638af02e7680d35ac7647e96e5778e921320 --extensions h,cpp,c -- clang/test/CodeGen/builtin-assume-dereferenceable.c clang/test/SemaCXX/builtin-assume-dereferenceable.cpp clang/lib/CodeGen/CGBuiltin.cpp llvm/include/llvm/IR/IRBuilder.h llvm/lib/IR/IRBuilder.cpp
``````````

</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 7ed3795e90..cb59d191c0 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -3728,7 +3728,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
   }
   case Builtin::BI__builtin_assume_dereferenceable: {
     const Expr *Ptr = E->getArg(0);
-    const Expr *Size= E->getArg(1);
+    const Expr *Size = E->getArg(1);
     Value *PtrValue = EmitScalarExpr(Ptr);
     Value *SizeValue = EmitScalarExpr(Size);
     if (SizeValue->getType() != IntPtrTy)

``````````

</details>


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


More information about the llvm-commits mailing list