Changes in src/AST/LinkageSpec.hpp [2bb4a01:a300e4a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/LinkageSpec.hpp
r2bb4a01 ra300e4a 23 23 namespace ast { 24 24 25 25 namespace Linkage { 26 26 27 /// Bitflags for linkage specifiers 28 enum { 29 Mangle = 1 << 0, 30 Generate = 1 << 1, 31 Overrideable = 1 << 2, 32 Builtin = 1 << 3, 33 GccBuiltin = 1 << 4 27 /// Bitflags for linkage specifiers 28 enum { 29 Mangle = 1 << 0, 30 Generate = 1 << 1, 31 Overrideable = 1 << 2, 32 Builtin = 1 << 3, 33 GccBuiltin = 1 << 4 34 }; 35 36 /// Bitflag type for storage classes 37 union Spec { 38 unsigned int val; 39 struct { 40 bool is_mangled : 1; 41 bool is_generatable : 1; 42 bool is_overrideable : 1; 43 bool is_builtin : 1; 44 bool is_gcc_builtin : 1; 34 45 }; 35 46 36 /// Bitflag type for storage classes 37 union Spec { 38 unsigned int val; 39 struct { 40 bool is_mangled : 1; 41 bool is_generatable : 1; 42 bool is_overrideable : 1; 43 bool is_builtin : 1; 44 bool is_gcc_builtin : 1; 45 }; 47 MakeBitfield( Spec ) 48 }; 46 49 47 MakeBitfield( Spec ) 48 }; 50 /// If `cmd` = "C" returns `spec` with `is_mangled = false`. 51 /// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`. 52 Spec update( CodeLocation loc, Spec spec, const std::string * cmd ); 49 53 50 /// If `cmd` = "C" returns `spec` with `is_mangled = false`. 51 /// If `cmd` = "Cforall" returns `spec` with `is_mangled = true`. 52 Spec update( CodeLocation loc, Spec spec, const std::string * cmd ); 54 /// A human-readable name for this spec 55 std::string name( Spec spec ); 53 56 54 /// A human-readable name for this spec 55 std::string name( Spec spec ); 57 // Pre-defined flag combinations 58 59 /// C built-in defined in prelude 60 constexpr Spec Intrinsic = { Mangle | Generate | Overrideable | Builtin }; 61 /// Ordinary Cforall 62 constexpr Spec Cforall = { Mangle | Generate }; 63 /// C code: not overloadable, not mangled 64 constexpr Spec C = { Generate }; 65 /// Built by translator (e.g. struct assignment) 66 constexpr Spec AutoGen = { Mangle | Generate | Overrideable }; 67 /// GCC internal 68 constexpr Spec Compiler = { Mangle | Builtin | GccBuiltin }; 69 /// Mangled builtins 70 constexpr Spec BuiltinCFA = { Mangle | Generate | Builtin }; 71 /// Non-mangled builtins 72 constexpr Spec BuiltinC = { Generate | Builtin }; 73 } 56 74 57 // Pre-defined flag combinations58 59 /// C built-in defined in prelude60 constexpr Spec Intrinsic = { Mangle | Generate | Overrideable | Builtin };61 /// Ordinary Cforall62 constexpr Spec Cforall = { Mangle | Generate };63 /// C code: not overloadable, not mangled64 constexpr Spec C = { Generate };65 /// Built by translator (e.g. struct assignment)66 constexpr Spec AutoGen = { Mangle | Generate | Overrideable };67 /// GCC internal68 constexpr Spec Compiler = { Mangle | Builtin | GccBuiltin };69 /// Mangled builtins70 constexpr Spec BuiltinCFA = { Mangle | Generate | Builtin };71 /// Non-mangled builtins72 constexpr Spec BuiltinC = { Generate | Builtin };73 }74 75 } 75 76
Note: See TracChangeset
for help on using the changeset viewer.