Reference Guide  2.5.0
psyclone.psyir.symbols.datasymbol.DataSymbol Class Reference
Inheritance diagram for psyclone.psyir.symbols.datasymbol.DataSymbol:
Collaboration diagram for psyclone.psyir.symbols.datasymbol.DataSymbol:

Public Member Functions

def __init__ (self, name, datatype, is_constant=False, initial_value=None, **kwargs)
 
def is_constant (self)
 
def is_constant (self, value)
 
def initial_value (self)
 
def initial_value (self, new_value)
 
def __str__ (self)
 
def copy (self)
 
def copy_properties (self, symbol_in)
 
- Public Member Functions inherited from psyclone.psyir.symbols.typed_symbol.TypedSymbol
def __init__ (self, name, datatype, **kwargs)
 
def datatype (self)
 
def datatype (self, value)
 
def resolve_type (self)
 
def is_scalar (self)
 
def is_array (self)
 
def shape (self)
 
- Public Member Functions inherited from psyclone.psyir.symbols.symbol.Symbol
def __init__ (self, name, visibility=DEFAULT_VISIBILITY, interface=None)
 
def specialise (self, subclass, **kwargs)
 
def get_external_symbol (self)
 
def name (self)
 
def visibility (self)
 
def visibility (self, value)
 
def interface (self)
 
def interface (self, value)
 
def is_automatic (self)
 
def is_modulevar (self)
 
def is_import (self)
 
def is_argument (self)
 
def is_commonblock (self)
 
def is_static (self)
 
def is_unresolved (self)
 
def is_unknown_interface (self)
 
def find_symbol_table (self, node)
 
def is_array_access (self, index_variable=None, access_info=None)
 

Public Attributes

 initial_value
 
 is_constant
 
 interface
 
- Public Attributes inherited from psyclone.psyir.symbols.typed_symbol.TypedSymbol
 datatype
 
 interface
 
- Public Attributes inherited from psyclone.psyir.symbols.symbol.Symbol
 interface
 
 visibility
 

Additional Inherited Members

- Static Public Attributes inherited from psyclone.psyir.symbols.symbol.Symbol
 DEFAULT_VISIBILITY = Visibility.PUBLIC
 

Detailed Description

Symbol identifying a data element. It contains information about:
the datatype, the shape (in column-major order) and the interface
to that symbol (i.e. Local, Global, Argument).

:param str name: name of the symbol.
:param datatype: data type of the symbol.
:type datatype: :py:class:`psyclone.psyir.symbols.DataType`
:param bool is_constant: whether this DataSymbol is a compile-time
    constant (default is False). If True then an `initial_value` must
    also be provided.
:param initial_value: sets a fixed known expression as an initial
    value for this DataSymbol. If `is_constant` is True then this
    Symbol will always have this value. If the value is None then this
    symbol does not have an initial value (and cannot be a constant).
    Otherwise it can receive PSyIR expressions or Python intrinsic types
    available in the TYPE_MAP_TO_PYTHON map. By default it is None.
:type initial_value: Optional[item of TYPE_MAP_TO_PYTHON |
    :py:class:`psyclone.psyir.nodes.Node`]
:param kwargs: additional keyword arguments provided by
               :py:class:`psyclone.psyir.symbols.TypedSymbol`
:type kwargs: unwrapped dict.

Definition at line 45 of file datasymbol.py.

Member Function Documentation

◆ __str__()

def psyclone.psyir.symbols.datasymbol.DataSymbol.__str__ (   self)
 Abstract method. Must be overridden in sub-class. 

Reimplemented from psyclone.psyir.symbols.typed_symbol.TypedSymbol.

Definition at line 287 of file datasymbol.py.

287  def __str__(self):
288  ret = self.name + ": DataSymbol<" + str(self.datatype)
289  ret += ", " + str(self._interface)
290  if self.initial_value is not None:
291  ret += f", initial_value={self.initial_value}"
292  if self.is_constant:
293  ret += ", constant=True"
294  return ret + ">"
295 

References psyclone.psyir.symbols.symbol.Symbol._interface, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value, psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.GridArg.name, psyclone.domain.gocean.transformations.gocean_const_loop_bounds_trans.GOConstLoopBoundsTrans.name(), psyclone.domain.gocean.transformations.gocean_move_iteration_boundaries_inside_kernel_trans.GOMoveIterationBoundariesInsideKernelTrans.name(), psyclone.domain.gocean.transformations.gocean_opencl_trans.GOOpenCLTrans.name(), psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata.name, psyclone.domain.nemo.transformations.create_nemo_invoke_schedule_trans.CreateNemoInvokeScheduleTrans.name(), psyclone.domain.nemo.transformations.create_nemo_psy_trans.CreateNemoPSyTrans.name(), psyclone.domain.nemo.transformations.nemo_allarrayrange2loop_trans.NemoAllArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_arrayrange2loop_trans.NemoArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_outerarrayrange2loop_trans.NemoOuterArrayRange2LoopTrans.name(), psyclone.dynamo0p3.DynamoPSy.name(), psyclone.expression.FunctionVar.name, psyclone.expression.NamedArg.name(), psyclone.gocean1p0.GOKernelGridArgument.name(), psyclone.gocean1p0.GOStencil.name(), psyclone.parse.algorithm.FileInfo.name(), psyclone.parse.algorithm.InvokeCall.name(), psyclone.parse.kernel.KernelProcedure.name(), psyclone.parse.kernel.KernelType.name(), psyclone.parse.module_info.ModuleInfo.name(), psyclone.psyad.transformations.assignment_trans.AssignmentTrans.name(), psyclone.psyGen.PSy.name(), psyclone.psyGen.Invoke.name(), psyclone.psyGen.Kern.name(), psyclone.psyGen.CodedKern.name, psyclone.psyGen.Argument.name(), psyclone.psyGen.Transformation.name(), psyclone.psyGen.DummyTransformation.name(), psyclone.psyir.nodes.container.Container.name, psyclone.psyir.nodes.member.Member.name, psyclone.psyir.nodes.reference.Reference.name(), psyclone.psyir.nodes.routine.Routine.name, psyclone.psyir.symbols.symbol.Symbol.name(), psyclone.psyir.transformations.allarrayaccess2loop_trans.AllArrayAccess2LoopTrans.name(), psyclone.psyir.transformations.arrayrange2loop_trans.ArrayRange2LoopTrans.name(), psyclone.psyir.transformations.fold_conditional_return_expressions_trans.FoldConditionalReturnExpressionsTrans.name(), psyclone.psyir.transformations.loop_trans.LoopTrans.name(), psyclone.psyir.transformations.omp_task_trans.OMPTaskTrans.name(), psyclone.psyir.transformations.psy_data_trans.PSyDataTrans.name(), psyclone.transformations.OMPSingleTrans.name(), psyclone.transformations.OMPMasterTrans.name(), psyclone.transformations.OMPParallelTrans.name(), psyclone.transformations.MoveTrans.name(), psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.name(), psyclone.transformations.Dynamo0p3KernelConstTrans.name(), psyclone.transformations.ACCEnterDataTrans.name(), psyclone.transformations.ACCRoutineTrans.name(), psyclone.transformations.ACCKernelsTrans.name(), psyclone.transformations.ACCDataTrans.name(), and psyclone.transformations.KernelImportsToArguments.name().

Here is the call graph for this function:

◆ copy()

def psyclone.psyir.symbols.datasymbol.DataSymbol.copy (   self)
Create and return a copy of this object. Any references to the
original will not be affected so the copy will not be referred
to by any other object.

:returns: An object with the same properties as this symbol object.
:rtype: :py:class:`psyclone.psyir.symbols.DataSymbol`

Reimplemented from psyclone.psyir.symbols.typed_symbol.TypedSymbol.

Definition at line 296 of file datasymbol.py.

296  def copy(self):
297  '''Create and return a copy of this object. Any references to the
298  original will not be affected so the copy will not be referred
299  to by any other object.
300 
301  :returns: An object with the same properties as this symbol object.
302  :rtype: :py:class:`psyclone.psyir.symbols.DataSymbol`
303 
304  '''
305  if self.initial_value is not None:
306  new_init_value = self.initial_value.copy()
307  else:
308  new_init_value = None
309  return DataSymbol(self.name, self.datatype, visibility=self.visibility,
310  interface=self.interface,
311  is_constant=self.is_constant,
312  initial_value=new_init_value)
313 

References psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value, psyclone.psyir.symbols.datasymbol.DataSymbol.interface, psyclone.psyir.symbols.symbol.Symbol.interface, psyclone.psyir.symbols.typed_symbol.TypedSymbol.interface, psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.GridArg.name, psyclone.domain.gocean.transformations.gocean_const_loop_bounds_trans.GOConstLoopBoundsTrans.name(), psyclone.domain.gocean.transformations.gocean_move_iteration_boundaries_inside_kernel_trans.GOMoveIterationBoundariesInsideKernelTrans.name(), psyclone.domain.gocean.transformations.gocean_opencl_trans.GOOpenCLTrans.name(), psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata.name, psyclone.domain.nemo.transformations.create_nemo_invoke_schedule_trans.CreateNemoInvokeScheduleTrans.name(), psyclone.domain.nemo.transformations.create_nemo_psy_trans.CreateNemoPSyTrans.name(), psyclone.domain.nemo.transformations.nemo_allarrayrange2loop_trans.NemoAllArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_arrayrange2loop_trans.NemoArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_outerarrayrange2loop_trans.NemoOuterArrayRange2LoopTrans.name(), psyclone.dynamo0p3.DynamoPSy.name(), psyclone.expression.FunctionVar.name, psyclone.expression.NamedArg.name(), psyclone.gocean1p0.GOKernelGridArgument.name(), psyclone.gocean1p0.GOStencil.name(), psyclone.parse.algorithm.FileInfo.name(), psyclone.parse.algorithm.InvokeCall.name(), psyclone.parse.kernel.KernelProcedure.name(), psyclone.parse.kernel.KernelType.name(), psyclone.parse.module_info.ModuleInfo.name(), psyclone.psyad.transformations.assignment_trans.AssignmentTrans.name(), psyclone.psyGen.PSy.name(), psyclone.psyGen.Invoke.name(), psyclone.psyGen.Kern.name(), psyclone.psyGen.CodedKern.name, psyclone.psyGen.Argument.name(), psyclone.psyGen.Transformation.name(), psyclone.psyGen.DummyTransformation.name(), psyclone.psyir.nodes.container.Container.name, psyclone.psyir.nodes.member.Member.name, psyclone.psyir.nodes.reference.Reference.name(), psyclone.psyir.nodes.routine.Routine.name, psyclone.psyir.symbols.symbol.Symbol.name(), psyclone.psyir.transformations.allarrayaccess2loop_trans.AllArrayAccess2LoopTrans.name(), psyclone.psyir.transformations.arrayrange2loop_trans.ArrayRange2LoopTrans.name(), psyclone.psyir.transformations.fold_conditional_return_expressions_trans.FoldConditionalReturnExpressionsTrans.name(), psyclone.psyir.transformations.loop_trans.LoopTrans.name(), psyclone.psyir.transformations.omp_task_trans.OMPTaskTrans.name(), psyclone.psyir.transformations.psy_data_trans.PSyDataTrans.name(), psyclone.transformations.OMPSingleTrans.name(), psyclone.transformations.OMPMasterTrans.name(), psyclone.transformations.OMPParallelTrans.name(), psyclone.transformations.MoveTrans.name(), psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.name(), psyclone.transformations.Dynamo0p3KernelConstTrans.name(), psyclone.transformations.ACCEnterDataTrans.name(), psyclone.transformations.ACCRoutineTrans.name(), psyclone.transformations.ACCKernelsTrans.name(), psyclone.transformations.ACCDataTrans.name(), psyclone.transformations.KernelImportsToArguments.name(), and psyclone.psyir.symbols.symbol.Symbol.visibility.

Here is the call graph for this function:

◆ copy_properties()

def psyclone.psyir.symbols.datasymbol.DataSymbol.copy_properties (   self,
  symbol_in 
)
Replace all properties in this object with the properties from
symbol_in, apart from the name (which is immutable) and visibility.

:param symbol_in: the symbol from which the properties are copied.
:type symbol_in: :py:class:`psyclone.psyir.symbols.DataSymbol`

:raises TypeError: if the argument is not the expected type.

Reimplemented from psyclone.psyir.symbols.typed_symbol.TypedSymbol.

Definition at line 314 of file datasymbol.py.

314  def copy_properties(self, symbol_in):
315  '''Replace all properties in this object with the properties from
316  symbol_in, apart from the name (which is immutable) and visibility.
317 
318  :param symbol_in: the symbol from which the properties are copied.
319  :type symbol_in: :py:class:`psyclone.psyir.symbols.DataSymbol`
320 
321  :raises TypeError: if the argument is not the expected type.
322 
323  '''
324  if not isinstance(symbol_in, DataSymbol):
325  raise TypeError(f"Argument should be of type 'DataSymbol' but "
326  f"found '{type(symbol_in).__name__}'.")
327  super().copy_properties(symbol_in)
328  self._is_constant = symbol_in.is_constant
329  self._initial_value = symbol_in.initial_value

References psyclone.psyir.symbols.datasymbol.DataSymbol._initial_value, and psyclone.psyir.symbols.datasymbol.DataSymbol._is_constant.

Here is the caller graph for this function:

◆ initial_value() [1/2]

def psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value (   self)
:returns: the initial value associated with this symbol (if any).
:rtype: :py:class:`psyclone.psyir.nodes.Node`

Definition at line 184 of file datasymbol.py.

184  def initial_value(self):
185  '''
186  :returns: the initial value associated with this symbol (if any).
187  :rtype: :py:class:`psyclone.psyir.nodes.Node`
188 
189  '''
190  return self._initial_value
191 

References psyclone.psyir.symbols.datasymbol.DataSymbol._initial_value.

Here is the caller graph for this function:

◆ initial_value() [2/2]

def psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value (   self,
  new_value 
)
:param new_value: set or change the initial value associated
    with this DataSymbol. If the value is None then this symbol does
    not have an initial value (and cannot be a constant). Otherwise it
    can receive PSyIR expressions or Python intrinsic types available
    in the TYPE_MAP_TO_PYTHON map.
:type new_value: Optional[item of TYPE_MAP_TO_PYTHON |
    :py:class:`psyclone.psyir.nodes.Node`]

:raises ValueError: if a non-None value is provided and 1) this
    DataSymbol instance represents an argument, or 2) this
    DataSymbol instance is not a scalar (as the shape attribute is
    not empty), or 3) an initial value is provided but the type of
    the value is not supported, or 4) the type of the value
    provided is not compatible with the datatype of this DataSymbol
    instance, or 5) the provided PSyIR expression is unsupported.
:raises ValueError: if a None value is provided and this DataSymbol
    represents a constant and is not imported.

Definition at line 193 of file datasymbol.py.

193  def initial_value(self, new_value):
194  '''
195  :param new_value: set or change the initial value associated
196  with this DataSymbol. If the value is None then this symbol does
197  not have an initial value (and cannot be a constant). Otherwise it
198  can receive PSyIR expressions or Python intrinsic types available
199  in the TYPE_MAP_TO_PYTHON map.
200  :type new_value: Optional[item of TYPE_MAP_TO_PYTHON |
201  :py:class:`psyclone.psyir.nodes.Node`]
202 
203  :raises ValueError: if a non-None value is provided and 1) this
204  DataSymbol instance represents an argument, or 2) this
205  DataSymbol instance is not a scalar (as the shape attribute is
206  not empty), or 3) an initial value is provided but the type of
207  the value is not supported, or 4) the type of the value
208  provided is not compatible with the datatype of this DataSymbol
209  instance, or 5) the provided PSyIR expression is unsupported.
210  :raises ValueError: if a None value is provided and this DataSymbol
211  represents a constant and is not imported.
212 
213  '''
214  # pylint: disable=import-outside-toplevel
215  from psyclone.psyir.nodes import (Node, Literal, Operation, Reference,
216  CodeBlock, IntrinsicCall)
217  from psyclone.psyir.symbols.datatypes import (ScalarType, ArrayType,
218  UnsupportedType)
219 
220  if new_value is not None:
221  if self.is_argument:
222  raise ValueError(
223  f"Error setting initial value for symbol '{self.name}'. "
224  f"A DataSymbol with an ArgumentInterface can not have an "
225  f"initial value.")
226  if not isinstance(self.datatype,
227  (ScalarType, ArrayType, UnsupportedType)):
228  raise ValueError(
229  f"Error setting initial value for symbol '{self.name}'. "
230  f"A DataSymbol with an initial value must be a scalar or "
231  f"an array or of UnsupportedType but found "
232  f"'{type(self.datatype).__name__}'.")
233 
234  if isinstance(new_value, Node):
235  for node in new_value.walk(Node):
236  if not isinstance(node, (Literal, Operation, Reference,
237  CodeBlock, IntrinsicCall)):
238  raise ValueError(
239  f"Error setting initial value for symbol "
240  f"'{self.name}'. PSyIR static expressions can only"
241  f" contain PSyIR Literal, Operation, Reference,"
242  f" IntrinsicCall or CodeBlock nodes but found: "
243  f"{node}")
244  new_initial_value = new_value
245  else:
246  from psyclone.psyir.symbols.datatypes import TYPE_MAP_TO_PYTHON
247  # No need to check that self.datatype has an intrinsic
248  # attribute as we know it is a ScalarType or ArrayType
249  # due to an earlier test.
250  lookup = TYPE_MAP_TO_PYTHON[self.datatype.intrinsic]
251  if not isinstance(new_value, lookup):
252  raise ValueError(
253  f"Error setting initial value for symbol "
254  f"'{self.name}'. This DataSymbol instance datatype is "
255  f"'{self.datatype}' meaning the initial value should "
256  f"be '{lookup}' but found '{type(new_value)}'.")
257  if self.datatype.intrinsic == ScalarType.Intrinsic.BOOLEAN:
258  # In this case we know new_value is a Python boolean as it
259  # has passed the isinstance(new_value, lookup) check.
260  if new_value:
261  new_initial_value = Literal('true', self.datatype)
262  else:
263  new_initial_value = Literal('false', self.datatype)
264  else:
265  # Otherwise we convert the Python intrinsic to a PSyIR
266  # Literal using its string representation.
267  new_initial_value = Literal(str(new_value), self.datatype)
268 
269  # Add it to a properly formed Assignment parent, this implicitly
270  # guarantees that the node is not attached anywhere else (and is
271  # unexpectedly modified) and also makes it similar to any other RHS
272  # expression, enabling some functionality without special cases.
273  # Note that the parent dangles on top of the init value, and is not
274  # referenced directly from anywhere else.
275  from psyclone.psyir.nodes import Assignment
276  parent = Assignment()
277  parent.addchild(Reference(self))
278  parent.addchild(new_initial_value)
279  self._initial_value = new_initial_value
280  else:
281  if self.is_constant and not self.is_import:
282  raise ValueError(
283  f"DataSymbol '{self.name}' is a constant and not imported "
284  f"and therefore must have an initial value but got None")
285  self._initial_value = None
286 

References psyclone.psyir.symbols.datasymbol.DataSymbol._initial_value, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.symbol.Symbol.is_argument(), psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant, and psyclone.psyir.symbols.symbol.Symbol.is_import().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_constant() [1/2]

def psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant (   self)
:returns: Whether the symbol is a compile-time constant (True) or
    not (False).
:rtype: bool

Definition at line 152 of file datasymbol.py.

152  def is_constant(self):
153  '''
154  :returns: Whether the symbol is a compile-time constant (True) or
155  not (False).
156  :rtype: bool
157  '''
158  return self._is_constant
159 

References psyclone.psyir.symbols.datasymbol.DataSymbol._is_constant.

Here is the caller graph for this function:

◆ is_constant() [2/2]

def psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant (   self,
  value 
)
:param bool value: whether or not this symbol is a compile-time
    constant.

:raises ValueError: if `value` is True but this symbol does not have an
    initial value or an import or unresolved interface.

Definition at line 161 of file datasymbol.py.

161  def is_constant(self, value):
162  '''
163  :param bool value: whether or not this symbol is a compile-time
164  constant.
165 
166  :raises ValueError: if `value` is True but this symbol does not have an
167  initial value or an import or unresolved interface.
168 
169  '''
170  if (value and not (self.is_import or self.is_unresolved) and
171  self.initial_value is None):
172  # A Symbol of UnsupportedType could have initialisation within its
173  # original declaration.
174  # pylint: disable=import-outside-toplevel
175  from psyclone.psyir.symbols.datatypes import UnsupportedType
176  if not isinstance(self.datatype, UnsupportedType):
177  raise ValueError(
178  f"DataSymbol '{self.name}' cannot be a constant because it"
179  f" does not have an initial value or an import or "
180  f"unresolved interface.")
181  self._is_constant = value
182 

References psyclone.psyir.symbols.datasymbol.DataSymbol._is_constant, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value, psyclone.psyir.symbols.symbol.Symbol.is_import(), and psyclone.psyir.symbols.symbol.Symbol.is_unresolved().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: