1 using System;
2
3 namespace cmsx.intermediate
4 {
5 public enum Flag
6 {
7 none = 0,
8 verbose = 1 << 0,
9 debug = 1 << 1,
10 stages = 1 << 2
11 }
12
13 public class Flags
14 {
15 static nothrow Flags() : flags(Flag.none), optimizationLevel(0), numLocalRegs(128u)
16 {
17 }
18 public static inline nothrow bool Get(Flag flag)
19 {
20 return cast<Flag>(flags & flag) != Flag.none;
21 }
22 public static inline nothrow void Set(Flag flag)
23 {
24 flags = cast<Flag>(flags | flag);
25 }
26 public static inline nothrow void SetOptimizationLevel(int level)
27 {
28 optimizationLevel = level;
29 }
30 public static inline nothrow int GetOptimizationLevel()
31 {
32 return optimizationLevel;
33 }
34 public static inline nothrow void SetNumLocalRegs(byte numLocalRegs_)
35 {
36 numLocalRegs = numLocalRegs_;
37 }
38 public static inline nothrow byte NumLocalRegs()
39 {
40 return numLocalRegs;
41 }
42 private static Flag flags;
43 private static int optimizationLevel;
44 private static byte numLocalRegs;
45 }
46 }
47