|
hoshi-lang dev
Yet another programming language
|
#include <compilerContext.h>


Public Member Functions | |
| compilerContext ()=default | |
| compilerContext (const compilerContext &context)=default | |
| std::shared_ptr< IRModule > | getImportedModule (yoi::indexT index) |
| std::shared_ptr< yoi::moduleContext > | getModuleContext (yoi::indexT index) |
| get module context by index | |
| std::shared_ptr< IRModule > | getImportedModule (const yoi::wstr &modRealPath) |
| const std::map< yoi::indexT, std::shared_ptr< IRModule > > & | getCompiledModules () const |
| yoi::indexT | getModuleIndexByRealPath (const yoi::wstr &modRealPath) |
| yoi::indexT | compileModule (const yoi::wstr &filepath) |
| const std::shared_ptr< IRObjectFile > & | getIRObjectFile () const |
| void | setIRObjectFile (const std::shared_ptr< IRObjectFile > &irObjectFile) |
| void | initializeSharedObjects () |
| std::shared_ptr< yoi::IRValueType > | getIntObjectType (bool forceRawAttr=false) |
| std::shared_ptr< yoi::IRValueType > | getBoolObjectType (bool forceRawAttr=false) |
| std::shared_ptr< yoi::IRValueType > | getDeciObjectType (bool forceRawAttr=false) |
| std::shared_ptr< yoi::IRValueType > | getStrObjectType (bool forceRawAttr=false) |
| std::shared_ptr< yoi::IRValueType > | getCharObjectType (bool forceRawAttr=false) |
| std::shared_ptr< yoi::IRValueType > | getShortObjectType (bool forceRawAttr=false) |
| std::shared_ptr< yoi::IRValueType > | getUnsignedObjectType (bool forceRawAttr=false) |
| std::shared_ptr< yoi::IRValueType > | getNoneObjectType () |
| std::shared_ptr< yoi::IRValueType > | getForeignInt32ObjectType () |
| std::shared_ptr< yoi::IRValueType > | getForeignFloatObjectType () |
| std::shared_ptr< yoi::IRValueType > | getPointerType () |
| std::shared_ptr< yoi::IRValueType > | getNullInterfaceType () |
| yoi::IRValueType | normalizeForeignBasicType (const std::shared_ptr< yoi::IRValueType > &type, bool handlePointer=true) |
| std::shared_ptr< IRBuildConfig > | getBuildConfig () const |
| void | setBuildConfig (const std::shared_ptr< IRBuildConfig > &buildConfig) |
| std::shared_ptr< IRFFITable > | getIRFFITable () |
| void | runOptimizer () |
| ~compilerContext () | |
Private Attributes | |
| yoi::indexTable< yoi::wstr, std::shared_ptr< yoi::moduleContext > > | modules |
| yoi::indexTable< yoi::wstr, std::shared_ptr< IRValueType > > | sharedValueType |
| std::map< yoi::indexT, std::shared_ptr< IRModule > > | moduleImported |
| std::shared_ptr< IRObjectFile > | irObjectFile |
| std::shared_ptr< IRBuildConfig > | buildConfig |
| std::shared_ptr< IRFFITable > | irFFITable |
| std::shared_ptr< BuiltinModuleBuilder > | builtinModuleBuilder |
| std::set< hoshiModule * > | astToFinalize |
| std::shared_ptr< moduleContext > | builtinModuleContext |
Definition at line 35 of file compilerContext.h.
|
default |
|
default |
| ~compilerContext | ( | ) |
Definition at line 199 of file compilerContext.cpp.
References compilerContext::astToFinalize, and yoi::finalizeAST().

| yoi::indexT compileModule | ( | const yoi::wstr & | filepath | ) |
Definition at line 44 of file compilerContext.cpp.
References yoi::__current_file_path, compilerContext::astToFinalize, compilerContext::buildConfig, indexTable< A, B >::getIndex(), HOSHI_COMPILER_CTX_GLOB_ID_CONST, compilerContext::moduleImported, compilerContext::modules, yoi::parse(), indexTable< A, B >::put(), yoi::realpath(), lexer::scan(), yoi::set_current_file_path(), yoi::string2wstring(), and yoi::wstring2string().

| std::shared_ptr< yoi::IRValueType > getBoolObjectType | ( | bool | forceRawAttr = false | ) |
Definition at line 145 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder, and yoi::managedPtr().

| std::shared_ptr< IRBuildConfig > getBuildConfig | ( | ) | const |
Definition at line 170 of file compilerContext.cpp.
References compilerContext::buildConfig.
| std::shared_ptr< yoi::IRValueType > getCharObjectType | ( | bool | forceRawAttr = false | ) |
Definition at line 157 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder, and yoi::managedPtr().

Get all compiled IR modules.
Definition at line 35 of file compilerContext.cpp.
References compilerContext::moduleImported.
| std::shared_ptr< yoi::IRValueType > getDeciObjectType | ( | bool | forceRawAttr = false | ) |
Definition at line 149 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder, and yoi::managedPtr().
Referenced by compilerContext::normalizeForeignBasicType().


| std::shared_ptr< yoi::IRValueType > getForeignFloatObjectType | ( | ) |
Definition at line 187 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder.
| std::shared_ptr< yoi::IRValueType > getForeignInt32ObjectType | ( | ) |
Definition at line 183 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder.
Get the IRModule by module real path.
| modRealPath | The real path of the module. |
Definition at line 23 of file compilerContext.cpp.
References compilerContext::getModuleIndexByRealPath(), and compilerContext::moduleImported.

| std::shared_ptr< IRModule > getImportedModule | ( | yoi::indexT | index | ) |
Get the IRModule by module name.
| index | The index of the module. |
Definition at line 19 of file compilerContext.cpp.
References compilerContext::moduleImported.
| std::shared_ptr< yoi::IRValueType > getIntObjectType | ( | bool | forceRawAttr = false | ) |
Definition at line 141 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder, and yoi::managedPtr().
Referenced by compilerContext::normalizeForeignBasicType().


| std::shared_ptr< IRFFITable > getIRFFITable | ( | ) |
Definition at line 179 of file compilerContext.cpp.
References compilerContext::irFFITable.
| const std::shared_ptr< IRObjectFile > & getIRObjectFile | ( | ) | const |
Definition at line 118 of file compilerContext.cpp.
References compilerContext::irObjectFile.
| std::shared_ptr< yoi::moduleContext > getModuleContext | ( | yoi::indexT | index | ) |
get module context by index
| index | The index of the module. |
Definition at line 195 of file compilerContext.cpp.
References compilerContext::builtinModuleContext, HOSHI_COMPILER_CTX_GLOB_ID_CONST, and compilerContext::modules.
| yoi::indexT getModuleIndexByRealPath | ( | const yoi::wstr & | modRealPath | ) |
Get the index of the module by module real path.
| modRealPath | The real path of the module. |
| std::runtime_error | if the module is not found. |
Definition at line 40 of file compilerContext.cpp.
References indexTable< A, B >::getIndex(), and compilerContext::modules.
Referenced by compilerContext::getImportedModule().


| std::shared_ptr< yoi::IRValueType > getNoneObjectType | ( | ) |
Definition at line 161 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder.
| std::shared_ptr< yoi::IRValueType > getNullInterfaceType | ( | ) |
Definition at line 191 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder.
| std::shared_ptr< yoi::IRValueType > getPointerType | ( | ) |
Definition at line 211 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder.
| std::shared_ptr< yoi::IRValueType > getShortObjectType | ( | bool | forceRawAttr = false | ) |
Definition at line 230 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder, and yoi::managedPtr().

| std::shared_ptr< yoi::IRValueType > getStrObjectType | ( | bool | forceRawAttr = false | ) |
Definition at line 153 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder, and yoi::managedPtr().

| std::shared_ptr< yoi::IRValueType > getUnsignedObjectType | ( | bool | forceRawAttr = false | ) |
Definition at line 234 of file compilerContext.cpp.
References compilerContext::builtinModuleBuilder, and yoi::managedPtr().
Referenced by compilerContext::normalizeForeignBasicType().


| void initializeSharedObjects | ( | ) |
Definition at line 122 of file compilerContext.cpp.
References __yoi_builtin_module_hoshi, compilerContext::astToFinalize, compilerContext::builtinModuleBuilder, compilerContext::builtinModuleContext, HOSHI_COMPILER_CTX_GLOB_ID_CONST, compilerContext::irFFITable, compilerContext::moduleImported, yoi::parse(), lexer::scan(), and yoi::string2wstring().

| yoi::IRValueType normalizeForeignBasicType | ( | const std::shared_ptr< yoi::IRValueType > & | type, |
| bool | handlePointer = true |
||
| ) |
Definition at line 214 of file compilerContext.cpp.
References IRValueType::foreignFloatType, IRValueType::foreignInt32Type, compilerContext::getDeciObjectType(), compilerContext::getIntObjectType(), compilerContext::getUnsignedObjectType(), and IRValueType::pointer.

| void runOptimizer | ( | ) |
Definition at line 205 of file compilerContext.cpp.
References IROptimizer::buildCallGraph().

| void setBuildConfig | ( | const std::shared_ptr< IRBuildConfig > & | buildConfig | ) |
Definition at line 174 of file compilerContext.cpp.
References compilerContext::buildConfig.
| void setIRObjectFile | ( | const std::shared_ptr< IRObjectFile > & | irObjectFile | ) |
Definition at line 165 of file compilerContext.cpp.
References compilerContext::irObjectFile.
|
private |
Definition at line 44 of file compilerContext.h.
Referenced by compilerContext::compileModule(), compilerContext::initializeSharedObjects(), and compilerContext::~compilerContext().
|
private |
Definition at line 41 of file compilerContext.h.
Referenced by compilerContext::compileModule(), compilerContext::getBuildConfig(), and compilerContext::setBuildConfig().
|
private |
Definition at line 43 of file compilerContext.h.
Referenced by compilerContext::getBoolObjectType(), compilerContext::getCharObjectType(), compilerContext::getDeciObjectType(), compilerContext::getForeignFloatObjectType(), compilerContext::getForeignInt32ObjectType(), compilerContext::getIntObjectType(), compilerContext::getNoneObjectType(), compilerContext::getNullInterfaceType(), compilerContext::getPointerType(), compilerContext::getShortObjectType(), compilerContext::getStrObjectType(), compilerContext::getUnsignedObjectType(), and compilerContext::initializeSharedObjects().
|
private |
Definition at line 45 of file compilerContext.h.
Referenced by compilerContext::getModuleContext(), and compilerContext::initializeSharedObjects().
|
private |
Definition at line 42 of file compilerContext.h.
Referenced by compilerContext::getIRFFITable(), and compilerContext::initializeSharedObjects().
|
private |
Definition at line 40 of file compilerContext.h.
Referenced by compilerContext::getIRObjectFile(), and compilerContext::setIRObjectFile().
|
private |
Definition at line 39 of file compilerContext.h.
Referenced by compilerContext::compileModule(), compilerContext::getCompiledModules(), compilerContext::getImportedModule(), compilerContext::getImportedModule(), and compilerContext::initializeSharedObjects().
|
private |
Definition at line 36 of file compilerContext.h.
Referenced by compilerContext::compileModule(), compilerContext::getModuleContext(), and compilerContext::getModuleIndexByRealPath().
|
private |
Definition at line 37 of file compilerContext.h.