Polly 19.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
generator Class Referenceabstract

#include <generator.h>

Inheritance diagram for generator:
Inheritance graph
[legend]

Public Member Functions

 generator (SourceManager &SM, set< RecordDecl * > &exported_types, set< FunctionDecl * > exported_functions, set< FunctionDecl * > functions)
 
virtual void generate ()=0
 
virtual ~generator ()
 

Static Public Member Functions

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

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

SourceManager & SM
 
map< string, isl_classclasses
 
map< string, FunctionDecl * > functions_by_name
 
std::map< const Type *, ParmVarDecl * > conversions
 

Private Member Functions

void extract_automatic_conversion (FunctionDecl *fd)
 
void extract_class_automatic_conversions (const isl_class &clazz)
 
void extract_automatic_conversions ()
 

Static Private Attributes

static const std::set< std::string > automatic_conversion_functions
 

Detailed Description

Definition at line 144 of file generator.h.

Constructor & Destructor Documentation

◆ generator()

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

◆ ~generator()

virtual generator::~generator ( )
inlinevirtual

Definition at line 156 of file generator.h.

Member Function Documentation

◆ add_class()

void generator::add_class ( RecordDecl *  decl)
protected

Definition at line 213 of file generator.cc.

References add_subclass().

Referenced by generator().

◆ add_subclass()

void generator::add_subclass ( RecordDecl *  decl,
const string &  name,
const string &  sub_name 
)
protected

Definition at line 196 of file generator.cc.

References classes, find_by_name(), and name.

Referenced by add_class(), and add_type_subclasses().

◆ add_type_subclasses()

void generator::add_type_subclasses ( FunctionDecl *  method)
protected

◆ callback_takes_argument()

bool generator::callback_takes_argument ( ParmVarDecl *  param,
int  pos 
)
protected

◆ die() [1/2]

void generator::die ( const char *  msg)
static

◆ die() [2/2]

void generator::die ( string  msg)
static

Definition at line 450 of file generator.cc.

References die.

◆ drop_suffix()

std::string generator::drop_suffix ( const std::string &  s,
const std::string &  suffix 
)
static

Definition at line 824 of file generator.cc.

Referenced by callback_name(), and isl_class::name_without_type_suffixes().

◆ extract_automatic_conversion()

void generator::extract_automatic_conversion ( FunctionDecl *  fd)
private

Definition at line 145 of file generator.cc.

References conversions, die, is_isl_ctx(), is_isl_type(), and type.

Referenced by extract_class_automatic_conversions().

◆ extract_automatic_conversions()

void generator::extract_automatic_conversions ( )
private

Definition at line 181 of file generator.cc.

References classes, and extract_class_automatic_conversions().

Referenced by generator().

◆ extract_class_automatic_conversions()

void generator::extract_class_automatic_conversions ( const isl_class clazz)
private

◆ extract_prototype()

const FunctionProtoType * generator::extract_prototype ( QualType  type)
static

◆ extract_type()

string generator::extract_type ( QualType  type)
static

◆ find_by_name()

FunctionDecl * generator::find_by_name ( const string &  name,
bool  required 
)
protected

Definition at line 117 of file generator.cc.

References die, functions_by_name, and name.

Referenced by add_subclass().

◆ find_superclasses()

std::vector< string > generator::find_superclasses ( Decl *  decl)
static

◆ first_arg_is_isl_ctx()

bool generator::first_arg_is_isl_ctx ( FunctionDecl *  fd)
static

◆ generate()

virtual void generator::generate ( )
pure virtual

◆ gives()

bool generator::gives ( Decl *  decl)
static

◆ is_callback()

bool generator::is_callback ( QualType  type)
static

◆ is_callback_arg()

bool generator::is_callback_arg ( FunctionDecl *  fd,
int  i 
)
static

Definition at line 740 of file generator.cc.

References is_callback(), and type.

Referenced by python_generator::print_method(), and python_generator::print_method_call().

◆ is_constructor()

bool generator::is_constructor ( Decl *  decl)
static

Definition at line 517 of file generator.cc.

References has_annotation().

Referenced by generator(), and get_kind().

◆ is_isl_bool()

bool generator::is_isl_bool ( QualType  type)
static

◆ is_isl_ctx()

bool generator::is_isl_ctx ( QualType  type)
static

◆ is_isl_neg_error()

bool generator::is_isl_neg_error ( QualType  type)
static

◆ is_isl_size()

bool generator::is_isl_size ( QualType  type)
static

◆ is_isl_stat()

bool generator::is_isl_stat ( QualType  type)
static

◆ is_isl_type()

bool generator::is_isl_type ( QualType  type)
static

◆ is_long()

bool generator::is_long ( QualType  type)
static

Definition at line 762 of file generator.cc.

References type.

Referenced by python_generator::print_argtypes().

◆ is_mutator()

bool generator::is_mutator ( const isl_class clazz,
FunctionDecl *  fd 
)
static

◆ is_overload()

bool generator::is_overload ( Decl *  decl)
static

◆ is_static()

bool generator::is_static ( const isl_class clazz,
FunctionDecl *  method 
)
static

◆ is_string()

bool generator::is_string ( QualType  type)
static

◆ is_subclass()

bool generator::is_subclass ( FunctionDecl *  decl)
static

Definition at line 503 of file generator.cc.

References find_superclasses().

Referenced by generator().

◆ keeps()

bool generator::keeps ( Decl *  decl)
static

◆ method2class()

isl_class * generator::method2class ( FunctionDecl *  fd)
protected

Definition at line 546 of file generator.cc.

References classes, and name.

Referenced by add_type_subclasses(), cpp_generator::copy_methods(), and generator().

◆ persistent_callback_arg()

ParmVarDecl * generator::persistent_callback_arg ( FunctionDecl *  fd)
static

◆ prototype_n_args()

int generator::prototype_n_args ( QualType  type)
static

Definition at line 797 of file generator.cc.

References extract_prototype(), and type.

Referenced by Method::on_fd_arg_list(), and print_callback_lambdas().

◆ takes()

bool generator::takes ( Decl *  decl)
static

Member Data Documentation

◆ automatic_conversion_functions

const std::set< std::string > generator::automatic_conversion_functions
staticprivate
Initial value:
= {
"isl_id_read_from_str",
"isl_val_int_from_si",
}

Definition at line 168 of file generator.h.

Referenced by extract_class_automatic_conversions().

◆ classes

map<string,isl_class> generator::classes
protected

◆ conversions

std::map<const Type *, ParmVarDecl *> generator::conversions
protected

◆ functions_by_name

map<string, FunctionDecl *> generator::functions_by_name
protected

Definition at line 148 of file generator.h.

Referenced by find_by_name(), and generator().

◆ SM

SourceManager& generator::SM
protected

Definition at line 146 of file generator.h.

Referenced by callback_takes_argument().


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