Cthulhu  0.2.10
Cthulhu compiler collection
broker.h File Reference
#include <ctu_broker_api.h>
#include "arena/arena.h"
#include "core/compiler.h"
#include "core/text.h"
#include "core/version_def.h"
#include "notify/diagnostic.h"
#include <stdint.h>
#include "broker.inc"
Include dependency graph for broker.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  module_info_t
 common information about anything the broker supports More...
 
struct  language_info_t
 
struct  language_t
 a language driver support capabilities More...
 
struct  plugin_event_t
 a plugin event callback description More...
 
struct  event_list_t
 
struct  plugin_t
 plugin support capabilities More...
 
struct  emit_result_t
 
struct  target_t
 a codegen target backend More...
 
struct  frontend_t
 the frontend running the mediator More...
 
struct  language_runtime_t
 
struct  compile_unit_t
 
struct  plugin_runtime_t
 
struct  target_runtime_t
 
struct  target_emit_t
 

Macros

#define CT_LANG_EXTS(...)   { __VA_ARGS__, NULL }
 
#define BROKER_PASS(ID, STR)   ID,
 
#define BROKER_STAGE(ID, STR)   ID,
 
#define BROKER_EVENT(ID, STR)   ID,
 
#define BROKER_ARENA(ID, STR)   ID,
 
#define FILE_LAYOUT(ID, STR)   ID,
 

Typedefs

typedef text_view_t unit_id_t
 the name of a module to represent the name java.lang use `CT_TEXT_VIEW("java\0lang") More...
 
typedef void(* language_pass_t) (language_runtime_t *runtime, compile_unit_t *unit)
 a language compilation pass More...
 
typedef void(* language_create_t) (language_runtime_t *runtime, tree_t *root)
 initialize the root module More...
 
typedef void(* language_destroy_t) (language_runtime_t *runtime)
 
typedef void(* language_preparse_t) (language_runtime_t *runtime, void *context)
 
typedef void(* language_postparse_t) (language_runtime_t *runtime, scan_t *scan, void *ast)
 
typedef char *(* lang_repr_tree_t) (tree_t *tree, arena_t *arena)
 convert a tree node to a string More...
 
typedef void(* plugin_create_t) (plugin_runtime_t *runtime)
 
typedef void(* plugin_destroy_t) (plugin_runtime_t *runtime)
 
typedef void(* target_create_t) (target_runtime_t *runtime)
 
typedef void(* target_destroy_t) (target_runtime_t *runtime)
 
typedef void(* target_tree_t) (target_runtime_t *runtime, const tree_t *tree, target_emit_t *emit)
 tree output generation More...
 
typedef emit_result_t(* target_ssa_t) (target_runtime_t *runtime, const ssa_result_t *ssa, target_emit_t *emit)
 ssa output generation More...
 

Enumerations

enum  broker_pass_t { ePassCount }
 
enum  broker_stage_t { eStageCount }
 stages of compilation More...
 
enum  broker_event_t { eEventCount }
 plugin events generated by the broker More...
 
enum  broker_arena_t { eArenaCount }
 
enum  file_layout_t { eFileLayoutCount , eFileLayoutCount }
 output folder structure More...
 

Functions

CT_BROKER_API broker_tbroker_new (const frontend_t *frontend, arena_t *arena)
 
CT_BROKER_API language_runtime_tbroker_add_language (broker_t *broker, const language_t *lang)
 
CT_BROKER_API plugin_runtime_tbroker_add_plugin (broker_t *broker, const plugin_t *plugin)
 
CT_BROKER_API target_runtime_tbroker_add_target (broker_t *broker, const target_t *target)
 
CT_BROKER_API void broker_init (broker_t *broker)
 
CT_BROKER_API void broker_deinit (broker_t *broker)
 
CT_BROKER_API compile_unit_tbroker_get_unit (broker_t *broker, unit_id_t id)
 
CT_BROKER_API void broker_parse (language_runtime_t *runtime, io_t *io)
 
CT_BROKER_API void broker_run_pass (broker_t *broker, broker_pass_t pass)
 
CT_BROKER_API void broker_resolve (broker_t *broker)
 
CT_BROKER_API logger_tbroker_get_logger (broker_t *broker)
 
CT_BROKER_API const node_tbroker_get_node (broker_t *broker)
 
CT_BROKER_API arena_tbroker_get_arena (broker_t *broker)
 
CT_BROKER_API vector_tbroker_get_modules (broker_t *broker)
 get all the modules in the broker this does not include the root module More...
 
CT_BROKER_API void lang_add_unit (language_runtime_t *runtime, unit_id_t id, const node_t *node, void *ast, const size_t *sizes, size_t count)
 all runtime apis More...
 
CT_BROKER_API compile_unit_tlang_get_unit (language_runtime_t *runtime, unit_id_t id)
 
CT_BROKER_API void unit_update (compile_unit_t *unit, void *ast, tree_t *tree)
 
CT_BROKER_API void * unit_get_ast (compile_unit_t *unit)
 
CT_BROKER_API text_view_t build_unit_id (const vector_t *parts, arena_t *arena)
 
CT_BROKER_API void target_emit_tree (target_runtime_t *runtime, const tree_t *tree, target_emit_t *emit)
 all plugin apis More...
 
CT_BROKER_API emit_result_t target_emit_ssa (target_runtime_t *runtime, const ssa_result_t *ssa, target_emit_t *emit)
 
CT_CONSTFN CT_BROKER_API const char * broker_pass_name (broker_pass_t pass)
 extra stuff More...
 
CT_CONSTFN CT_CONSTFN CT_BROKER_API const char * file_layout_name (file_layout_t layout)
 

Macro Definition Documentation

◆ BROKER_ARENA

#define BROKER_ARENA (   ID,
  STR 
)    ID,

Definition at line 83 of file broker.h.

◆ BROKER_EVENT

#define BROKER_EVENT (   ID,
  STR 
)    ID,

Definition at line 75 of file broker.h.

◆ BROKER_PASS

#define BROKER_PASS (   ID,
  STR 
)    ID,

Definition at line 57 of file broker.h.

◆ BROKER_STAGE

#define BROKER_STAGE (   ID,
  STR 
)    ID,

Definition at line 66 of file broker.h.

◆ FILE_LAYOUT

#define FILE_LAYOUT (   ID,
  STR 
)    ID,

Definition at line 92 of file broker.h.