1#ifndef ISL_INTERFACE_GENERATOR_H
2#define ISL_INTERFACE_GENERATOR_H
9#include <clang/AST/Decl.h>
16inline int prefixcmp(
const char *s,
const char *prefix)
18 return strncmp(s, prefix, strlen(prefix));
38 bool operator()(FunctionDecl *x, FunctionDecl *y)
const {
39 return x->getName() < y->getName();
95 std::map<clang::FunctionDecl *, const isl_class &>
copied_from;
102 bool is_static(FunctionDecl *method)
const;
151 generator(SourceManager &
SM, set<RecordDecl *> &exported_types,
152 set<FunctionDecl *> exported_functions,
153 set<FunctionDecl *> functions);
160 const string &sub_name);
173 static std::string
drop_suffix(
const std::string &s,
174 const std::string &suffix);
181 static bool takes(Decl *decl);
182 static bool keeps(Decl *decl);
183 static bool gives(Decl *decl);
static bool keeps(Decl *decl)
static string extract_type(QualType type)
void add_subclass(RecordDecl *decl, const string &name, const string &sub_name)
std::map< const Type *, ParmVarDecl * > conversions
bool callback_takes_argument(ParmVarDecl *param, int pos)
static bool is_overload(Decl *decl)
static bool is_subclass(FunctionDecl *decl)
static bool is_callback(QualType type)
FunctionDecl * find_by_name(const string &name, bool required)
static bool is_isl_type(QualType type)
void extract_automatic_conversions()
void add_class(RecordDecl *decl)
static bool takes(Decl *decl)
static ParmVarDecl * persistent_callback_arg(FunctionDecl *fd)
static int prototype_n_args(QualType type)
static bool is_isl_size(QualType type)
void extract_class_automatic_conversions(const isl_class &clazz)
static bool gives(Decl *decl)
isl_class * method2class(FunctionDecl *fd)
static bool is_isl_ctx(QualType type)
virtual void generate()=0
static bool is_mutator(const isl_class &clazz, FunctionDecl *fd)
static bool is_string(QualType type)
static bool is_static(const isl_class &clazz, FunctionDecl *method)
map< string, FunctionDecl * > functions_by_name
void extract_automatic_conversion(FunctionDecl *fd)
static bool is_callback_arg(FunctionDecl *fd, int i)
static bool is_isl_neg_error(QualType type)
static std::string drop_suffix(const std::string &s, const std::string &suffix)
static const std::set< std::string > automatic_conversion_functions
static bool is_isl_bool(QualType type)
static bool is_long(QualType type)
static bool is_isl_stat(QualType type)
static bool first_arg_is_isl_ctx(FunctionDecl *fd)
void add_type_subclasses(FunctionDecl *method)
map< string, isl_class > classes
static bool is_constructor(Decl *decl)
static const FunctionProtoType * extract_prototype(QualType type)
static vector< string > find_superclasses(Decl *decl)
std::set< FunctionDecl *, function_name_less > function_set
int prefixcmp(const char *s, const char *prefix)
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
bool operator()(FunctionDecl *x, FunctionDecl *y) const
bool first_arg_matches_class(FunctionDecl *method) const
string base_method_name(FunctionDecl *fd) const
static const char * get_prefix
map< FunctionDecl *, vector< set_enum > > set_enums
map< string, function_set > methods
static const char * set_callback_prefix
static string name_without_type_suffixes(FunctionDecl *fd)
std::map< clang::FunctionDecl *, int > copy_depth
bool is_type_subclass() const
bool is_get_method_name(FunctionDecl *fd, const string &name) const
map< int, string > type_subclasses
std::map< clang::FunctionDecl *, const isl_class & > copied_from
bool has_persistent_callbacks() const
bool is_static(FunctionDecl *method) const
bool is_get_method(FunctionDecl *fd) const
std::map< std::string, clang::ParmVarDecl * > construction_types
string persistent_callback_name(FunctionDecl *fd) const
set< FunctionDecl * > persistent_callbacks
string method_name(FunctionDecl *fd) const
function_set constructors
set_enum(int value, string name, string method_name)