@@ -176,10 +176,10 @@ class LocalObject(AbstractObject, LocalType):
176176 """
177177
178178 __rargs__ = ('name',)
179- __rkwargs__ = ('cargs', 'initvalue', 'liveness', 'is_global ')
179+ __rkwargs__ = ('cargs', 'initvalue', 'liveness', 'scope ')
180180
181181 def __init__(self, name, cargs=None, initvalue=None, liveness='lazy',
182- is_global=False , **kwargs):
182+ scope='stack' , **kwargs):
183183 self.name = name
184184 self.cargs = as_tuple(cargs)
185185
@@ -191,16 +191,17 @@ def __init__(self, name, cargs=None, initvalue=None, liveness='lazy',
191191 assert liveness in ['eager', 'lazy']
192192 self._liveness = liveness
193193
194- self._is_global = is_global
194+ assert scope in ['stack', 'shared', 'global']
195+ self._scope = scope
195196
196197 def _hashable_content(self):
197198 return (super()._hashable_content() +
198199 self.cargs +
199- (self.initvalue, self.liveness, self.is_global ))
200+ (self.initvalue, self.liveness, self.scope ))
200201
201202 @property
202- def is_global (self):
203- return self._is_global
203+ def scope (self):
204+ return self._scope
204205
205206 @property
206207 def free_symbols(self):
@@ -236,6 +237,10 @@ def _C_free(self):
236237 """
237238 return None
238239
240+ @property
241+ def _mem_shared(self):
242+ return self._scope == 'shared'
243+
239244 @property
240245 def _mem_global(self):
241- return self._is_global
246+ return self._scope == 'global'
0 commit comments