Polly 20.0.0git
Public Member Functions | Private Member Functions | Private Attributes | List of all members
python_generator Class Reference

#include <python.h>

Inheritance diagram for python_generator:
Inheritance graph
[legend]

Public Member Functions

 python_generator (SourceManager &SM, set< RecordDecl * > &exported_types, set< FunctionDecl * > exported_functions, set< FunctionDecl * > functions)
 
virtual void generate ()
 
- Public Member Functions inherited from generator
 generator (SourceManager &SM, set< RecordDecl * > &exported_types, set< FunctionDecl * > exported_functions, set< FunctionDecl * > functions)
 
virtual void generate ()=0
 
virtual ~generator ()
 

Private Member Functions

void print (const isl_class &clazz)
 
void print_method_arguments (int first, int n_arg)
 
void print_method_header (bool is_static, const string &name, int n_arg)
 
void print_class_header (const isl_class &clazz, const string &name, const vector< string > &super)
 
void print_type_check (int indent, const string &type, const char *fmt, int pos, bool upcast, const string &super, const string &name, int n)
 
void print_type_checks (const string &cname, FunctionDecl *method, bool first_is_ctx, int n, const vector< string > &super)
 
void print_copy (QualType type)
 
void print_callback (ParmVarDecl *param, int arg)
 
void print_arg_in_call (FunctionDecl *fd, const char *fmt, int arg, int skip)
 
void print_argtypes (FunctionDecl *fd)
 
void print_method_return (int indent, const isl_class &clazz, FunctionDecl *method, const char *fmt)
 
void print_restype (FunctionDecl *fd)
 
void print (map< string, isl_class > &classes, set< string > &done)
 
void print_constructor (const isl_class &clazz, FunctionDecl *method)
 
void print_special_constructors (const isl_class &clazz)
 
void print_special_methods (const isl_class &clazz)
 
void print_upcast_constructors (const isl_class &clazz)
 
void print_new (const isl_class &clazz, const string &python_name)
 
void print_representation (const isl_class &clazz, const string &python_name)
 
void print_copy_callbacks (const isl_class &clazz)
 
void print_method_type (FunctionDecl *fd)
 
void print_method_types (const isl_class &clazz)
 
void print_get_method (const isl_class &clazz, FunctionDecl *fd)
 
void print_method (const isl_class &clazz, FunctionDecl *method, vector< string > super)
 
void print_method_call (int indent, const isl_class &clazz, FunctionDecl *method, const char *fmt, int drop_ctx)
 
void print_argument_checks (const isl_class &clazz, FunctionDecl *fd, int drop_ctx)
 
void print_method_overload (const isl_class &clazz, FunctionDecl *method)
 
void print_method (const isl_class &clazz, const string &fullname, const function_set &methods, vector< string > super)
 
void print_set_enum (const isl_class &clazz, FunctionDecl *fd, int value, const string &name, const vector< string > &super)
 
void print_set_enum (const isl_class &clazz, FunctionDecl *fd, const vector< string > &super)
 

Private Attributes

set< string > done
 

Additional Inherited Members

- Static Public Member Functions inherited from generator
static std::string drop_suffix (const std::string &s, const std::string &suffix)
 
static void die (const char *msg) __attribute__((noreturn))
 
static void die (string msg) __attribute__((noreturn))
 
static vector< string > find_superclasses (Decl *decl)
 
static bool is_subclass (FunctionDecl *decl)
 
static bool is_overload (Decl *decl)
 
static bool is_constructor (Decl *decl)
 
static bool takes (Decl *decl)
 
static bool keeps (Decl *decl)
 
static bool gives (Decl *decl)
 
static bool is_isl_ctx (QualType type)
 
static bool first_arg_is_isl_ctx (FunctionDecl *fd)
 
static bool is_isl_type (QualType type)
 
static bool is_isl_neg_error (QualType type)
 
static bool is_isl_bool (QualType type)
 
static bool is_isl_stat (QualType type)
 
static bool is_isl_size (QualType type)
 
static bool is_long (QualType type)
 
static bool is_callback (QualType type)
 
static bool is_callback_arg (FunctionDecl *fd, int i)
 
static bool is_string (QualType type)
 
static bool is_static (const isl_class &clazz, FunctionDecl *method)
 
static bool is_mutator (const isl_class &clazz, FunctionDecl *fd)
 
static string extract_type (QualType type)
 
static const FunctionProtoType * extract_prototype (QualType type)
 
static int prototype_n_args (QualType type)
 
static ParmVarDecl * persistent_callback_arg (FunctionDecl *fd)
 
- Protected Member Functions inherited from generator
void add_subclass (RecordDecl *decl, const string &name, const string &sub_name)
 
void add_class (RecordDecl *decl)
 
void add_type_subclasses (FunctionDecl *method)
 
isl_classmethod2class (FunctionDecl *fd)
 
bool callback_takes_argument (ParmVarDecl *param, int pos)
 
FunctionDecl * find_by_name (const string &name, bool required)
 
- Protected Attributes inherited from generator
SourceManager & SM
 
map< string, isl_classclasses
 
map< string, FunctionDecl * > functions_by_name
 
std::map< const Type *, ParmVarDecl * > conversions
 

Detailed Description

Definition at line 8 of file python.h.

Constructor & Destructor Documentation

◆ python_generator()

python_generator::python_generator ( SourceManager &  SM,
set< RecordDecl * > &  exported_types,
set< FunctionDecl * >  exported_functions,
set< FunctionDecl * >  functions 
)
inline

Definition at line 13 of file python.h.

Member Function Documentation

◆ generate()

void python_generator::generate ( )
virtual

Implements generator.

Definition at line 1171 of file python.cc.

References generator::classes, done, and print().

◆ print() [1/2]

void python_generator::print ( const isl_class clazz)
private

◆ print() [2/2]

void python_generator::print ( map< string, isl_class > &  classes,
set< string > &  done 
)
private

◆ print_arg_in_call()

void python_generator::print_arg_in_call ( FunctionDecl *  fd,
const char *  fmt,
int  arg,
int  skip 
)
private

◆ print_argtypes()

void python_generator::print_argtypes ( FunctionDecl *  fd)
private

◆ print_argument_checks()

void python_generator::print_argument_checks ( const isl_class clazz,
FunctionDecl *  fd,
int  drop_ctx 
)
private

◆ print_callback()

void python_generator::print_callback ( ParmVarDecl *  param,
int  arg 
)
private

◆ print_class_header()

void python_generator::print_class_header ( const isl_class clazz,
const string &  name,
const vector< string > &  super 
)
private

Definition at line 881 of file python.cc.

References isl_class::is_type_subclass(), name, isl_class::superclass_name, and type2python().

Referenced by print().

◆ print_constructor()

void python_generator::print_constructor ( const isl_class clazz,
FunctionDecl *  method 
)
private

◆ print_copy()

void python_generator::print_copy ( QualType  type)
private

Definition at line 190 of file python.cc.

References generator::extract_type(), and type.

Referenced by print_arg_in_call(), and print_callback().

◆ print_copy_callbacks()

void python_generator::print_copy_callbacks ( const isl_class clazz)
private

◆ print_get_method()

void python_generator::print_get_method ( const isl_class clazz,
FunctionDecl *  fd 
)
private

◆ print_method() [1/2]

void python_generator::print_method ( const isl_class clazz,
const string &  fullname,
const function_set methods,
vector< string >  super 
)
private

◆ print_method() [2/2]

void python_generator::print_method ( const isl_class clazz,
FunctionDecl *  method,
vector< string >  super 
)
private

◆ print_method_arguments()

void python_generator::print_method_arguments ( int  first,
int  n_arg 
)
private

Definition at line 63 of file python.cc.

References n_arg().

Referenced by print_get_method(), and print_method_header().

◆ print_method_call()

void python_generator::print_method_call ( int  indent,
const isl_class clazz,
FunctionDecl *  method,
const char *  fmt,
int  drop_ctx 
)
private

◆ print_method_header()

void python_generator::print_method_header ( bool  is_static,
const string &  name,
int  n_arg 
)
private

◆ print_method_overload()

void python_generator::print_method_overload ( const isl_class clazz,
FunctionDecl *  method 
)
private

◆ print_method_return()

void python_generator::print_method_return ( int  indent,
const isl_class clazz,
FunctionDecl *  method,
const char *  fmt 
)
private

◆ print_method_type()

void python_generator::print_method_type ( FunctionDecl *  fd)
private

Definition at line 957 of file python.cc.

References print_argtypes(), and print_restype().

Referenced by print_method_types().

◆ print_method_types()

void python_generator::print_method_types ( const isl_class clazz)
private

◆ print_new()

void python_generator::print_new ( const isl_class clazz,
const string &  python_name 
)
private

Definition at line 971 of file python.cc.

References isl_class::fn_type, isl_class::is_type_subclass(), type2python(), and isl_class::type_subclasses.

Referenced by print().

◆ print_representation()

void python_generator::print_representation ( const isl_class clazz,
const string &  python_name 
)
private

Definition at line 1014 of file python.cc.

References fixed_arg_fmt, isl_class::fn_to_str, and print_type_check().

Referenced by print().

◆ print_restype()

void python_generator::print_restype ( FunctionDecl *  fd)
private

Definition at line 910 of file python.cc.

References generator::is_isl_type(), generator::is_string(), and type.

Referenced by print_method_type().

◆ print_set_enum() [1/2]

void python_generator::print_set_enum ( const isl_class clazz,
FunctionDecl *  fd,
const vector< string > &  super 
)
private

Definition at line 737 of file python.cc.

References isl_class::method_name(), print_set_enum(), and isl_class::set_enums.

◆ print_set_enum() [2/2]

void python_generator::print_set_enum ( const isl_class clazz,
FunctionDecl *  fd,
int  value,
const string &  name,
const vector< string > &  super 
)
private

◆ print_special_constructors()

void python_generator::print_special_constructors ( const isl_class clazz)
private

Definition at line 809 of file python.cc.

References id_constructor_user, and isl_class::name.

Referenced by print().

◆ print_special_methods()

void python_generator::print_special_methods ( const isl_class clazz)
private

Definition at line 844 of file python.cc.

References id_user, and isl_class::name.

Referenced by print().

◆ print_type_check()

void python_generator::print_type_check ( int  indent,
const string &  type,
const char *  fmt,
int  pos,
bool  upcast,
const string &  super,
const string &  name,
int  n 
)
private

Definition at line 128 of file python.cc.

References n, name, pos(), print_indent(), type, and type2python().

Referenced by print_argument_checks(), print_representation(), and print_type_checks().

◆ print_type_checks()

void python_generator::print_type_checks ( const string &  cname,
FunctionDecl *  method,
bool  first_is_ctx,
int  n,
const vector< string > &  super 
)
private

◆ print_upcast_constructors()

void python_generator::print_upcast_constructors ( const isl_class clazz)
private

Definition at line 856 of file python.cc.

References isl_class::fn_type, isl_class::name, type2python(), and isl_class::type_subclasses.

Referenced by print().

Member Data Documentation

◆ done

set<string> python_generator::done
private

Definition at line 10 of file python.h.

Referenced by generate(), and print().


The documentation for this class was generated from the following files: