@@ -117,7 +117,7 @@ def __init__(self, name,
117117class Method :
118118 def __init__ (self , cls , name , c_name ,
119119 return_semantics , return_base_type , return_ptr ,
120- args , is_exported , is_constructor ):
120+ args , is_exported , is_constructor , is_internal ):
121121 self .cls = cls
122122 self .name = name
123123 assert name
@@ -128,6 +128,7 @@ def __init__(self, cls, name, c_name,
128128 self .args = args
129129 self .mutator_veto = False
130130 self .is_exported = is_exported
131+ self .is_internal = is_internal
131132 self .is_constructor = is_constructor
132133
133134 if not self .is_static :
@@ -490,7 +491,7 @@ def get_preprocessed_header(self, fname):
490491
491492 # {{{ read_header
492493
493- def read_header (self , fname ):
494+ def read_header (self , fname , is_internal = False ):
494495 lines = self .get_preprocessed_header (fname ).split ("\n " )
495496
496497 # heed continuations, split at semicolons
@@ -562,13 +563,13 @@ def read_header(self, fname):
562563 line = lines [i ].strip ()
563564
564565 if not STRUCT_DECL_RE .search (decl ):
565- self .parse_decl (decl )
566+ self .parse_decl (decl , is_internal )
566567
567568 # }}}
568569
569570 # {{{ parse_decl
570571
571- def parse_decl (self , decl ):
572+ def parse_decl (self , decl , is_internal ):
572573 decl_match = DECL_RE .match (decl )
573574 if decl_match is None :
574575 print (f"WARNING: func decl regexp not matched: { decl } " )
@@ -702,7 +703,8 @@ def parse_decl(self, decl):
702703 cls_meth_list .append (Method (
703704 class_name , name , c_name ,
704705 return_semantics , return_base_type , return_ptr ,
705- args , is_exported = is_exported , is_constructor = is_constructor ))
706+ args , is_exported = is_exported , is_constructor = is_constructor ,
707+ is_internal = is_internal ))
706708
707709 self .seen_c_names .add (c_name )
708710
@@ -1394,10 +1396,18 @@ def write_exposer(outf, meth, arg_names, doc_str):
13941396 # doc_str = "(static method)\n" + doc_str
13951397
13961398 if not meth .is_exported :
1397- doc_str = doc_str + (
1398- "\n \n .. warning::\n \n "
1399- "This function is not part of the officially public isl API. "
1400- "Use at your own risk." )
1399+ if meth .is_internal :
1400+ doc_str = doc_str + (
1401+ "\n \n .. warning::\n \n "
1402+ "This function is so internal, it is not even exposed in isl's "
1403+ "public headers. We declared it on our own, in hopes that "
1404+ "isl didn't change the functions prototype. "
1405+ "Really, if you have any sense at all, don't use this." )
1406+ else :
1407+ doc_str = doc_str + (
1408+ "\n \n .. warning::\n \n "
1409+ "This function is not part of the officially public isl API. "
1410+ "Use at your own risk." )
14011411
14021412 doc_str_arg = ', "{}"' .format (doc_str .replace ("\n " , "\\ n" ))
14031413
@@ -1460,7 +1470,8 @@ def write_wrappers(expf, wrapf, methods):
14601470 }
14611471
14621472
1463- def gen_wrapper (include_dirs , include_barvinok = False , isl_version = None ):
1473+ def gen_wrapper (include_dirs , include_barvinok = False , isl_version = None ,
1474+ include_internal = False ):
14641475 fdata = FunctionData (["." ] + include_dirs )
14651476 fdata .read_header ("isl/ctx.h" )
14661477 fdata .read_header ("isl/id.h" )
@@ -1490,6 +1501,12 @@ def gen_wrapper(include_dirs, include_barvinok=False, isl_version=None):
14901501 fdata .read_header ("isl/ast_type.h" )
14911502 fdata .read_header ("isl/ilp.h" )
14921503
1504+ if include_internal :
1505+ # We're reaching deep into isl here, to functions that we're not
1506+ # supposed to touch.
1507+ fdata .include_dirs .append ("isl" )
1508+ fdata .read_header ("isl_equalities.h" , is_internal = True )
1509+
14931510 if include_barvinok :
14941511 fdata .read_header ("barvinok/isl.h" )
14951512
0 commit comments