diff --git a/gen_wrap.py b/gen_wrap.py index 4ea74e69b8cb3d22d8bd94b1d003bc6d2cb40b32..4b55f0a619596f9ee0b82f03921c77b8934e9baf 100644 --- a/gen_wrap.py +++ b/gen_wrap.py @@ -133,7 +133,6 @@ class Method: CLASSES = [ # /!\ Order matters, class names that are prefixes of others should go last. - "options", "ctx", # lists @@ -468,13 +467,8 @@ else: def __exit__(self, type, value, traceback): sys.setcheckinterval(self.previous_check_interval) -""" -CLASS_MAP = { - "equality": "constraint", - "inequality": "constraint", - "options": "ctx", - } +""" SAFE_TYPES = list(ENUMS) + ["int", "unsigned", "uint32_t", "size_t", "double", "long", "unsigned long"] @@ -764,14 +758,9 @@ class FunctionData: for cls in CLASSES: if name.startswith(cls): found_class = True + name = name[len(cls)+1:] break - if found_class: - name = name[len(cls)+1:] - - if name.startswith("2"): - name = "two_"+name[1:] - # Don't be tempted to chop off "_val"--the "_val" versions of # some methods are incompatible with the isl_int ones. # @@ -783,10 +772,16 @@ class FunctionData: # names are carried over to the Python level. if not found_class: - for fake_cls, cls in CLASS_MAP.items(): - if name.startswith(fake_cls): - found_class = True - break + if name.startswith("options_"): + found_class = True + cls = "ctx" + name = name[len("options_"):] + elif name.startswith("equality_") or name.startswith("inequality_"): + found_class = True + cls = "constraint" + + if name.startswith("2"): + name = "two_"+name[1:] assert found_class, name @@ -800,7 +795,7 @@ class FunctionData: name = name + "_" if cls == "options": - assert name.startswith("set_") or name.startswith("get_") + assert name.startswith("set_") or name.startswith("get_"), (name, c_name) name = name[:4]+"option_"+name[4:] words = return_base_type.split() diff --git a/islpy/__init__.py b/islpy/__init__.py index 714c487390e265a7629dd5a62ca13c74dbe6dd04..d11c7089c1b863d8f592a5ffe9df3639e72b0b60 100644 --- a/islpy/__init__.py +++ b/islpy/__init__.py @@ -32,7 +32,6 @@ Error = _isl.Error # {{{ generated by gen_wrap as name_list.py -Options = _isl.Options Context = _isl.Context IdList = _isl.IdList ValList = _isl.ValList @@ -97,28 +96,31 @@ AstNode = _isl.AstNode AstPrintOptions = _isl.AstPrintOptions AstBuild = _isl.AstBuild -format = _isl.format -ast_expr_type = _isl.ast_expr_type +bound = _isl.bound +on_error = _isl.on_error +schedule_algorithm = _isl.schedule_algorithm yaml_style = _isl.yaml_style +ast_op_type = _isl.ast_op_type +format = _isl.format error = _isl.error +ast_expr_type = _isl.ast_expr_type +stat = _isl.stat +ast_node_type = _isl.ast_node_type dim_type = _isl.dim_type ast_loop_type = _isl.ast_loop_type -ast_node_type = _isl.ast_node_type -stat = _isl.stat fold = _isl.fold -ast_op_type = _isl.ast_op_type -ALL_CLASSES = [Options, Context, IdList, ValList, BasicSetList, BasicMapList, - SetList, MapList, UnionSetList, ConstraintList, AffList, PwAffList, - BandList, AstExprList, AstNodeList, IdToAstExpr, Printer, Val, - MultiVal, Vec, Mat, Aff, PwAff, UnionPwAff, MultiAff, MultiPwAff, - PwMultiAff, UnionPwMultiAff, UnionPwAffList, MultiUnionPwAff, Id, - Constraint, Space, LocalSpace, BasicSet, BasicMap, Set, Map, UnionMap, - UnionSet, Point, Vertex, Cell, Vertices, QPolynomialFold, - PwQPolynomialFold, UnionPwQPolynomialFold, UnionPwQPolynomial, - QPolynomial, PwQPolynomial, Term, Band, ScheduleConstraints, - ScheduleNode, Schedule, AccessInfo, Flow, Restriction, UnionAccessInfo, - UnionFlow, AstExpr, AstNode, AstPrintOptions, AstBuild] +ALL_CLASSES = [Context, IdList, ValList, BasicSetList, BasicMapList, SetList, + MapList, UnionSetList, ConstraintList, AffList, PwAffList, BandList, + AstExprList, AstNodeList, IdToAstExpr, Printer, Val, MultiVal, Vec, + Mat, Aff, PwAff, UnionPwAff, MultiAff, MultiPwAff, PwMultiAff, + UnionPwMultiAff, UnionPwAffList, MultiUnionPwAff, Id, Constraint, + Space, LocalSpace, BasicSet, BasicMap, Set, Map, UnionMap, UnionSet, + Point, Vertex, Cell, Vertices, QPolynomialFold, PwQPolynomialFold, + UnionPwQPolynomialFold, UnionPwQPolynomial, QPolynomial, PwQPolynomial, + Term, Band, ScheduleConstraints, ScheduleNode, Schedule, AccessInfo, + Flow, Restriction, UnionAccessInfo, UnionFlow, AstExpr, AstNode, + AstPrintOptions, AstBuild] # }}}