[llvm] [llvm-c] Add C API methods to match size_t ConstantDataArray C++ API signatures (PR #84433)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 21:41:16 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 9dab2e3064a2ad4d5ce65832d605787dc394cb72 6a05fd079050bacd10a0e6978ce499f5fa0a9ad2 -- llvm/bindings/ocaml/llvm/llvm_ocaml.c llvm/include/llvm-c/Core.h llvm/lib/IR/Core.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index 6ac0b77b4f..b21ce1679f 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -2165,8 +2165,8 @@ double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
/**
* Create a ConstantDataSequential and initialize it with a string.
*
- * @deprecated LLVMConstStringInContext is deprecated in favor of the API accurate
- * LLVMConstStringInContext2
+ * @deprecated LLVMConstStringInContext is deprecated in favor of the API
+ * accurate LLVMConstStringInContext2
* @see llvm::ConstantDataArray::getString()
*/
LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
@@ -2178,7 +2178,8 @@ LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
* @see llvm::ConstantDataArray::getString()
*/
LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str,
- size_t Length, LLVMBool DontNullTerminate);
+ size_t Length,
+ LLVMBool DontNullTerminate);
/**
* Create a ConstantDataSequential with string content in the global context.
@@ -2206,7 +2207,6 @@ LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
LLVMValueRef LLVMConstString2(const char *Str, unsigned Length,
LLVMBool DontNullTerminate);
-
/**
* Returns true if the specified constant is an array of i8.
*
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index bb9d404790..e15941745d 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -1531,7 +1531,6 @@ LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, const char *Str,
DontNullTerminate == 0));
}
-
LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
LLVMBool DontNullTerminate) {
return LLVMConstStringInContext(LLVMGetGlobalContext(), Str, Length,
``````````
</details>
https://github.com/llvm/llvm-project/pull/84433
More information about the llvm-commits
mailing list