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:
Jakob Stoklund Olesen
2016-11-08 09:40:19 -08:00
parent 1e1830aaa6
commit f8545574b5
11 changed files with 210 additions and 202 deletions

View File

@@ -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: