2018-08-01 17:20:03 +08:00
|
|
|
#ifndef ISL_INTERFACE_GENERATOR_H
|
|
|
|
#define ISL_INTERFACE_GENERATOR_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
#include <vector>
|
2018-08-01 17:20:03 +08:00
|
|
|
|
|
|
|
#include <clang/AST/Decl.h>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace clang;
|
|
|
|
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
/* Compare the prefix of "s" to "prefix" up to the length of "prefix".
|
|
|
|
*/
|
|
|
|
inline int prefixcmp(const char *s, const char *prefix)
|
|
|
|
{
|
|
|
|
return strncmp(s, prefix, strlen(prefix));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Information about a single enum value of an enum set by a function.
|
|
|
|
* "value" is the enum value.
|
|
|
|
* "name" is the corresponding name.
|
|
|
|
* "method_name" is the the name of the method that sets this value.
|
|
|
|
*/
|
|
|
|
struct set_enum {
|
|
|
|
int value;
|
|
|
|
string name;
|
|
|
|
string method_name;
|
|
|
|
set_enum(int value, string name, string method_name) :
|
|
|
|
value(value), name(name), method_name(method_name) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Helper structure for sorting FunctionDecl pointers
|
|
|
|
* on the corresponding function names.
|
|
|
|
*/
|
|
|
|
struct function_name_less {
|
2020-08-21 13:17:29 +08:00
|
|
|
bool operator()(FunctionDecl *x, FunctionDecl *y) const {
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
return x->getName() < y->getName();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Set of FunctionDecl pointers sorted on function name.
|
|
|
|
*/
|
|
|
|
typedef std::set<FunctionDecl *, function_name_less> function_set;
|
|
|
|
|
2018-08-01 17:20:03 +08:00
|
|
|
/* isl_class collects all constructors and methods for an isl "class".
|
|
|
|
* "name" is the name of the class.
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
* If this object describes a subclass of a C type, then
|
|
|
|
* "subclass_name" is the name of that subclass and "superclass_name"
|
|
|
|
* is the name of the immediate superclass of that subclass. Otherwise,
|
|
|
|
* "subclass_name" is equal to "name" and "superclass_name" is undefined.
|
2018-08-01 17:20:03 +08:00
|
|
|
* "type" is the declaration that introduces the type.
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
* "persistent_callbacks" contains the set of functions that
|
|
|
|
* set a persistent callback.
|
|
|
|
* "set_enums" maps the set of functions that set an enum value
|
|
|
|
* to information associated to each value.
|
|
|
|
* A function is considered to set an enum value if it returns
|
|
|
|
* an object of the same type and if its last argument is of an enum type.
|
2018-08-01 17:20:03 +08:00
|
|
|
* "methods" contains the set of methods, grouped by method name.
|
|
|
|
* "fn_to_str" is a reference to the *_to_str method of this class, if any.
|
|
|
|
* "fn_copy" is a reference to the *_copy method of this class, if any.
|
|
|
|
* "fn_free" is a reference to the *_free method of this class, if any.
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
* "fn_type" is a reference to a function that described subclasses, if any.
|
|
|
|
* If "fn_type" is set, then "type_subclasses" maps the values returned
|
|
|
|
* by that function to the names of the corresponding subclasses.
|
2021-07-05 01:49:41 +08:00
|
|
|
*
|
|
|
|
* The following fields are only used for the C++ bindings.
|
|
|
|
* For methods that are not derived from a function that applies
|
|
|
|
* directly to this class, but are rather copied from some ancestor,
|
|
|
|
* "copied_from" records the direct superclass from which the method
|
|
|
|
* was copied (where it may have been copied from a further ancestor) and
|
|
|
|
* "copy_depth" records the distance to the ancestor to which
|
|
|
|
* the function applies.
|
|
|
|
* "construction_types" contains the set of isl classes that can be
|
|
|
|
* implicitly converted to this class through a unary constructor,
|
|
|
|
* mapped to the single argument
|
|
|
|
* of this unary constructor.
|
2018-08-01 17:20:03 +08:00
|
|
|
*/
|
|
|
|
struct isl_class {
|
|
|
|
string name;
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
string superclass_name;
|
|
|
|
string subclass_name;
|
2018-08-01 17:20:03 +08:00
|
|
|
RecordDecl *type;
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
function_set constructors;
|
|
|
|
set<FunctionDecl *> persistent_callbacks;
|
|
|
|
map<FunctionDecl *, vector<set_enum> > set_enums;
|
|
|
|
map<string, function_set> methods;
|
|
|
|
map<int, string> type_subclasses;
|
|
|
|
FunctionDecl *fn_type;
|
2018-08-01 17:20:03 +08:00
|
|
|
FunctionDecl *fn_to_str;
|
|
|
|
FunctionDecl *fn_copy;
|
|
|
|
FunctionDecl *fn_free;
|
2018-08-07 13:51:21 +08:00
|
|
|
|
2021-07-05 01:49:41 +08:00
|
|
|
std::map<clang::FunctionDecl *, const isl_class &> copied_from;
|
|
|
|
std::map<clang::FunctionDecl *, int> copy_depth;
|
|
|
|
std::map<std::string, clang::ParmVarDecl *> construction_types;
|
|
|
|
|
|
|
|
/* Is the first argument an instance of the class? */
|
|
|
|
bool first_arg_matches_class(FunctionDecl *method) const;
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
/* Does "method" correspond to a static method? */
|
|
|
|
bool is_static(FunctionDecl *method) const;
|
|
|
|
/* Is this class a subclass based on a type function? */
|
|
|
|
bool is_type_subclass() const { return name != subclass_name; }
|
|
|
|
/* Return name of "fd" without type suffixes, if any. */
|
|
|
|
static string name_without_type_suffixes(FunctionDecl *fd);
|
|
|
|
/* Extract the method name corresponding to "fd"
|
|
|
|
* (including "get" method prefix if any).
|
|
|
|
*/
|
|
|
|
string base_method_name(FunctionDecl *fd) const {
|
|
|
|
string m_name = name_without_type_suffixes(fd);
|
|
|
|
return m_name.substr(subclass_name.length() + 1);
|
|
|
|
}
|
|
|
|
/* The prefix of a "get" method. */
|
|
|
|
static const char *get_prefix;
|
|
|
|
/* Is function "fd" with the given name a "get" method? */
|
|
|
|
bool is_get_method_name(FunctionDecl *fd, const string &name) const;
|
|
|
|
/* Is function "fd" a "get" method? */
|
|
|
|
bool is_get_method(FunctionDecl *fd) const {
|
|
|
|
return is_get_method_name(fd, base_method_name(fd));
|
|
|
|
}
|
2018-08-07 13:51:21 +08:00
|
|
|
/* Extract the method name corresponding to "fd". */
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
string method_name(FunctionDecl *fd) const;
|
|
|
|
/* The prefix of any method that may set a (persistent) callback. */
|
|
|
|
static const char *set_callback_prefix;
|
|
|
|
/* Given a function that sets a persistent callback,
|
|
|
|
* return the name of the callback.
|
|
|
|
*/
|
|
|
|
string persistent_callback_name(FunctionDecl *fd) const {
|
|
|
|
return method_name(fd).substr(strlen(set_callback_prefix));
|
|
|
|
}
|
|
|
|
/* Does this class have any functions that set a persistent callback?
|
|
|
|
*/
|
|
|
|
bool has_persistent_callbacks() const {
|
|
|
|
return persistent_callbacks.size() != 0;
|
2018-08-07 13:51:21 +08:00
|
|
|
}
|
2018-08-01 17:20:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Base class for interface generators.
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
*
|
|
|
|
* "conversions" maps the target type of automatic conversion
|
|
|
|
* to the second input argument of the conversion function.
|
2018-08-01 17:20:03 +08:00
|
|
|
*/
|
|
|
|
class generator {
|
|
|
|
protected:
|
2018-08-07 13:51:21 +08:00
|
|
|
SourceManager &SM;
|
2018-08-01 17:20:03 +08:00
|
|
|
map<string,isl_class> classes;
|
|
|
|
map<string, FunctionDecl *> functions_by_name;
|
|
|
|
|
|
|
|
public:
|
2018-08-07 13:51:21 +08:00
|
|
|
generator(SourceManager &SM, set<RecordDecl *> &exported_types,
|
2018-08-01 17:20:03 +08:00
|
|
|
set<FunctionDecl *> exported_functions,
|
|
|
|
set<FunctionDecl *> functions);
|
|
|
|
|
|
|
|
virtual void generate() = 0;
|
|
|
|
virtual ~generator() {};
|
|
|
|
|
|
|
|
protected:
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
void add_subclass(RecordDecl *decl, const string &name,
|
|
|
|
const string &sub_name);
|
|
|
|
void add_class(RecordDecl *decl);
|
|
|
|
void add_type_subclasses(FunctionDecl *method);
|
2018-08-01 17:20:03 +08:00
|
|
|
isl_class *method2class(FunctionDecl *fd);
|
2018-08-07 13:51:21 +08:00
|
|
|
bool callback_takes_argument(ParmVarDecl *param, int pos);
|
2018-08-01 17:20:03 +08:00
|
|
|
FunctionDecl *find_by_name(const string &name, bool required);
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
std::map<const Type *, ParmVarDecl *> conversions;
|
|
|
|
private:
|
|
|
|
static const std::set<std::string> automatic_conversion_functions;
|
|
|
|
void extract_automatic_conversion(FunctionDecl *fd);
|
|
|
|
void extract_class_automatic_conversions(const isl_class &clazz);
|
|
|
|
void extract_automatic_conversions();
|
2018-08-07 13:51:21 +08:00
|
|
|
public:
|
2021-07-05 01:49:41 +08:00
|
|
|
static std::string drop_suffix(const std::string &s,
|
|
|
|
const std::string &suffix);
|
2018-08-07 13:51:21 +08:00
|
|
|
static void die(const char *msg) __attribute__((noreturn));
|
|
|
|
static void die(string msg) __attribute__((noreturn));
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
static vector<string> find_superclasses(Decl *decl);
|
|
|
|
static bool is_subclass(FunctionDecl *decl);
|
2018-08-07 13:51:21 +08:00
|
|
|
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);
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
static bool is_isl_neg_error(QualType type);
|
2018-08-07 13:51:21 +08:00
|
|
|
static bool is_isl_bool(QualType type);
|
|
|
|
static bool is_isl_stat(QualType type);
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
static bool is_isl_size(QualType type);
|
2018-08-07 13:51:21 +08:00
|
|
|
static bool is_long(QualType type);
|
|
|
|
static bool is_callback(QualType type);
|
|
|
|
static bool is_string(QualType type);
|
|
|
|
static bool is_static(const isl_class &clazz, FunctionDecl *method);
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
static bool is_mutator(const isl_class &clazz, FunctionDecl *fd);
|
2018-08-07 13:51:21 +08:00
|
|
|
static string extract_type(QualType type);
|
2018-08-09 13:07:05 +08:00
|
|
|
static const FunctionProtoType *extract_prototype(QualType type);
|
[Polly] Update ISL to isl-0.22.1-87-gfee05a13.
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.
2020-02-11 04:51:33 +08:00
|
|
|
static ParmVarDecl *persistent_callback_arg(FunctionDecl *fd);
|
2018-08-01 17:20:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ISL_INTERFACE_GENERATOR_H */
|