~pali/llvm/polly-trunk

« back to all changes in this revision

Viewing changes to lib/External/isl/interface/generator.h

  • Committer: grosser
  • Date: 2018-08-07 05:51:21 UTC
  • Revision ID: svn-v4:91177308-0d34-0410-b5e6-96231b3b80d8:polly/trunk:339095
Update isl to isl-0.20-48-g13eba5b5

This is a regular maintenance updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        FunctionDecl *fn_to_str;
27
27
        FunctionDecl *fn_copy;
28
28
        FunctionDecl *fn_free;
 
29
 
 
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);
 
36
        }
29
37
};
30
38
 
31
39
/* Base class for interface generators.
32
40
 */
33
41
class generator {
34
42
protected:
 
43
        SourceManager &SM;
35
44
        map<string,isl_class> classes;
36
45
        map<string, FunctionDecl *> functions_by_name;
37
46
 
38
47
public:
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);
42
51
 
44
53
        virtual ~generator() {};
45
54
 
46
55
protected:
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);
 
59
public:
 
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);
70
78
};
71
79
 
72
80
#endif /* ISL_INTERFACE_GENERATOR_H */