Cthulhu  0.2.10
Cthulhu compiler collection
decl.c File Reference
#include "common.h"
#include "core/macros.h"
#include "cthulhu/events/events.h"
#include "cthulhu/tree/query.h"
#include "std/vector.h"
#include "memory/memory.h"
#include "arena/arena.h"
#include "base/panic.h"
#include <stdint.h>
#include <stdio.h>
Include dependency graph for decl.c:

Go to the source code of this file.

Macros

#define CHECK_CASE(TY)   CTASSERTF(tree_is(TY, eTreeDeclCase), "expected case, got %s", tree_to_string(TY));
 

Functions

tree_ttree_resolve (tree_cookie_t *cookie, const tree_t *decl)
 
tree_ttree_resolve_type (tree_cookie_t *cookie, const tree_t *decl)
 
tree_ttree_decl_global (const node_t *node, const char *name, tree_storage_t storage, const tree_t *type, tree_t *value)
 
tree_ttree_open_global (const node_t *node, const char *name, const tree_t *type, tree_resolve_info_t resolve)
 
tree_ttree_open_function (const node_t *node, const char *name, const tree_t *signature, tree_resolve_info_t resolve)
 
void tree_close_global (tree_t *self, tree_t *value)
 
void tree_close_function (tree_t *self, tree_t *body)
 
tree_ttree_decl_param (const node_t *node, const char *name, const tree_t *type)
 
tree_ttree_decl_field (const node_t *node, const char *name, const tree_t *type)
 
tree_ttree_decl_local (const node_t *node, const char *name, tree_storage_t storage, const tree_t *type)
 
tree_ttree_decl_case (const node_t *node, const char *name, const tree_t *type, tree_t *expr)
 
tree_ttree_open_decl (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
void tree_close_decl (tree_t *self, const tree_t *other)
 
tree_ttree_decl_function (const node_t *node, const char *name, const tree_t *signature, const vector_t *params, vector_t *locals, tree_t *body)
 
tree_ttree_decl_attrib (const node_t *node, const char *name, vector_t *params)
 
void tree_add_local (tree_t *self, tree_t *decl)
 
void tree_set_attrib (tree_t *self, const tree_attribs_t *attrib)
 
tree_ttree_alias (const tree_t *tree, const char *name)
 
tree_ttree_type_alias (const node_t *node, const char *name, const tree_t *type, tree_quals_t quals)
 
const tree_ttree_follow_type (const tree_t *type)
 
tree_ttree_decl_struct (const node_t *node, const char *name, vector_t *fields)
 
tree_ttree_open_struct (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
void tree_close_struct (tree_t *self, vector_t *fields)
 
tree_ttree_decl_union (const node_t *node, const char *name, vector_t *fields)
 
tree_ttree_open_union (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
void tree_close_union (tree_t *self, vector_t *fields)
 
tree_ttree_decl_enum (const node_t *node, const char *name, const tree_t *underlying, vector_t *fields, tree_t *default_case)
 
tree_ttree_open_enum (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
void tree_close_enum (tree_t *self, const tree_t *underlying, vector_t *cases, tree_t *default_case)
 

Macro Definition Documentation

◆ CHECK_CASE

#define CHECK_CASE (   TY)    CTASSERTF(tree_is(TY, eTreeDeclCase), "expected case, got %s", tree_to_string(TY));

enums

Definition at line 354 of file decl.c.

Function Documentation

◆ tree_decl_attrib()

tree_t* tree_decl_attrib ( const node_t node,
const char *  name,
vector_t params 
)

Definition at line 236 of file decl.c.