aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LowerSwitch.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-27 17:41:39 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-27 18:07:24 +0200
commit9b959b59dfaf87ba978480594d2cfcf15fe66218 (patch)
tree73a55dc47e7a2c3600ba74068939db752652573c /llvm/lib/Transforms/Utils/LowerSwitch.cpp
parentc8abf1c12dc39f3b07b887808da4bb09d5ddbe3e (diff)
downloadllvm-9b959b59dfaf87ba978480594d2cfcf15fe66218.zip
llvm-9b959b59dfaf87ba978480594d2cfcf15fe66218.tar.gz
llvm-9b959b59dfaf87ba978480594d2cfcf15fe66218.tar.bz2
[LVI] Require context instruction in external API (NFCI)
Require CxtI in getConstant() and getConstantRange() APIs. Accordingly drop the BB parameter, as it is implied by CxtI->getParent(). This makes sure we don't forget to pass the context instruction, and makes the API contract clearer (also clean up the comments to that effect -- the value holds at the context instruction, not the end of the block).
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerSwitch.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LowerSwitch.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
index 10a4420..a297d6d 100644
--- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
@@ -400,7 +400,7 @@ void ProcessSwitchInst(SwitchInst *SI,
// TODO Shouldn't this create a signed range?
ConstantRange KnownBitsRange =
ConstantRange::fromKnownBits(Known, /*IsSigned=*/false);
- const ConstantRange LVIRange = LVI->getConstantRange(Val, OrigBlock, SI);
+ const ConstantRange LVIRange = LVI->getConstantRange(Val, SI);
ConstantRange ValRange = KnownBitsRange.intersectWith(LVIRange);
// We delegate removal of unreachable non-default cases to other passes. In
// the unlikely event that some of them survived, we just conservatively