The primary motivation is to fix an assertion failure in
isl_basic_map_alloc_equality:
isl_assert(ctx, room_for_con(bmap, 1), return -1);
Although the assertion does not occur anymore, I could not identify
which of ISL's commits fixed it.
Compared to the previous ISL version, Polly requires some changes for this update
* Since ISL commit
20d3574 "perform parameter alignment by modifying both arguments to function"
isl_*_gist_* and similar functions do not always align the paramter
list anymore. This caused the parameter lists in JScop files to
become out-of-sync. Since many regression tests use JScop files with
a fixed parameter list and order, we explicitly call align_params to
ensure a predictable parameter list.
* ISL changed some return types to isl_size, a typedef of (signed) int.
This caused some issues where the return type was unsigned int before:
- No overload for std::max(unsigned,isl_size)
- It cause additional 'mixed signed/unsigned comparison' warnings.
Since they do not break compilation, and sizes larger than 2^31
were never supported, I am going to fix it separately.
* With the change to isl_size, commit
57d547 "isl_*_list_size: return isl_size"
also changed the return value in case of an error from 0 to -1. This
caused undefined looping over isl_iterator since the 'end iterator'
got index -1, never reached from the 'begin iterator' with index 0.
* Some internal changes in ISL caused the number of operations to
increase when determining access ranges to determine aliasing
overlaps. In one test, this caused exceeding the default limit of
800000. The operations-limit was disabled for this test.
67 lines
2.6 KiB
C++
67 lines
2.6 KiB
C++
#include <set>
|
|
#include <clang/AST/Decl.h>
|
|
#include "generator.h"
|
|
|
|
using namespace std;
|
|
using namespace clang;
|
|
|
|
class python_generator : public generator {
|
|
private:
|
|
set<string> done;
|
|
|
|
public:
|
|
python_generator(SourceManager &SM, set<RecordDecl *> &exported_types,
|
|
set<FunctionDecl *> exported_functions,
|
|
set<FunctionDecl *> functions) :
|
|
generator(SM, exported_types, exported_functions, functions) {}
|
|
|
|
virtual void generate();
|
|
|
|
private:
|
|
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_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, int drop_user);
|
|
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);
|
|
|
|
};
|