26
26
FunctionDecl *fn_to_str;
27
27
FunctionDecl *fn_copy;
28
28
FunctionDecl *fn_free;
30
/* Return name of "fd" without type suffix, if any. */
31
static string name_without_type_suffix(FunctionDecl *fd);
32
/* Extract the method name corresponding to "fd". */
33
string method_name(FunctionDecl *fd) const {
34
string m_name = name_without_type_suffix(fd);
35
return m_name.substr(name.length() + 1);
31
39
/* Base class for interface generators.
35
44
map<string,isl_class> classes;
36
45
map<string, FunctionDecl *> functions_by_name;
39
generator(set<RecordDecl *> &exported_types,
48
generator(SourceManager &SM, set<RecordDecl *> &exported_types,
40
49
set<FunctionDecl *> exported_functions,
41
50
set<FunctionDecl *> functions);
44
53
virtual ~generator() {};
47
void print_class_header(const isl_class &clazz, const string &name,
48
const vector<string> &super);
49
string drop_type_suffix(string name, FunctionDecl *method);
50
void die(const char *msg) __attribute__((noreturn));
51
void die(string msg) __attribute__((noreturn));
52
vector<string> find_superclasses(RecordDecl *decl);
53
bool is_overload(Decl *decl);
54
bool is_constructor(Decl *decl);
55
bool takes(Decl *decl);
56
bool keeps(Decl *decl);
57
bool gives(Decl *decl);
58
56
isl_class *method2class(FunctionDecl *fd);
59
bool is_isl_ctx(QualType type);
60
bool first_arg_is_isl_ctx(FunctionDecl *fd);
61
bool is_isl_type(QualType type);
62
bool is_isl_bool(QualType type);
63
bool is_isl_stat(QualType type);
64
bool is_long(QualType type);
65
bool is_callback(QualType type);
66
bool is_string(QualType type);
67
bool is_static(const isl_class &clazz, FunctionDecl *method);
68
string extract_type(QualType type);
57
bool callback_takes_argument(ParmVarDecl *param, int pos);
69
58
FunctionDecl *find_by_name(const string &name, bool required);
60
static void die(const char *msg) __attribute__((noreturn));
61
static void die(string msg) __attribute__((noreturn));
62
static vector<string> find_superclasses(RecordDecl *decl);
63
static bool is_overload(Decl *decl);
64
static bool is_constructor(Decl *decl);
65
static bool takes(Decl *decl);
66
static bool keeps(Decl *decl);
67
static bool gives(Decl *decl);
68
static bool is_isl_ctx(QualType type);
69
static bool first_arg_is_isl_ctx(FunctionDecl *fd);
70
static bool is_isl_type(QualType type);
71
static bool is_isl_bool(QualType type);
72
static bool is_isl_stat(QualType type);
73
static bool is_long(QualType type);
74
static bool is_callback(QualType type);
75
static bool is_string(QualType type);
76
static bool is_static(const isl_class &clazz, FunctionDecl *method);
77
static string extract_type(QualType type);
72
80
#endif /* ISL_INTERFACE_GENERATOR_H */