1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
From: Siu Kwan Lam <1929845+sklam@users.noreply.github.com>
Origin: https://github.com/numba/numba/pull/8545
Date: Wed, 30 Nov 2022 12:39:17 -0600
Subject: Remove dead code: StaticReraise
---
numba/core/ir.py | 13 -------------
numba/core/lowering.py | 8 --------
numba/core/typeinfer.py | 3 +--
3 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/numba/core/ir.py b/numba/core/ir.py
index dc0c07d..d2b5469 100644
--- a/numba/core/ir.py
+++ b/numba/core/ir.py
@@ -725,19 +725,6 @@ class Raise(Terminator):
return []
-class StaticReraise(Terminator):
- is_exit = True
-
- def __init__(self, loc):
- assert isinstance(loc, Loc)
- self.loc = loc
-
- def __str__(self):
- return "<static> reraise"
-
- def get_targets(self):
- return []
-
class StaticRaise(Terminator):
"""
Raise an exception class and arguments known at compile-time.
diff --git a/numba/core/lowering.py b/numba/core/lowering.py
index 3daec9d..9a47213 100644
--- a/numba/core/lowering.py
+++ b/numba/core/lowering.py
@@ -562,9 +562,6 @@ class Lower(BaseLower):
elif isinstance(inst, ir.StaticTryRaise):
self.lower_static_try_raise(inst)
- elif isinstance(inst, ir.StaticReraise):
- self.lower_static_reraise(inst)
-
else:
if hasattr(self.context, "lower_extensions"):
for _class, func in self.context.lower_extensions.items():
@@ -618,11 +615,6 @@ class Lower(BaseLower):
else:
self.set_exception(inst.exc_class, inst.exc_args, loc=self.loc)
- def lower_static_reraise(self, inst):
- self.call_conv.return_reraise(
- self.builder
- )
-
def lower_assign(self, ty, inst):
value = inst.value
# In nopython mode, closure vars are frozen like globals
diff --git a/numba/core/typeinfer.py b/numba/core/typeinfer.py
index c727286..98295d8 100644
--- a/numba/core/typeinfer.py
+++ b/numba/core/typeinfer.py
@@ -1398,8 +1398,7 @@ https://numba.readthedocs.io/en/stable/user/troubleshoot.html#my-code-has-an-unt
self.typeof_storemap(inst)
elif isinstance(inst, (ir.Jump, ir.Branch, ir.Return, ir.Del)):
pass
- elif isinstance(inst, (ir.StaticRaise, ir.StaticTryRaise,
- ir.StaticReraise)):
+ elif isinstance(inst, (ir.StaticRaise, ir.StaticTryRaise)):
pass
elif isinstance(inst, ir.PopBlock):
pass # It's a marker statement
|