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

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 23:36:11 PDT 2024


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

>From 6916226116d365b3ad92fd5f5567ebced6e05e84 Mon Sep 17 00:00:00 2001
From: Andreas Jonson <andjo403 at hotmail.com>
Date: Mon, 29 Apr 2024 20:15:53 +0200
Subject: [PATCH 1/5] [C API] Add function to create constantRange attributes
 to C API

---
 llvm/docs/ReleaseNotes.rst |  2 ++
 llvm/include/llvm-c/Core.h |  8 ++++++++
 llvm/lib/IR/Core.cpp       | 14 ++++++++++++++
 3 files changed, 24 insertions(+)

diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 46d79d6c5822b1..0c5697e6ec949d 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -161,6 +161,8 @@ Changes to the C API
 * Added ``LLVMAtomicRMWBinOpUIncWrap`` and ``LLVMAtomicRMWBinOpUDecWrap`` to
   ``LLVMAtomicRMWBinOp`` enum for AtomicRMW instructions.
 
+* Added ``LLVMCreateConstantRangeAttribute`` function for creating ConstantRange Attributes.
+
 Changes to the CodeGen infrastructure
 -------------------------------------
 
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index 0b03f3b36fcdd3..3670fa88a734fc 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -673,6 +673,14 @@ LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID,
  */
 LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
 
+/**
+ * Create a constantRange attribute
+ */
+LLVMAttributeRef LLVMCreateConstantRangeAttribute(
+    LLVMContextRef C, unsigned KindID, LLVMTypeRef IntTy,
+    unsigned LowerNumWords, const uint64_t LowerWords[], unsigned UpperNumWords,
+    const uint64_t UpperWords[]);
+
 /**
  * Create a string attribute.
  */
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 6aff94f39d9c0c..b68b304fffb8d4 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -14,6 +14,7 @@
 #include "llvm-c/Core.h"
 #include "llvm/IR/Attributes.h"
 #include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/ConstantRange.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DebugInfoMetadata.h"
 #include "llvm/IR/DerivedTypes.h"
@@ -178,6 +179,19 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A) {
   return wrap(Attr.getValueAsType());
 }
 
+LLVMAttributeRef LLVMCreateConstantRangeAttribute(
+    LLVMContextRef C, unsigned KindID, LLVMTypeRef IntTy,
+    unsigned LowerNumWords, const uint64_t LowerWords[], unsigned UpperNumWords,
+    const uint64_t UpperWords[]) {
+  unsigned BitWidth = unwrap<IntegerType>(IntTy)->getBitWidth();
+  auto &Ctx = *unwrap(C);
+  auto AttrKind = (Attribute::AttrKind)KindID;
+  return wrap(Attribute::get(
+      Ctx, AttrKind,
+      ConstantRange(APInt(BitWidth, ArrayRef(LowerWords, LowerNumWords)),
+                    APInt(BitWidth, ArrayRef(UpperWords, UpperNumWords)))));
+}
+
 LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,
                                            const char *K, unsigned KLength,
                                            const char *V, unsigned VLength) {

>From 8b1d790020284f317c0057ca4c14c3d19650e494 Mon Sep 17 00:00:00 2001
From: Andreas Jonson <andjo403 at hotmail.com>
Date: Tue, 30 Apr 2024 09:02:47 +0200
Subject: [PATCH 2/5] fixup! [C API] Add function to create constantRange
 attributes to C API

---
 llvm/include/llvm-c/Core.h           |  2 +-
 llvm/unittests/IR/AttributesTest.cpp | 34 ++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index 3670fa88a734fc..b9e903992560ef 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -674,7 +674,7 @@ LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID,
 LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
 
 /**
- * Create a constantRange attribute
+ * Create a ConstantRange attribute.
  */
 LLVMAttributeRef LLVMCreateConstantRangeAttribute(
     LLVMContextRef C, unsigned KindID, LLVMTypeRef IntTy,
diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp
index 1accdfd3f6a423..1db6b5c9adc8d0 100644
--- a/llvm/unittests/IR/AttributesTest.cpp
+++ b/llvm/unittests/IR/AttributesTest.cpp
@@ -7,8 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/IR/Attributes.h"
+#include "llvm-c/Core.h"
 #include "llvm/AsmParser/Parser.h"
 #include "llvm/IR/AttributeMask.h"
+#include "llvm/IR/ConstantRange.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/LLVMContext.h"
@@ -308,4 +310,36 @@ TEST(Attributes, RemoveParamAttributes) {
   EXPECT_EQ(AL.getNumAttrSets(), 0U);
 }
 
+TEST(Attributes, ConstantRangeAttributeCAPI) {
+  LLVMContext C;
+  {
+    Type *IntTy = Type::getInt8Ty(C);
+
+    const uint64_t LowerWords[] = {0};
+    const uint64_t UpperWords[] = {42};
+
+    auto Range = ConstantRange(APInt(8, ArrayRef<uint64_t>(LowerWords, 1)),
+                               APInt(8, ArrayRef<uint64_t>(UpperWords, 1)));
+
+    Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
+    auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
+        wrap(&C), Attribute::Range, wrap(IntTy), 1, LowerWords, 1, UpperWords));
+    EXPECT_EQ(OutAttr, RangeAttr);
+  }
+  {
+    Type *IntTy = Type::getInt128Ty(C);
+
+    const uint64_t LowerWords[] = {1, 1};
+    const uint64_t UpperWords[] = {42, 42};
+
+    auto Range = ConstantRange(APInt(128, ArrayRef<uint64_t>(LowerWords, 2)),
+                               APInt(128, ArrayRef<uint64_t>(UpperWords, 2)));
+
+    Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
+    auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
+        wrap(&C), Attribute::Range, wrap(IntTy), 2, LowerWords, 2, UpperWords));
+    EXPECT_EQ(OutAttr, RangeAttr);
+  }
+}
+
 } // end anonymous namespace

>From 665f76ec231a8142ca8cc03a4f05e85efab51e81 Mon Sep 17 00:00:00 2001
From: Andreas Jonson <andjo403 at hotmail.com>
Date: Wed, 1 May 2024 06:07:53 +0200
Subject: [PATCH 3/5] fixup! [C API] Add function to create constantRange
 attributes to C API

---
 llvm/include/llvm-c/Core.h           |  4 ++--
 llvm/lib/IR/Core.cpp                 |  9 ++++-----
 llvm/unittests/IR/AttributesTest.cpp | 20 ++++++++++----------
 3 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index b9e903992560ef..caa83bd5c0b57f 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -677,8 +677,8 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
  * Create a ConstantRange attribute.
  */
 LLVMAttributeRef LLVMCreateConstantRangeAttribute(
-    LLVMContextRef C, unsigned KindID, LLVMTypeRef IntTy,
-    unsigned LowerNumWords, const uint64_t LowerWords[], unsigned UpperNumWords,
+    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned LowerNumWords,
+    const uint64_t LowerWords[], unsigned UpperNumWords,
     const uint64_t UpperWords[]);
 
 /**
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index b68b304fffb8d4..af6b272c4f6186 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -180,16 +180,15 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A) {
 }
 
 LLVMAttributeRef LLVMCreateConstantRangeAttribute(
-    LLVMContextRef C, unsigned KindID, LLVMTypeRef IntTy,
-    unsigned LowerNumWords, const uint64_t LowerWords[], unsigned UpperNumWords,
+    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned LowerNumWords,
+    const uint64_t LowerWords[], unsigned UpperNumWords,
     const uint64_t UpperWords[]) {
-  unsigned BitWidth = unwrap<IntegerType>(IntTy)->getBitWidth();
   auto &Ctx = *unwrap(C);
   auto AttrKind = (Attribute::AttrKind)KindID;
   return wrap(Attribute::get(
       Ctx, AttrKind,
-      ConstantRange(APInt(BitWidth, ArrayRef(LowerWords, LowerNumWords)),
-                    APInt(BitWidth, ArrayRef(UpperWords, UpperNumWords)))));
+      ConstantRange(APInt(NumBits, ArrayRef(LowerWords, LowerNumWords)),
+                    APInt(NumBits, ArrayRef(UpperWords, UpperNumWords)))));
 }
 
 LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,
diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp
index 1db6b5c9adc8d0..b4fb976ad2d736 100644
--- a/llvm/unittests/IR/AttributesTest.cpp
+++ b/llvm/unittests/IR/AttributesTest.cpp
@@ -313,31 +313,31 @@ TEST(Attributes, RemoveParamAttributes) {
 TEST(Attributes, ConstantRangeAttributeCAPI) {
   LLVMContext C;
   {
-    Type *IntTy = Type::getInt8Ty(C);
-
+    const unsigned numBits = 8;
     const uint64_t LowerWords[] = {0};
     const uint64_t UpperWords[] = {42};
 
-    auto Range = ConstantRange(APInt(8, ArrayRef<uint64_t>(LowerWords, 1)),
-                               APInt(8, ArrayRef<uint64_t>(UpperWords, 1)));
+    auto Range =
+        ConstantRange(APInt(numBits, ArrayRef<uint64_t>(LowerWords, 1)),
+                      APInt(numBits, ArrayRef<uint64_t>(UpperWords, 1)));
 
     Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
     auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
-        wrap(&C), Attribute::Range, wrap(IntTy), 1, LowerWords, 1, UpperWords));
+        wrap(&C), Attribute::Range, numBits, 1, LowerWords, 1, UpperWords));
     EXPECT_EQ(OutAttr, RangeAttr);
   }
   {
-    Type *IntTy = Type::getInt128Ty(C);
-
+    const unsigned numBits = 128;
     const uint64_t LowerWords[] = {1, 1};
     const uint64_t UpperWords[] = {42, 42};
 
-    auto Range = ConstantRange(APInt(128, ArrayRef<uint64_t>(LowerWords, 2)),
-                               APInt(128, ArrayRef<uint64_t>(UpperWords, 2)));
+    auto Range =
+        ConstantRange(APInt(numBits, ArrayRef<uint64_t>(LowerWords, 2)),
+                      APInt(numBits, ArrayRef<uint64_t>(UpperWords, 2)));
 
     Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
     auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
-        wrap(&C), Attribute::Range, wrap(IntTy), 2, LowerWords, 2, UpperWords));
+        wrap(&C), Attribute::Range, numBits, 2, LowerWords, 2, UpperWords));
     EXPECT_EQ(OutAttr, RangeAttr);
   }
 }

>From 79411dc5a4cf6d73c6fe28a8059c6d5e7d9028f5 Mon Sep 17 00:00:00 2001
From: Andreas Jonson <andjo403 at hotmail.com>
Date: Wed, 1 May 2024 08:30:21 +0200
Subject: [PATCH 4/5] fixup! [C API] Add function to create constantRange
 attributes to C API

---
 llvm/include/llvm-c/Core.h           |  5 ++---
 llvm/lib/IR/Core.cpp                 |  9 ++++-----
 llvm/unittests/IR/AttributesTest.cpp | 18 ++++++++++--------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index caa83bd5c0b57f..fe9cf5f84e4498 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -677,9 +677,8 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
  * Create a ConstantRange attribute.
  */
 LLVMAttributeRef LLVMCreateConstantRangeAttribute(
-    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned LowerNumWords,
-    const uint64_t LowerWords[], unsigned UpperNumWords,
-    const uint64_t UpperWords[]);
+    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned NumWords,
+    const uint64_t LowerWords[], const uint64_t UpperWords[]);
 
 /**
  * Create a string attribute.
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index af6b272c4f6186..8997bbdcb64ada 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -180,15 +180,14 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A) {
 }
 
 LLVMAttributeRef LLVMCreateConstantRangeAttribute(
-    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned LowerNumWords,
-    const uint64_t LowerWords[], unsigned UpperNumWords,
-    const uint64_t UpperWords[]) {
+    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned NumWords,
+    const uint64_t LowerWords[], const uint64_t UpperWords[]) {
   auto &Ctx = *unwrap(C);
   auto AttrKind = (Attribute::AttrKind)KindID;
   return wrap(Attribute::get(
       Ctx, AttrKind,
-      ConstantRange(APInt(NumBits, ArrayRef(LowerWords, LowerNumWords)),
-                    APInt(NumBits, ArrayRef(UpperWords, UpperNumWords)))));
+      ConstantRange(APInt(NumBits, ArrayRef(LowerWords, NumWords)),
+                    APInt(NumBits, ArrayRef(UpperWords, NumWords)))));
 }
 
 LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,
diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp
index b4fb976ad2d736..e2bd3a61e1d094 100644
--- a/llvm/unittests/IR/AttributesTest.cpp
+++ b/llvm/unittests/IR/AttributesTest.cpp
@@ -313,31 +313,33 @@ TEST(Attributes, RemoveParamAttributes) {
 TEST(Attributes, ConstantRangeAttributeCAPI) {
   LLVMContext C;
   {
-    const unsigned numBits = 8;
+    const unsigned NumBits = 8;
+    const unsigned NumWords = 1;
     const uint64_t LowerWords[] = {0};
     const uint64_t UpperWords[] = {42};
 
     auto Range =
-        ConstantRange(APInt(numBits, ArrayRef<uint64_t>(LowerWords, 1)),
-                      APInt(numBits, ArrayRef<uint64_t>(UpperWords, 1)));
+        ConstantRange(APInt(NumBits, ArrayRef<uint64_t>(LowerWords, NumWords)),
+                      APInt(NumBits, ArrayRef<uint64_t>(UpperWords, NumWords)));
 
     Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
     auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
-        wrap(&C), Attribute::Range, numBits, 1, LowerWords, 1, UpperWords));
+        wrap(&C), Attribute::Range, NumBits, NumWords, LowerWords, UpperWords));
     EXPECT_EQ(OutAttr, RangeAttr);
   }
   {
-    const unsigned numBits = 128;
+    const unsigned NumBits = 128;
+    const unsigned NumWords = 2;
     const uint64_t LowerWords[] = {1, 1};
     const uint64_t UpperWords[] = {42, 42};
 
     auto Range =
-        ConstantRange(APInt(numBits, ArrayRef<uint64_t>(LowerWords, 2)),
-                      APInt(numBits, ArrayRef<uint64_t>(UpperWords, 2)));
+        ConstantRange(APInt(NumBits, ArrayRef<uint64_t>(LowerWords, NumWords)),
+                      APInt(NumBits, ArrayRef<uint64_t>(UpperWords, NumWords)));
 
     Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
     auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
-        wrap(&C), Attribute::Range, numBits, 2, LowerWords, 2, UpperWords));
+        wrap(&C), Attribute::Range, NumBits, NumWords, LowerWords, UpperWords));
     EXPECT_EQ(OutAttr, RangeAttr);
   }
 }

>From bc16255be0ff7568e5f8272fbab8ca7cb98f9533 Mon Sep 17 00:00:00 2001
From: Andreas Jonson <andjo403 at hotmail.com>
Date: Thu, 2 May 2024 08:35:42 +0200
Subject: [PATCH 5/5] fixup! [C API] Add function to create constantRange
 attributes to C API

---
 llvm/include/llvm-c/Core.h           | 11 ++++++++---
 llvm/lib/IR/Core.cpp                 |  9 ++++++---
 llvm/unittests/IR/AttributesTest.cpp | 14 ++++++--------
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index fe9cf5f84e4498..337d399683b054 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -675,10 +675,15 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
 
 /**
  * Create a ConstantRange attribute.
+ *
+ * LowerWords and UpperWords needs to be NumBits devided by 64 runded up
+ * elements long.
  */
-LLVMAttributeRef LLVMCreateConstantRangeAttribute(
-    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned NumWords,
-    const uint64_t LowerWords[], const uint64_t UpperWords[]);
+LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C,
+                                                  unsigned KindID,
+                                                  unsigned NumBits,
+                                                  const uint64_t LowerWords[],
+                                                  const uint64_t UpperWords[]);
 
 /**
  * Create a string attribute.
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index 8997bbdcb64ada..ad291b3965a473 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -179,11 +179,14 @@ LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A) {
   return wrap(Attr.getValueAsType());
 }
 
-LLVMAttributeRef LLVMCreateConstantRangeAttribute(
-    LLVMContextRef C, unsigned KindID, unsigned NumBits, unsigned NumWords,
-    const uint64_t LowerWords[], const uint64_t UpperWords[]) {
+LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C,
+                                                  unsigned KindID,
+                                                  unsigned NumBits,
+                                                  const uint64_t LowerWords[],
+                                                  const uint64_t UpperWords[]) {
   auto &Ctx = *unwrap(C);
   auto AttrKind = (Attribute::AttrKind)KindID;
+  unsigned NumWords = (NumBits + 63) / 64;
   return wrap(Attribute::get(
       Ctx, AttrKind,
       ConstantRange(APInt(NumBits, ArrayRef(LowerWords, NumWords)),
diff --git a/llvm/unittests/IR/AttributesTest.cpp b/llvm/unittests/IR/AttributesTest.cpp
index e2bd3a61e1d094..143468389a7144 100644
--- a/llvm/unittests/IR/AttributesTest.cpp
+++ b/llvm/unittests/IR/AttributesTest.cpp
@@ -314,32 +314,30 @@ TEST(Attributes, ConstantRangeAttributeCAPI) {
   LLVMContext C;
   {
     const unsigned NumBits = 8;
-    const unsigned NumWords = 1;
     const uint64_t LowerWords[] = {0};
     const uint64_t UpperWords[] = {42};
 
     auto Range =
-        ConstantRange(APInt(NumBits, ArrayRef<uint64_t>(LowerWords, NumWords)),
-                      APInt(NumBits, ArrayRef<uint64_t>(UpperWords, NumWords)));
+        ConstantRange(APInt(NumBits, ArrayRef<uint64_t>(LowerWords, 1)),
+                      APInt(NumBits, ArrayRef<uint64_t>(UpperWords, 1)));
 
     Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
     auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
-        wrap(&C), Attribute::Range, NumBits, NumWords, LowerWords, UpperWords));
+        wrap(&C), Attribute::Range, NumBits, LowerWords, UpperWords));
     EXPECT_EQ(OutAttr, RangeAttr);
   }
   {
     const unsigned NumBits = 128;
-    const unsigned NumWords = 2;
     const uint64_t LowerWords[] = {1, 1};
     const uint64_t UpperWords[] = {42, 42};
 
     auto Range =
-        ConstantRange(APInt(NumBits, ArrayRef<uint64_t>(LowerWords, NumWords)),
-                      APInt(NumBits, ArrayRef<uint64_t>(UpperWords, NumWords)));
+        ConstantRange(APInt(NumBits, ArrayRef<uint64_t>(LowerWords, 2)),
+                      APInt(NumBits, ArrayRef<uint64_t>(UpperWords, 2)));
 
     Attribute RangeAttr = Attribute::get(C, Attribute::Range, Range);
     auto OutAttr = unwrap(LLVMCreateConstantRangeAttribute(
-        wrap(&C), Attribute::Range, NumBits, NumWords, LowerWords, UpperWords));
+        wrap(&C), Attribute::Range, NumBits, LowerWords, UpperWords));
     EXPECT_EQ(OutAttr, RangeAttr);
   }
 }



More information about the llvm-commits mailing list