diff options
| author | gingerBill <bill@gingerbill.org> | 2021-05-13 12:48:12 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-05-13 12:48:12 +0100 |
| commit | 63b54ce7c695fb1e204fe77db029cdebf7206b28 (patch) | |
| tree | bcd4b30a071a79a71ef6f8e009fb23bcb047283d /src/parser.hpp | |
| parent | b8a35c658cf30a3f4f46ec40b38cdf478224a371 (diff) | |
Add minor ignoring hint on type assertions to get better code generation with no optimizations enabled
Diffstat (limited to 'src/parser.hpp')
| -rw-r--r-- | src/parser.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parser.hpp b/src/parser.hpp index 982588c0f..b6bf42f63 100644 --- a/src/parser.hpp +++ b/src/parser.hpp @@ -345,7 +345,13 @@ AST_KIND(_ExprBegin, "", bool) \ AST_KIND(FieldValue, "field value", struct { Token eq; Ast *field, *value; }) \ AST_KIND(TernaryIfExpr, "ternary if expression", struct { Ast *x, *cond, *y; }) \ AST_KIND(TernaryWhenExpr, "ternary when expression", struct { Ast *x, *cond, *y; }) \ - AST_KIND(TypeAssertion, "type assertion", struct { Ast *expr; Token dot; Ast *type; Type *type_hint; }) \ + AST_KIND(TypeAssertion, "type assertion", struct { \ + Ast *expr; \ + Token dot; \ + Ast *type; \ + Type *type_hint; \ + bool ignores[2]; \ + }) \ AST_KIND(TypeCast, "type cast", struct { Token token; Ast *type, *expr; }) \ AST_KIND(AutoCast, "auto_cast", struct { Token token; Ast *expr; }) \ AST_KIND(InlineAsmExpr, "inline asm expression", struct { \ |