[Mlir-commits] [mlir] 5125803 - [mlir] Silence error: call to constructor of 'llvm::APInt' is ambiguous

Alexandre Ganea llvmlistbot at llvm.org
Fri Feb 21 07:06:13 PST 2020


Author: Alexandre Ganea
Date: 2020-02-21T10:06:04-05:00
New Revision: 5125803d344b848cdfc9441edfcc36dc8e488407

URL: https://github.com/llvm/llvm-project/commit/5125803d344b848cdfc9441edfcc36dc8e488407
DIFF: https://github.com/llvm/llvm-project/commit/5125803d344b848cdfc9441edfcc36dc8e488407.diff

LOG: [mlir] Silence error: call to constructor of 'llvm::APInt' is ambiguous

I was getting this error when using Clang 9.0.1 for compiling.

F:\llvm-project\mlir\lib\IR\Builders.cpp(119,27): error: call to constructor of 'llvm::APInt' is ambiguous
                          APInt(32, value, /*isSigned=*/false));
                          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
F:\llvm-project\llvm\include\llvm/ADT/APInt.h(277,3): note: candidate constructor
  APInt(unsigned numBits, uint64_t val, bool isSigned = false)
  ^
F:\llvm-project\llvm\include\llvm/ADT/APInt.h(304,3): note: candidate constructor
  APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
  ^
1 error generated.

Added: 
    

Modified: 
    mlir/lib/IR/Builders.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/Builders.cpp b/mlir/lib/IR/Builders.cpp
index b208710ac247..c578dcfd1032 100644
--- a/mlir/lib/IR/Builders.cpp
+++ b/mlir/lib/IR/Builders.cpp
@@ -116,7 +116,7 @@ IntegerAttr Builder::getSI32IntegerAttr(int32_t value) {
 
 IntegerAttr Builder::getUI32IntegerAttr(uint32_t value) {
   return IntegerAttr::get(getIntegerType(32, /*isSigned=*/false),
-                          APInt(32, value, /*isSigned=*/false));
+                          APInt(32, (uint64_t)value, /*isSigned=*/false));
 }
 
 IntegerAttr Builder::getI16IntegerAttr(int16_t value) {


        


More information about the Mlir-commits mailing list