diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -1300,7 +1300,14 @@ SmallVector Bits; public: - void addInteger(unsigned long I) { Bits.push_back(I); } + void addInteger(unsigned long I) { + if (sizeof(long) == sizeof(int)) + addInteger(unsigned(I)); + else if (sizeof(long) == sizeof(long long)) + addInteger((unsigned long long)I); + else + llvm_unreachable("unexpected sizeof(long)"); + } void addInteger(unsigned I) { Bits.push_back(I); } void addInteger(int I) { Bits.push_back(I); }