Index: src/IceInstX8632.cpp |
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp |
index 06804f3bb8be7d442f2e06cd9a29415675055b1f..a61805e2d96b53ef73566c28fed2224a20b69de4 100644 |
--- a/src/IceInstX8632.cpp |
+++ b/src/IceInstX8632.cpp |
@@ -1383,9 +1383,12 @@ void OperandX8632Mem::emit(const Cfg *Func) const { |
bool OffsetIsNegative = false; |
if (Offset == NULL) { |
OffsetIsZero = true; |
- } else if (ConstantInteger *CI = llvm::dyn_cast<ConstantInteger>(Offset)) { |
+ } else if (ConstantInteger32 *CI = |
+ llvm::dyn_cast<ConstantInteger32>(Offset)) { |
OffsetIsZero = (CI->getValue() == 0); |
- OffsetIsNegative = (static_cast<int64_t>(CI->getValue()) < 0); |
+ OffsetIsNegative = (static_cast<int32_t>(CI->getValue()) < 0); |
+ } else { |
+ assert(llvm::isa<ConstantRelocatable>(Offset)); |
} |
if (Dumped) { |
if (!OffsetIsZero) { // Suppress if Offset is known to be 0 |
@@ -1430,9 +1433,12 @@ void OperandX8632Mem::dump(const Cfg *Func, Ostream &Str) const { |
bool OffsetIsNegative = false; |
if (Offset == NULL) { |
OffsetIsZero = true; |
- } else if (ConstantInteger *CI = llvm::dyn_cast<ConstantInteger>(Offset)) { |
+ } else if (ConstantInteger32 *CI = |
+ llvm::dyn_cast<ConstantInteger32>(Offset)) { |
OffsetIsZero = (CI->getValue() == 0); |
- OffsetIsNegative = (static_cast<int64_t>(CI->getValue()) < 0); |
+ OffsetIsNegative = (static_cast<int32_t>(CI->getValue()) < 0); |
+ } else { |
+ assert(llvm::isa<ConstantRelocatable>(Offset)); |
} |
if (Dumped) { |
if (!OffsetIsZero) { // Suppress if Offset is known to be 0 |