From c1bea102df3f2907f345b89ff0f66f5055ac4767 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 18 Aug 2019 06:25:52 +0200 Subject: Add extern funcs, parameter registers, fix asm_rm RSP bug --- include/ast.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/ast.h') diff --git a/include/ast.h b/include/ast.h index 1198a98..bdab6c3 100644 --- a/include/ast.h +++ b/include/ast.h @@ -20,7 +20,6 @@ typedef struct Ast Ast; typedef struct FunctionParameter FunctionParameter; -typedef struct FunctionSignature FunctionSignature; typedef struct FunctionCall FunctionCall; typedef struct StructDecl StructDecl; typedef struct StructField StructField; @@ -87,6 +86,7 @@ typedef enum { typedef struct { union { + void *data; LhsExpr *lhs_expr; FunctionSignature *func_sig; } value; @@ -107,6 +107,7 @@ typedef enum { typedef struct { union { + void *data; LhsExpr *lhs_expr; FunctionParameter *func_param; } value; @@ -218,6 +219,7 @@ struct LhsExpr { BufferView var_name; VariableType type; nullable Ast *rhs_expr; + u16 extern_index; /* Index to extern func, extern variable, etc; if applicable */ }; #define LHS_EXPR_IS_EXTERN(expr) ((expr)->decl_flags & DECL_FLAG_EXTERN) @@ -297,6 +299,8 @@ CHECK_RESULT int function_signature_init(FunctionSignature *self, ArenaAllocator CHECK_RESULT int function_signature_add_parameter(FunctionSignature *self, const FunctionParameter *param); /* Adds a copy of @return_type to the function signature return type list */ CHECK_RESULT int function_signature_add_return_type(FunctionSignature *self, const VariableType *return_type); +CHECK_RESULT bool function_signature_equals(FunctionSignature *self, FunctionSignature *other); + void function_parameter_init(FunctionParameter *self); CHECK_RESULT int funcdecl_init(FunctionDecl *self, FunctionSignature *signature, Scope *parent, ArenaAllocator *allocator); CHECK_RESULT int funccall_init(FunctionCall *self, BufferView name, ArenaAllocator *allocator); -- cgit v1.2.3