WIP: Revamp the type system
Compare changes
- Markus Holzer authored
+ 56
− 12
@@ -29,11 +29,13 @@ def typed_symbols(names, dtype, *args):
@@ -29,11 +29,13 @@ def typed_symbols(names, dtype, *args):
@@ -46,6 +48,7 @@ def matrix_symbols(names, dtype, rows, cols):
@@ -46,6 +48,7 @@ def matrix_symbols(names, dtype, rows, cols):
@@ -76,6 +79,9 @@ def assumptions_from_dtype(dtype):
@@ -76,6 +79,9 @@ def assumptions_from_dtype(dtype):
@@ -103,6 +109,8 @@ class address_of(sp.Function):
@@ -103,6 +109,8 @@ class address_of(sp.Function):
@@ -190,22 +198,30 @@ class cast_func(sp.Function):
@@ -190,22 +198,30 @@ class cast_func(sp.Function):
@@ -272,6 +288,8 @@ class TypedSymbol(sp.Symbol):
@@ -272,6 +288,8 @@ class TypedSymbol(sp.Symbol):
@@ -292,6 +310,7 @@ def create_type(specification):
@@ -292,6 +310,7 @@ def create_type(specification):
@@ -338,12 +357,15 @@ def create_composite_type_from_string(specification):
@@ -338,12 +357,15 @@ def create_composite_type_from_string(specification):
@@ -356,7 +378,7 @@ def to_ctypes(data_type):
@@ -356,7 +378,7 @@ def to_ctypes(data_type):
@@ -374,6 +396,7 @@ to_ctypes.map = {
@@ -374,6 +396,7 @@ to_ctypes.map = {
@@ -404,6 +427,7 @@ def ctypes_from_llvm(data_type):
@@ -404,6 +427,7 @@ def ctypes_from_llvm(data_type):
@@ -417,6 +441,7 @@ def to_llvm_type(data_type, nvvm_target=False):
@@ -417,6 +441,7 @@ def to_llvm_type(data_type, nvvm_target=False):
@@ -435,16 +460,19 @@ if ir:
@@ -435,16 +460,19 @@ if ir:
@@ -495,9 +523,9 @@ def collate_types(types,
@@ -495,9 +523,9 @@ def collate_types(types,
@@ -582,6 +610,7 @@ def get_type_of_expression(expr,
@@ -582,6 +610,7 @@ def get_type_of_expression(expr,
@@ -614,6 +643,8 @@ if int(sympy_version[0]) * 100 + int(sympy_version[1]) >= 109:
@@ -614,6 +643,8 @@ if int(sympy_version[0]) * 100 + int(sympy_version[1]) >= 109:
@@ -622,8 +653,15 @@ class Type(sp.Atom):
@@ -622,8 +653,15 @@ class Type(sp.Atom):
@@ -644,9 +682,10 @@ class BasicType(Type):
@@ -644,9 +682,10 @@ class BasicType(Type):
@@ -660,7 +699,7 @@ class BasicType(Type):
@@ -660,7 +699,7 @@ class BasicType(Type):
@@ -672,7 +711,7 @@ class BasicType(Type):
@@ -672,7 +711,7 @@ class BasicType(Type):
@@ -691,7 +730,7 @@ class BasicType(Type):
@@ -691,7 +730,7 @@ class BasicType(Type):
@@ -714,6 +753,7 @@ class BasicType(Type):
@@ -714,6 +753,7 @@ class BasicType(Type):
@@ -760,6 +800,7 @@ class VectorType(Type):
@@ -760,6 +800,7 @@ class VectorType(Type):
@@ -805,6 +846,7 @@ class PointerType(Type):
@@ -805,6 +846,7 @@ class PointerType(Type):
@@ -858,6 +900,8 @@ class StructType:
@@ -858,6 +900,8 @@ class StructType: