cecko
|
Semantic layer of compiler context. More...
#include <cktables.hpp>
Public Member Functions | |
Scope control | |
void | enter_function (CKFunctionObs f, CKFunctionFormalPackArray pack, loc_t loc) |
Signalize entering of the compound statement of the definition of the function f. | |
void | exit_function () |
Signalize exiting of the compound statement of the definition of a function. | |
void | enter_block () |
Signalize entering of a compound statement other than a function definition. | |
void | exit_block () |
Signalize exiting of a compound statement other than a function definition. | |
CKTypeSafeObs | current_function_return_type () |
The return type of the current function. | |
Built-in types | |
CKVoidTypeSafeObs | get_void_type () const |
The built-in "void" type descriptor. | |
CKBoolTypeSafeObs | get_bool_type () const |
The built-in "_Bool" type descriptor. | |
CKCharTypeSafeObs | get_char_type () const |
The built-in "char" type descriptor. | |
CKIntTypeSafeObs | get_int_type () const |
The built-in "int" type descriptor. | |
Creating unnamed types | |
CKPtrTypeSafeObs | get_pointer_type (const CKTypeRefPack &pack) |
A pointer type descriptor. | |
CKArrayTypeSafeObs | get_array_type (CKTypeObs element_type, CKIRConstantIntObs size) |
An array type descriptor. | |
CKFunctionTypeSafeObs | get_function_type (CKTypeObs ret_type, CKTypeObsArray arg_types, bool variadic=false) |
A function type descriptor. | |
Named struct types | |
CKStructTypeSafeObs | declare_struct_type (const CIName &n, loc_t loc) |
Reference or declare a struct type. | |
CKStructTypeSafeObs | define_struct_type_open (const CIName &n, loc_t loc) |
Signalize entering the definition of the struct type named n. | |
void | define_struct_type_close (CKStructTypeObs type, const CKStructItemArray &items) |
Signalize exiting the definition of the struct type type. | |
Named enum types | |
CKEnumTypeSafeObs | declare_enum_type (const CIName &n, loc_t loc) |
Reference or declare an enum type. | |
CKEnumTypeSafeObs | define_enum_type_open (const CIName &n, loc_t loc) |
Signalize entering the definition of the enum type named n. | |
void | define_enum_type_close (CKEnumTypeObs type, CKConstantObsVector items) |
Signalize exiting the definition of the enum type type. | |
Variables | |
void | define_var (const CIName &name, const CKTypeRefPack &type_pack, loc_t loc) |
Define a global or local variable. | |
Typedefs | |
CKTypedefConstSafeObs | define_typedef (const CIName &name, const CKTypeRefPack &type_pack, loc_t loc) |
Define a typedef. | |
Enumeration constants | |
CKConstantConstSafeObs | define_constant (const CIName &name, CKIRConstantIntObs value, loc_t loc) |
Define an enumeration constant. | |
Functions | |
CKFunctionSafeObs | declare_function (const CIName &n, CKTypeObs type, loc_t loc) |
Declare a function (with or without body) | |
Finding named objects | |
CKNamedSafeObs | find (const CIName &n) |
Find a named (constant, variable, or function) object. | |
CKTypedefConstSafeObs | find_typedef (const CIName &n) const |
Find a typedef. | |
Determination of typedefs in lexer | |
bool | is_typedef (const CIName &n) const |
Check whether the name is a typedef (for the lexer) | |
Direct access to LLVM types | |
CKIRTypeObs | get_ir_int64 () |
LLVM representation of C-types "int64_t" and "uint64_t". | |
Representation of integer constants | |
CKIRConstantIntObs | get_int8_constant (std::int_fast32_t v) |
LLVM constant of type "char". | |
CKIRConstantIntObs | get_int32_constant (std::int_fast32_t v) |
LLVM constant of type "int". | |
Basic blocks | |
CKIRBasicBlockObs | create_basic_block (const std::string &name) |
Create a new basic block in the current function. | |
Active code builder | |
CKIRBuilderObs | builder () |
The active builder for the currently open basic block (or inactive) | |
Type properties | |
CKIRConstantIntObs | get_type_size (CKTypeObs type) const |
Size of a type in bytes. | |
Semantic layer of compiler context.