mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
nir/algebraic: Fail to compile of a variable is used in a replace but not the search
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
026b5cc792
commit
81f77e4f3a
1 changed files with 7 additions and 0 deletions
|
|
@ -34,13 +34,18 @@ class VarSet(object):
|
|||
def __init__(self):
|
||||
self.names = {}
|
||||
self.ids = itertools.count()
|
||||
self.immutable = False;
|
||||
|
||||
def __getitem__(self, name):
|
||||
if name not in self.names:
|
||||
assert not self.immutable, "Unknown replacement variable: " + name
|
||||
self.names[name] = self.ids.next()
|
||||
|
||||
return self.names[name]
|
||||
|
||||
def lock(self):
|
||||
self.immutable = True
|
||||
|
||||
class Value(object):
|
||||
@staticmethod
|
||||
def create(val, name_base, varset):
|
||||
|
|
@ -138,6 +143,8 @@ class SearchAndReplace(object):
|
|||
else:
|
||||
self.search = Expression(search, "search{0}".format(self.id), varset)
|
||||
|
||||
varset.lock()
|
||||
|
||||
if isinstance(replace, Value):
|
||||
self.replace = replace
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue