[llvm] [C API] Add function to create constantRange attributes to C API (PR #90505)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 21:34:54 PDT 2024


================
@@ -178,6 +179,18 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A) {
   return wrap(Attr.getValueAsType());
 }
 
+LLVMAttributeRef LLVMCreateConstantRangeAttribute(
+    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned LowerNumWords,
+    const uint64_t LowerWords[], unsigned UpperNumWords,
+    const uint64_t UpperWords[]) {
----------------
nikic wrote:

Another option we have would be to say that LowerWords and UpperWords must be `ceil_div(NumBits, 64)` long and not pass separate LowerNumWords and UpperNumWords arguments. Any thoughts on that?

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


More information about the llvm-commits mailing list