Move ValueType into a new cdsl top-level module.
We want to separate the Python classes that make up the DSL used to define the Cretonne language from the concrete definitions. - cdsl.types defines the ValueType class hierarchy. - base.types defines the concrete types.
This commit is contained in:
@@ -5,6 +5,7 @@ from __future__ import absolute_import
|
||||
import srcgen
|
||||
import constant_hash
|
||||
from unique_table import UniqueTable, UniqueSeqTable
|
||||
import cdsl.types
|
||||
import cretonne
|
||||
|
||||
|
||||
@@ -310,11 +311,11 @@ def get_constraint(op, ctrl_typevar, type_sets):
|
||||
- `Free(idx)` where `idx` is an index into `type_sets`.
|
||||
- `Same`, `Lane`, `AsBool` for controlling typevar-derived constraints.
|
||||
"""
|
||||
assert op.kind is cretonne.value
|
||||
t = op.typ
|
||||
assert t.operand_kind() is cretonne.value
|
||||
|
||||
# A concrete value type.
|
||||
if isinstance(t, cretonne.ValueType):
|
||||
if isinstance(t, cdsl.types.ValueType):
|
||||
return 'Concrete({})'.format(t.rust_name())
|
||||
|
||||
if t.free_typevar() is not ctrl_typevar:
|
||||
|
||||
Reference in New Issue
Block a user