Browse Source

`enum Addressing_Mode : u8;`

gingerBill 4 years ago
parent
commit
3930a32b0c
2 changed files with 4 additions and 3 deletions
  1. 2 2
      src/checker.hpp
  2. 2 1
      src/parser.hpp

+ 2 - 2
src/checker.hpp

@@ -9,15 +9,15 @@ struct Checker;
 struct CheckerInfo;
 struct CheckerContext;
 
-enum AddressingMode;
+enum AddressingMode : u8;
 struct TypeAndValue;
 
 // ExprInfo stores information used for "untyped" expressions
 struct ExprInfo {
 	AddressingMode mode;
+	bool is_lhs; // Debug info
 	Type *         type;
 	ExactValue     value;
-	bool is_lhs; // Debug info
 };
 
 gb_inline ExprInfo *make_expr_info(AddressingMode mode, Type *type, ExactValue const &value, bool is_lhs) {

+ 2 - 1
src/parser.hpp

@@ -6,7 +6,7 @@ struct DeclInfo;
 struct AstFile;
 struct AstPackage;
 
-enum AddressingMode {
+enum AddressingMode : u8 {
 	Addressing_Invalid   = 0,        // invalid addressing mode
 	Addressing_NoValue   = 1,        // no value (void in C)
 	Addressing_Value     = 2,        // computed value (rvalue)
@@ -29,6 +29,7 @@ enum AddressingMode {
 
 struct TypeAndValue {
 	AddressingMode mode;
+	bool           is_lhs; // Debug info
 	Type *         type;
 	ExactValue     value;
 };