|
Joos1W Compiler Framework
|
Public Member Functions | |
| CompilationUnit (Context &ctx) | |
| CompilationUnit (const CompilationUnit &)=delete | |
| CompilationUnit (CompilationUnit &&)=delete | |
| CompilationUnit & | operator= (const CompilationUnit &)=delete |
| CompilationUnit & | operator= (CompilationUnit &&)=delete |
| Function * | CreateFunction (FunctionType *type, const std::string_view name) |
| Create a new function with the given type and name. More... | |
| GlobalVariable * | CreateGlobalVariable (Type *type, const std::string_view name) |
| Create a new global variable with the given type and name. More... | |
| Function * | findFunction (const std::string_view name) |
| Get the function with the given name. More... | |
| GlobalVariable * | findGlobalVariable (const std::string_view name) |
| Find the global variable with the given name. More... | |
| std::ostream & | print (std::ostream &os) const |
| void | dump () const |
| utils::Generator< Function * > | functions () const |
| Filters through the global objects and yields just the functions. | |
| utils::Generator< GlobalObject * > | global_objects () const |
| Yields all global objects in the compilation unit. | |
| utils::Generator< std::pair< std::string_view, GlobalObject * > > | global_objects_kv () const |
| Yields all global objects in the compilation unit. | |
| auto & | ctx () |
| Get the context associated with this compilation unit. | |
| utils::Generator< GlobalVariable * > | global_variables () const |
| Filters through the global objects and yields just the variables. | |
| void | removeGlobalObject (std::string const &name) |
| Remove the global object with the given name. | |
| Function * | builtinMalloc () |
| Function * | builtinException () |
Definition at line 12 of file CompilationUnit.h.
|
inline |
Create a new function with the given type and name.
| type | The type of the function |
| name | The name of the function |
Definition at line 27 of file CompilationUnit.h.
References findFunction().
|
inline |
Create a new global variable with the given type and name.
| type | |
| name |
Definition at line 42 of file CompilationUnit.h.
References findGlobalVariable().
|
inline |
Get the function with the given name.
| name | The name of the function |
Definition at line 57 of file CompilationUnit.h.
Referenced by CreateFunction().
|
inline |
Find the global variable with the given name.
| name | The name of the global variable |
Definition at line 70 of file CompilationUnit.h.
Referenced by CreateGlobalVariable().