isl_rs/bindings/
enums.rs

1// Automatically generated by isl_bindings_generator.
2// LICENSE: MIT
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum ArgType {
6    End,
7    Alias,
8    Arg,
9    Bool,
10    Child,
11    Choice,
12    Flags,
13    Footer,
14    Int,
15    User,
16    Long,
17    Ulong,
18    Str,
19    StrList,
20    Version,
21}
22
23impl ArgType {
24    /// Returns i32 values as defined in libisl.
25    pub fn to_i32(&self) -> i32 {
26        match self {
27            ArgType::End => 0,
28            ArgType::Alias => 1,
29            ArgType::Arg => 2,
30            ArgType::Bool => 3,
31            ArgType::Child => 4,
32            ArgType::Choice => 5,
33            ArgType::Flags => 6,
34            ArgType::Footer => 7,
35            ArgType::Int => 8,
36            ArgType::User => 9,
37            ArgType::Long => 10,
38            ArgType::Ulong => 11,
39            ArgType::Str => 12,
40            ArgType::StrList => 13,
41            ArgType::Version => 14,
42        }
43    }
44}
45
46impl ArgType {
47    /// Constructor based on the i32 values as defined in libisl.
48    pub fn from_i32(val: i32) -> Self {
49        match val {
50            0 => ArgType::End,
51            1 => ArgType::Alias,
52            2 => ArgType::Arg,
53            3 => ArgType::Bool,
54            4 => ArgType::Child,
55            5 => ArgType::Choice,
56            6 => ArgType::Flags,
57            7 => ArgType::Footer,
58            8 => ArgType::Int,
59            9 => ArgType::User,
60            10 => ArgType::Long,
61            11 => ArgType::Ulong,
62            12 => ArgType::Str,
63            13 => ArgType::StrList,
64            14 => ArgType::Version,
65            _ => panic!("Illegal value."),
66        }
67    }
68}
69
70#[derive(Debug, Clone, Copy, PartialEq, Eq)]
71pub enum ASTExprOpType {
72    Error,
73    And,
74    AndThen,
75    Or,
76    OrElse,
77    Max,
78    Min,
79    Minus,
80    Add,
81    Sub,
82    Mul,
83    Div,
84    FdivQ,
85    PdivQ,
86    PdivR,
87    ZdivR,
88    Cond,
89    Select,
90    Eq,
91    Le,
92    Lt,
93    Ge,
94    Gt,
95    Call,
96    Access,
97    Member,
98    AddressOf,
99}
100
101impl ASTExprOpType {
102    /// Returns i32 values as defined in libisl.
103    pub fn to_i32(&self) -> i32 {
104        match self {
105            ASTExprOpType::Error => -1,
106            ASTExprOpType::And => 0,
107            ASTExprOpType::AndThen => 1,
108            ASTExprOpType::Or => 2,
109            ASTExprOpType::OrElse => 3,
110            ASTExprOpType::Max => 4,
111            ASTExprOpType::Min => 5,
112            ASTExprOpType::Minus => 6,
113            ASTExprOpType::Add => 7,
114            ASTExprOpType::Sub => 8,
115            ASTExprOpType::Mul => 9,
116            ASTExprOpType::Div => 10,
117            ASTExprOpType::FdivQ => 11,
118            ASTExprOpType::PdivQ => 12,
119            ASTExprOpType::PdivR => 13,
120            ASTExprOpType::ZdivR => 14,
121            ASTExprOpType::Cond => 15,
122            ASTExprOpType::Select => 16,
123            ASTExprOpType::Eq => 17,
124            ASTExprOpType::Le => 18,
125            ASTExprOpType::Lt => 19,
126            ASTExprOpType::Ge => 20,
127            ASTExprOpType::Gt => 21,
128            ASTExprOpType::Call => 22,
129            ASTExprOpType::Access => 23,
130            ASTExprOpType::Member => 24,
131            ASTExprOpType::AddressOf => 25,
132        }
133    }
134}
135
136impl ASTExprOpType {
137    /// Constructor based on the i32 values as defined in libisl.
138    pub fn from_i32(val: i32) -> Self {
139        match val {
140            -1 => ASTExprOpType::Error,
141            0 => ASTExprOpType::And,
142            1 => ASTExprOpType::AndThen,
143            2 => ASTExprOpType::Or,
144            3 => ASTExprOpType::OrElse,
145            4 => ASTExprOpType::Max,
146            5 => ASTExprOpType::Min,
147            6 => ASTExprOpType::Minus,
148            7 => ASTExprOpType::Add,
149            8 => ASTExprOpType::Sub,
150            9 => ASTExprOpType::Mul,
151            10 => ASTExprOpType::Div,
152            11 => ASTExprOpType::FdivQ,
153            12 => ASTExprOpType::PdivQ,
154            13 => ASTExprOpType::PdivR,
155            14 => ASTExprOpType::ZdivR,
156            15 => ASTExprOpType::Cond,
157            16 => ASTExprOpType::Select,
158            17 => ASTExprOpType::Eq,
159            18 => ASTExprOpType::Le,
160            19 => ASTExprOpType::Lt,
161            20 => ASTExprOpType::Ge,
162            21 => ASTExprOpType::Gt,
163            22 => ASTExprOpType::Call,
164            23 => ASTExprOpType::Access,
165            24 => ASTExprOpType::Member,
166            25 => ASTExprOpType::AddressOf,
167            _ => panic!("Illegal value."),
168        }
169    }
170}
171
172#[derive(Debug, Clone, Copy, PartialEq, Eq)]
173pub enum ASTExprType {
174    Error,
175    Op,
176    Id,
177    Int,
178}
179
180impl ASTExprType {
181    /// Returns i32 values as defined in libisl.
182    pub fn to_i32(&self) -> i32 {
183        match self {
184            ASTExprType::Error => -1,
185            ASTExprType::Op => 0,
186            ASTExprType::Id => 1,
187            ASTExprType::Int => 2,
188        }
189    }
190}
191
192impl ASTExprType {
193    /// Constructor based on the i32 values as defined in libisl.
194    pub fn from_i32(val: i32) -> Self {
195        match val {
196            -1 => ASTExprType::Error,
197            0 => ASTExprType::Op,
198            1 => ASTExprType::Id,
199            2 => ASTExprType::Int,
200            _ => panic!("Illegal value."),
201        }
202    }
203}
204
205#[derive(Debug, Clone, Copy, PartialEq, Eq)]
206pub enum ASTLoopType {
207    Error,
208    Default,
209    Atomic,
210    Unroll,
211    Separate,
212}
213
214impl ASTLoopType {
215    /// Returns i32 values as defined in libisl.
216    pub fn to_i32(&self) -> i32 {
217        match self {
218            ASTLoopType::Error => -1,
219            ASTLoopType::Default => 0,
220            ASTLoopType::Atomic => 1,
221            ASTLoopType::Unroll => 2,
222            ASTLoopType::Separate => 3,
223        }
224    }
225}
226
227impl ASTLoopType {
228    /// Constructor based on the i32 values as defined in libisl.
229    pub fn from_i32(val: i32) -> Self {
230        match val {
231            -1 => ASTLoopType::Error,
232            0 => ASTLoopType::Default,
233            1 => ASTLoopType::Atomic,
234            2 => ASTLoopType::Unroll,
235            3 => ASTLoopType::Separate,
236            _ => panic!("Illegal value."),
237        }
238    }
239}
240
241#[derive(Debug, Clone, Copy, PartialEq, Eq)]
242pub enum ASTNodeType {
243    Error,
244    For,
245    If,
246    Block,
247    Mark,
248    User,
249}
250
251impl ASTNodeType {
252    /// Returns i32 values as defined in libisl.
253    pub fn to_i32(&self) -> i32 {
254        match self {
255            ASTNodeType::Error => -1,
256            ASTNodeType::For => 0,
257            ASTNodeType::If => 1,
258            ASTNodeType::Block => 2,
259            ASTNodeType::Mark => 3,
260            ASTNodeType::User => 4,
261        }
262    }
263}
264
265impl ASTNodeType {
266    /// Constructor based on the i32 values as defined in libisl.
267    pub fn from_i32(val: i32) -> Self {
268        match val {
269            -1 => ASTNodeType::Error,
270            0 => ASTNodeType::For,
271            1 => ASTNodeType::If,
272            2 => ASTNodeType::Block,
273            3 => ASTNodeType::Mark,
274            4 => ASTNodeType::User,
275            _ => panic!("Illegal value."),
276        }
277    }
278}
279
280#[derive(Debug, Clone, Copy, PartialEq, Eq)]
281pub enum DimType {
282    Cst,
283    Param,
284    In,
285    Out,
286    Set,
287    Div,
288    All,
289}
290
291impl DimType {
292    /// Returns i32 values as defined in libisl.
293    pub fn to_i32(&self) -> i32 {
294        match self {
295            DimType::Cst => 0,
296            DimType::Param => 1,
297            DimType::In => 2,
298            DimType::Out => 3,
299            DimType::Set => 3,
300            DimType::Div => 4,
301            DimType::All => 5,
302        }
303    }
304}
305
306impl DimType {
307    /// Constructor based on the i32 values as defined in libisl.
308    pub fn from_i32(val: i32) -> Self {
309        match val {
310            0 => DimType::Cst,
311            1 => DimType::Param,
312            2 => DimType::In,
313            3 => DimType::Out,
314            3 => DimType::Set,
315            4 => DimType::Div,
316            5 => DimType::All,
317            _ => panic!("Illegal value."),
318        }
319    }
320}
321
322#[derive(Debug, Clone, Copy, PartialEq, Eq)]
323pub enum Error {
324    None_,
325    Abort,
326    Alloc,
327    Unknown,
328    Internal,
329    Invalid,
330    Quota,
331    Unsupported,
332}
333
334impl Error {
335    /// Returns i32 values as defined in libisl.
336    pub fn to_i32(&self) -> i32 {
337        match self {
338            Error::None_ => 0,
339            Error::Abort => 1,
340            Error::Alloc => 2,
341            Error::Unknown => 3,
342            Error::Internal => 4,
343            Error::Invalid => 5,
344            Error::Quota => 6,
345            Error::Unsupported => 7,
346        }
347    }
348}
349
350impl Error {
351    /// Constructor based on the i32 values as defined in libisl.
352    pub fn from_i32(val: i32) -> Self {
353        match val {
354            0 => Error::None_,
355            1 => Error::Abort,
356            2 => Error::Alloc,
357            3 => Error::Unknown,
358            4 => Error::Internal,
359            5 => Error::Invalid,
360            6 => Error::Quota,
361            7 => Error::Unsupported,
362            _ => panic!("Illegal value."),
363        }
364    }
365}
366
367#[derive(Debug, Clone, Copy, PartialEq, Eq)]
368pub enum Fold {
369    Error,
370    Min,
371    Max,
372    List,
373}
374
375impl Fold {
376    /// Returns i32 values as defined in libisl.
377    pub fn to_i32(&self) -> i32 {
378        match self {
379            Fold::Error => -1,
380            Fold::Min => 0,
381            Fold::Max => 1,
382            Fold::List => 2,
383        }
384    }
385}
386
387impl Fold {
388    /// Constructor based on the i32 values as defined in libisl.
389    pub fn from_i32(val: i32) -> Self {
390        match val {
391            -1 => Fold::Error,
392            0 => Fold::Min,
393            1 => Fold::Max,
394            2 => Fold::List,
395            _ => panic!("Illegal value."),
396        }
397    }
398}
399
400#[derive(Debug, Clone, Copy, PartialEq, Eq)]
401pub enum ScheduleNodeType {
402    Error,
403    Band,
404    Context,
405    Domain,
406    Expansion,
407    Extension,
408    Filter,
409    Leaf,
410    Guard,
411    Mark,
412    Sequence,
413    Set,
414}
415
416impl ScheduleNodeType {
417    /// Returns i32 values as defined in libisl.
418    pub fn to_i32(&self) -> i32 {
419        match self {
420            ScheduleNodeType::Error => -1,
421            ScheduleNodeType::Band => 0,
422            ScheduleNodeType::Context => 1,
423            ScheduleNodeType::Domain => 2,
424            ScheduleNodeType::Expansion => 3,
425            ScheduleNodeType::Extension => 4,
426            ScheduleNodeType::Filter => 5,
427            ScheduleNodeType::Leaf => 6,
428            ScheduleNodeType::Guard => 7,
429            ScheduleNodeType::Mark => 8,
430            ScheduleNodeType::Sequence => 9,
431            ScheduleNodeType::Set => 10,
432        }
433    }
434}
435
436impl ScheduleNodeType {
437    /// Constructor based on the i32 values as defined in libisl.
438    pub fn from_i32(val: i32) -> Self {
439        match val {
440            -1 => ScheduleNodeType::Error,
441            0 => ScheduleNodeType::Band,
442            1 => ScheduleNodeType::Context,
443            2 => ScheduleNodeType::Domain,
444            3 => ScheduleNodeType::Expansion,
445            4 => ScheduleNodeType::Extension,
446            5 => ScheduleNodeType::Filter,
447            6 => ScheduleNodeType::Leaf,
448            7 => ScheduleNodeType::Guard,
449            8 => ScheduleNodeType::Mark,
450            9 => ScheduleNodeType::Sequence,
451            10 => ScheduleNodeType::Set,
452            _ => panic!("Illegal value."),
453        }
454    }
455}
456
457#[derive(Debug, Clone, Copy, PartialEq, Eq)]
458pub enum Stat {
459    Error,
460    Ok,
461}
462
463impl Stat {
464    /// Returns i32 values as defined in libisl.
465    pub fn to_i32(&self) -> i32 {
466        match self {
467            Stat::Error => -1,
468            Stat::Ok => 0,
469        }
470    }
471}
472
473impl Stat {
474    /// Constructor based on the i32 values as defined in libisl.
475    pub fn from_i32(val: i32) -> Self {
476        match val {
477            -1 => Stat::Error,
478            0 => Stat::Ok,
479            _ => panic!("Illegal value."),
480        }
481    }
482}