forked from simbuerg/isl-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAstBuild.h
129 lines (111 loc) · 3.4 KB
/
AstBuild.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#ifndef ISL_CXX_AstBuild_H
#define ISL_CXX_AstBuild_H
#include "isl/ast_build.h"
#include "isl/IslBase.h"
#include "isl/IslException.h"
#include "isl/ast.h"
#include <string>
#include <ostream>
#include "isl/IslFnPtr.h"
namespace isl {
class AstExpr;
class AstNode;
class MultiPwAff;
class PwAff;
class PwMultiAff;
class Set;
class Space;
class UnionMap;
class AstBuild {
protected:
public:
Ctx ctx;
void * This;
explicit AstBuild(Ctx ctx, isl_ast_build *That) : ctx(ctx), This((void *)That) {}
explicit AstBuild(Ctx ctx, void *That) : ctx(ctx), This(That) {}
const Ctx &Context() const { return ctx; }
isl_ast_build *GetCopy() const;
/// \brief Release ownership of the wrapped object.
///
/// You are on your own now buddy.
/// The wrapper cannot be used anymore after calling Give()
///
/// \returns the wrapped isl object.
isl_ast_build *Give();
/// \brief unwrap the stored isl object.
/// \return a the wrapped isl object.
isl_ast_build *Get() const;
/// \brief Constructor for isl_ast_build_from_context
///
/// \param set
static AstBuild fromContext(const Set &set);
virtual ~AstBuild();
virtual AstBuild asAstBuild() const;
/// \brief Generated from ::<isl_ast_build_access_from_multi_pw_aff>
///
/// \param [in] mpa
///
/// \returns A new AstExpr
AstExpr accessFromMultiPwAff(const MultiPwAff &mpa) const;
/// \brief Generated from ::<isl_ast_build_access_from_pw_multi_aff>
///
/// \param [in] pma
///
/// \returns A new AstExpr
AstExpr accessFromPwMultiAff(const PwMultiAff &pma) const;
/// \brief Generated from ::<isl_ast_build_ast_from_schedule>
///
/// \param [in] schedule
///
/// \returns A new AstNode
AstNode astFromSchedule(const UnionMap &schedule) const;
/// \brief Generated from ::<isl_ast_build_call_from_multi_pw_aff>
///
/// \param [in] mpa
///
/// \returns A new AstExpr
AstExpr callFromMultiPwAff(const MultiPwAff &mpa) const;
/// \brief Generated from ::<isl_ast_build_call_from_pw_multi_aff>
///
/// \param [in] pma
///
/// \returns A new AstExpr
AstExpr callFromPwMultiAff(const PwMultiAff &pma) const;
/// \brief Generated from ::<isl_ast_build_expr_from_pw_aff>
///
/// \param [in] pa
///
/// \returns A new AstExpr
AstExpr exprFromPwAff(const PwAff &pa) const;
/// \brief Generated from ::<isl_ast_build_get_schedule>
///
///
/// \returns A new UnionMap
UnionMap getSchedule() const;
/// \brief Generated from ::<isl_ast_build_get_schedule_space>
///
///
/// \returns A new Space
Space getScheduleSpace() const;
/// \brief Generated from ::<isl_ast_build_set_at_each_domain>
///
/// \param [in] fn
/// \param [in] user
///
/// \returns A new AstBuild
AstBuild setAtEachDomain(const std::function<isl_ast_node *(isl_ast_node *, isl_ast_build *, void *)> && fn, void * user) const;
AstBuild(const AstBuild &Other) : ctx(Other.Context()), This(Other.GetCopy()) {}
AstBuild &operator=(const AstBuild &Other);
AstBuild (AstBuild && Other) : ctx(Other.Context()), This(Other.This) {}
AstBuild &operator=(AstBuild && Other) {
isl_ast_build *New = Other.Give();
isl_ast_build_free((isl_ast_build *)This);
This = New;
return *this;
}
/// \brief Implement lt via pointer comparison of the
/// wrapped isl objects.
bool operator<(const AstBuild &RHS) const { return This < RHS.This; }
};
} // namespace isl
#endif //ISL_CXX_AstBuild_H