aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/ConstantRange.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-06-22 21:13:46 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-06-22 21:13:46 +0000
commit5dc6b794b15f5b21cd84601ad924fdb9530e97c9 (patch)
tree824aa9d79e3b0518d15081d71dc628f9ce75cc6b /llvm/lib/Support/ConstantRange.cpp
parent6cffdd2fd35e284f4dc90b732dddb89119fb27b4 (diff)
downloadllvm-5dc6b794b15f5b21cd84601ad924fdb9530e97c9.zip
llvm-5dc6b794b15f5b21cd84601ad924fdb9530e97c9.tar.gz
llvm-5dc6b794b15f5b21cd84601ad924fdb9530e97c9.tar.bz2
Fix the implementation of ConstantRange::sub(ConstantRange). Patch by Xi Wang!
llvm-svn: 133648
Diffstat (limited to 'llvm/lib/Support/ConstantRange.cpp')
-rw-r--r--llvm/lib/Support/ConstantRange.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp
index 493f708..81382d0 100644
--- a/llvm/lib/Support/ConstantRange.cpp
+++ b/llvm/lib/Support/ConstantRange.cpp
@@ -529,8 +529,8 @@ ConstantRange::sub(const ConstantRange &Other) const {
return ConstantRange(getBitWidth(), /*isFullSet=*/true);
APInt Spread_X = getSetSize(), Spread_Y = Other.getSetSize();
- APInt NewLower = getLower() - Other.getLower();
- APInt NewUpper = getUpper() - Other.getUpper() + 1;
+ APInt NewLower = getLower() - Other.getUpper() + 1;
+ APInt NewUpper = getUpper() - Other.getLower();
if (NewLower == NewUpper)
return ConstantRange(getBitWidth(), /*isFullSet=*/true);