diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-02-22 16:13:02 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-02-22 16:13:02 +0000 |
commit | 5079f6260f03c791d7125322d1d3247c0e97e79a (patch) | |
tree | 67bab3e58834f925c7e5eb0a27b96fe1d8c42acb /llvm/unittests/IR/ConstantRangeTest.cpp | |
parent | 527a4205505155503de1fb1daecea472ba95358b (diff) | |
download | bcm5719-llvm-5079f6260f03c791d7125322d1d3247c0e97e79a.tar.gz bcm5719-llvm-5079f6260f03c791d7125322d1d3247c0e97e79a.zip |
[ConstantRange] Rename a method and add more doc
Rename makeNoWrapRegion to a more obvious makeGuaranteedNoWrapRegion,
and add a comment about the counter-intuitive aspects of the function.
This is to help prevent cases like PR26628.
llvm-svn: 261532
Diffstat (limited to 'llvm/unittests/IR/ConstantRangeTest.cpp')
-rw-r--r-- | llvm/unittests/IR/ConstantRangeTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/unittests/IR/ConstantRangeTest.cpp b/llvm/unittests/IR/ConstantRangeTest.cpp index 1f32eea3e43..af2f133d38f 100644 --- a/llvm/unittests/IR/ConstantRangeTest.cpp +++ b/llvm/unittests/IR/ConstantRangeTest.cpp @@ -577,17 +577,17 @@ TEST(ConstantRange, MakeOverflowingRegion) { for (int Const : {0, -1, -2, 1, 2, IntMin4Bits, IntMax4Bits}) { APInt C(4, Const, true /* = isSigned */); - auto NUWRegion = - ConstantRange::makeNoWrapRegion(Instruction::Add, C, OBO::NoUnsignedWrap); + auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion( + Instruction::Add, C, OBO::NoUnsignedWrap); EXPECT_FALSE(NUWRegion.isEmptySet()); - auto NSWRegion = - ConstantRange::makeNoWrapRegion(Instruction::Add, C, OBO::NoSignedWrap); + auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( + Instruction::Add, C, OBO::NoSignedWrap); EXPECT_FALSE(NSWRegion.isEmptySet()); - auto NoWrapRegion = ConstantRange::makeNoWrapRegion( + auto NoWrapRegion = ConstantRange::makeGuaranteedNoWrapRegion( Instruction::Add, C, OBO::NoSignedWrap | OBO::NoUnsignedWrap); EXPECT_FALSE(NoWrapRegion.isEmptySet()); |