hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
LLVMCodegen Class Reference

#include <llvmCodegenContext.hpp>

Collaboration diagram for LLVMCodegen:

Classes

struct  ControlFlowAnalysis
 
class  LLVMModuleContext
 
struct  StackValue
 Stack Value struct exposed to original code base for compatibility. More...
 
struct  ValueStackWithPhi
 

Public Member Functions

 LLVMCodegen (std::shared_ptr< compilerContext > compilerCtx, const std::shared_ptr< IRModule > &yoiModule)
 
yoi::vec< yoi::wstrgenerate ()
 
void dumpIR (const yoi::wstr &modulePath, const std::string &filename)
 

Private Member Functions

void generate (LLVMModuleContext &llvmModCtx)
 
llvm::Module * getModule (LLVMModuleContext &llvmModCtx)
 
void declareRuntimeFunctions (LLVMModuleContext &llvmModCtx)
 
void generateRuntimeFunctionImplementations (LLVMModuleContext &llvmModCtx)
 
void generateBasicTypeDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateBasicTypeImplementations (LLVMModuleContext &llvmModCtx)
 
void generateDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateStructShallowDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateDataStructShallowDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateGlobalDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateGlobalInitializers (LLVMModuleContext &llvmModCtx)
 
void generateFunctionDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateImportFunctionDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateImplementations (LLVMModuleContext &llvmModCtx)
 
void generateStructDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateDataStructDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateStructGCFunctionDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateStructGCFunctionImplementations (LLVMModuleContext &llvmModCtx)
 
void generateInterfaceObjectGCFunctionDeclarations (LLVMModuleContext &llvmModCtx)
 
void generateInterfaceObjectGCFunctionImplementations (LLVMModuleContext &llvmModCtx)
 
void generateForeignStructTypes (LLVMModuleContext &llvmModCtx)
 
void generateExportFunctionDecls (LLVMModuleContext &llvmModCtx)
 
void generateImportFunctionImplementations (LLVMModuleContext &llvmModCtx)
 
void generateMainFunction (LLVMModuleContext &llvmModCtx)
 
void generateWrapperForForeignCallablesIfNotExists (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type)
 
void generateFunctionImplementations (LLVMModuleContext &llvmModCtx)
 
void generateFunction (LLVMModuleContext &llvmModCtx, IRFunctionDefinition &funcDef)
 
void generateFunctionExitCleanup (LLVMModuleContext &llvmModCtx)
 
void generateCodeBlock (LLVMModuleContext &llvmModCtx, IRCodeBlock &block, yoi::indexT fromBlock, yoi::indexT toBlock, llvm::BasicBlock *actualFromBlock=nullptr)
 
void generateInstruction (LLVMModuleContext &llvmModCtx, const IR &instr, yoi::indexT fromBlock, yoi::indexT toBlock)
 
void generateDescription (LLVMModuleContext &llvmModCtx)
 
void generateRTTIDeclaration (LLVMModuleContext &llvmModCtx)
 
void generateRTTIImplmentation (LLVMModuleContext &llvmModCtx)
 
void generateGeneratorContextInitialization (LLVMModuleContext &llvmModCtx)
 
llvm::Value * createGeneratorContext (LLVMModuleContext &llvmModCtx, llvm::Value *coro_handle)
 
void storeYieldValue (LLVMModuleContext &llvmModCtx, llvm::Value *value, const std::shared_ptr< IRValueType > &yoiType)
 
void storeMember (LLVMModuleContext &llvmModCtx, const StackValue &storeValue, const StackValue &structVal, yoi::indexT memberIndex)
 
llvm::Value * createStructObject (LLVMModuleContext &llvmModCtx, yoi::indexT moduleIndex, yoi::indexT structIndex)
 
llvm::Function * getLLVMCoroIntrinsic (LLVMModuleContext &llvmModCtx, llvm::Intrinsic::ID Id, llvm::ArrayRef< llvm::Type * > Types={})
 
llvm::Value * loadIfDataStructObject (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, llvm::Value *value)
 
std::shared_ptr< IRValueTypenormalizeForeignType (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type)
 
llvm::Type * yoiTypeToLLVMType (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, bool enforceForeignType=false)
 
llvm::Type * getArrayLLVMType (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, bool enforceForeignType=false)
 
llvm::Type * getDynamicArrayLLVMType (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, bool enforceForeignType=false)
 
void generateArrayGCFunctionDeclarations (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, llvm::StructType *structType, llvm::Type *baseType)
 
llvm::FunctionType * getFunctionType (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRFunctionDefinition > &funcDef)
 
llvm::Constant * getGlobalInitializer (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type)
 
void handleBinaryOp (LLVMModuleContext &llvmModCtx, llvm::Instruction::BinaryOps op, bool isFloat, yoi::indexT fromBlock, yoi::indexT toBlock)
 
void handleComparison (LLVMModuleContext &llvmModCtx, llvm::CmpInst::Predicate pred, bool isFloat, yoi::indexT fromBlock, yoi::indexT toBlock)
 
llvm::Value * createBasicObject (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &yoiType, llvm::Value *rawValue)
 
llvm::Value * unboxValue (LLVMModuleContext &llvmModCtx, llvm::Value *objectPtr, const std::shared_ptr< IRValueType > &yoiType)
 
llvm::Value * loadArrayElement (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, llvm::Value *arrayPtr, llvm::Value *index)
 
llvm::Function * getGcFunction (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &yoiType, bool isIncrease)
 
void callGcFunction (LLVMModuleContext &llvmModCtx, llvm::Value *objectPtr, const std::shared_ptr< IRValueType > &yoiType, bool isIncrease, bool forceForPermanent=false, bool forceForBorrow=false)
 
llvm::Value * handleForeignTypeConv (LLVMModuleContext &llvmModCtx, llvm::Value *val, yoi::indexT foreignTypeIndex, yoi::indexT isArray, bool convertToForeign=false)
 
llvm::Value * handleForeignTypeConv (LLVMModuleContext &llvmModCtx, llvm::Value *val, const std::shared_ptr< IRValueType > &foreignType, bool convertToForeign=false)
 
llvm::Value * createArrayObject (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, const yoi::vec< StackValue > &elements)
 
llvm::DIType * getDIType (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type)
 
llvm::Value * createDynamicArrayObject (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, const yoi::vec< StackValue > &elements, llvm::Value *size)
 
void storeArrayElement (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, const std::shared_ptr< IRValueType > &valueToStoreType, llvm::Value *arrayPtr, llvm::Value *index, llvm::Value *value)
 
void generateArrayGCFunctionImplementations (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, llvm::StructType *structType, llvm::Type *baseType)
 
std::pair< std::shared_ptr< IRValueType >, llvm::Value * > ensureObject (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, llvm::Value *val)
 
void generateIfTargetNotNull (LLVMModuleContext &llvmModCtx, llvm::Value *objectPtr, const std::shared_ptr< IRValueType > &yoiType, const std::function< void()> &func, bool enforced=false)
 
StackValue actualizeInterfaceObject (LLVMModuleContext &llvmModCtx, const std::shared_ptr< IRValueType > &type, llvm::Value *objectPtr, yoi::indexT implIndex)
 
StackValue wrapInterfaceObjectIfRegressed (LLVMModuleContext &llvmModCtx, const StackValue &objectVal)
 
llvm::Value * unwrapInterfaceObject (LLVMModuleContext &llvmModCtx, const StackValue &objectVal)
 
StackValue promiseInterfaceObjectIfInterface (LLVMModuleContext &llvmModCtx, const StackValue &objectVal)
 
void handleIntrinsicCall (LLVMModuleContext &llvmModCtx, const IR &instr)
 
LLVMModuleContextgetLLVMModuleContext (const yoi::wstr &absolutePath)
 
void generateTargetObjectCode (LLVMModuleContext &llvmModCtx, const yoi::wstr &pathToOutput)
 

Private Attributes

CodegenObjectCache codegenObjectCache
 
CodegenTaskDispatcher codegenTaskDispatcher
 
std::shared_ptr< compilerContextcompilerCtx
 
std::shared_ptr< IRModuleyoiModule
 
std::mutex contextMutex
 
std::map< yoi::wstr, std::unique_ptr< LLVMModuleContext > > llvmModuleContext
 
bool is_rtti_table_frozen = false
 

Detailed Description

Definition at line 37 of file llvmCodegenContext.hpp.

Constructor & Destructor Documentation

◆ LLVMCodegen()

LLVMCodegen ( std::shared_ptr< compilerContext compilerCtx,
const std::shared_ptr< IRModule > &  yoiModule 
)

Member Function Documentation

◆ actualizeInterfaceObject()

◆ callGcFunction()

void callGcFunction ( LLVMModuleContext llvmModCtx,
llvm::Value *  objectPtr,
const std::shared_ptr< IRValueType > &  yoiType,
bool  isIncrease,
bool  forceForPermanent = false,
bool  forceForBorrow = false 
)
private

◆ createArrayObject()

llvm::Value * createArrayObject ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
const yoi::vec< StackValue > &  elements 
)
private

◆ createBasicObject()

◆ createDynamicArrayObject()

llvm::Value * createDynamicArrayObject ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
const yoi::vec< StackValue > &  elements,
llvm::Value *  size 
)
private

◆ createGeneratorContext()

◆ createStructObject()

◆ declareRuntimeFunctions()

◆ dumpIR()

void dumpIR ( const yoi::wstr modulePath,
const std::string &  filename 
)

Definition at line 4564 of file llvmCodegenContext.cpp.

References LLVMCodegen::llvmModuleContext.

Referenced by LLVMCodegen::generate(), and main().

Here is the caller graph for this function:

◆ ensureObject()

std::pair< std::shared_ptr< IRValueType >, llvm::Value * > ensureObject ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
llvm::Value *  val 
)
private

Definition at line 4102 of file llvmCodegenContext.cpp.

References yoi::managedPtr().

Referenced by LLVMCodegen::actualizeInterfaceObject(), and LLVMCodegen::storeMember().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate() [1/2]

◆ generate() [2/2]

◆ generateArrayGCFunctionDeclarations()

void generateArrayGCFunctionDeclarations ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
llvm::StructType *  structType,
llvm::Type *  baseType 
)
private

◆ generateArrayGCFunctionImplementations()

void generateArrayGCFunctionImplementations ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
llvm::StructType *  structType,
llvm::Type *  baseType 
)
private

◆ generateBasicTypeDeclarations()

◆ generateBasicTypeImplementations()

◆ generateCodeBlock()

◆ generateDataStructDeclarations()

void generateDataStructDeclarations ( LLVMModuleContext llvmModCtx)
private

◆ generateDataStructShallowDeclarations()

◆ generateDeclarations()

◆ generateDescription()

void generateDescription ( LLVMModuleContext llvmModCtx)
private

Definition at line 2608 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::TheContext, LLVMCodegen::LLVMModuleContext::TheModule, and yoi::wstring2string().

Referenced by LLVMCodegen::generate(), and LLVMCodegen::generate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateExportFunctionDecls()

void generateExportFunctionDecls ( LLVMModuleContext llvmModCtx)
private

◆ generateForeignStructTypes()

void generateForeignStructTypes ( LLVMModuleContext llvmModCtx)
private

Definition at line 2695 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::foreignTypeMap, LLVMCodegen::LLVMModuleContext::TheContext, and yoi::wstring2string().

Referenced by LLVMCodegen::generate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateFunction()

◆ generateFunctionDeclarations()

void generateFunctionDeclarations ( LLVMModuleContext llvmModCtx)
private

◆ generateFunctionExitCleanup()

void generateFunctionExitCleanup ( LLVMModuleContext llvmModCtx)
private

◆ generateFunctionImplementations()

void generateFunctionImplementations ( LLVMModuleContext llvmModCtx)
private

Definition at line 664 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::absolute_path, and LLVMCodegen::LLVMModuleContext::currentFunctionDef.

Referenced by LLVMCodegen::generateImplementations().

Here is the caller graph for this function:

◆ generateGeneratorContextInitialization()

◆ generateGlobalDeclarations()

void generateGlobalDeclarations ( LLVMModuleContext llvmModCtx)
private

Definition at line 361 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::globalValues, LLVMCodegen::LLVMModuleContext::TheModule, yoi::wstring2string(), LLVMCodegen::yoiModule, and LLVMCodegen::yoiTypeToLLVMType().

Referenced by LLVMCodegen::generateDeclarations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateGlobalInitializers()

void generateGlobalInitializers ( LLVMModuleContext llvmModCtx)
private

◆ generateIfTargetNotNull()

void generateIfTargetNotNull ( LLVMModuleContext llvmModCtx,
llvm::Value *  objectPtr,
const std::shared_ptr< IRValueType > &  yoiType,
const std::function< void()> &  func,
bool  enforced = false 
)
private

Definition at line 4112 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::Builder, and LLVMCodegen::LLVMModuleContext::TheContext.

Referenced by LLVMCodegen::callGcFunction().

Here is the caller graph for this function:

◆ generateImplementations()

◆ generateImportFunctionDeclarations()

void generateImportFunctionDeclarations ( LLVMModuleContext llvmModCtx)
private

Definition at line 3031 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::functionMap, LLVMCodegen::LLVMModuleContext::TheModule, and yoi::wstring2string().

Referenced by LLVMCodegen::generateDeclarations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateImportFunctionImplementations()

void generateImportFunctionImplementations ( LLVMModuleContext llvmModCtx)
private

◆ generateInstruction()

void generateInstruction ( LLVMModuleContext llvmModCtx,
const IR instr,
yoi::indexT  fromBlock,
yoi::indexT  toBlock 
)
private

Definition at line 902 of file llvmCodegenContext.cpp.

References IRValueType::addAttribute(), LLVMCodegen::LLVMModuleContext::arrayTypeMap, LLVMCodegen::ValueStackWithPhi::back(), LLVMCodegen::LLVMModuleContext::basicBlockMap, LLVMCodegen::LLVMModuleContext::Builder, LLVMCodegen::LLVMModuleContext::cleanupBB, IRDebugInfo::column, LLVMCodegen::LLVMModuleContext::currentFunction, LLVMCodegen::LLVMModuleContext::currentFunctionDef, LLVMCodegen::LLVMModuleContext::currentGeneratorContextBasicBlocks, LLVMCodegen::LLVMModuleContext::dataStructDataRegionMap, IR::debugInfo, LLVMCodegen::ValueStackWithPhi::empty(), ENTRY_MODULE_ID_CONST, magic_enum::enum_name(), LLVMCodegen::LLVMModuleContext::functionMap, LLVMCodegen::LLVMModuleContext::globalValues, IRDebugInfo::line, LLVMCodegen::StackValue::llvmValue, yoi::managedPtr(), LLVMCodegen::LLVMModuleContext::namedValues, IR::opcode, IR::operands, yoi::panic(), LLVMCodegen::ValueStackWithPhi::pop_back(), LLVMCodegen::ValueStackWithPhi::push_back(), LLVMCodegen::LLVMModuleContext::runtimeFunctions, yoi::set_current_file_path(), LLVMCodegen::ValueStackWithPhi::size(), IRDebugInfo::sourceFile, LLVMCodegen::LLVMModuleContext::structTypeMap, LLVMCodegen::LLVMModuleContext::suspendBB, LLVMCodegen::LLVMModuleContext::TheContext, LLVMCodegen::LLVMModuleContext::TheModule, IR::to_string(), LLVMCodegen::LLVMModuleContext::typeIDMap, LLVMCodegen::LLVMModuleContext::valueStackPhi, yoi::wstring2string(), yoi::yoi_assert(), and LLVMCodegen::StackValue::yoiType.

Here is the call graph for this function:

◆ generateInterfaceObjectGCFunctionDeclarations()

void generateInterfaceObjectGCFunctionDeclarations ( LLVMModuleContext llvmModCtx)
private

◆ generateInterfaceObjectGCFunctionImplementations()

void generateInterfaceObjectGCFunctionImplementations ( LLVMModuleContext llvmModCtx)
private

◆ generateMainFunction()

◆ generateRTTIDeclaration()

void generateRTTIDeclaration ( LLVMModuleContext llvmModCtx)
private

◆ generateRTTIImplmentation()

void generateRTTIImplmentation ( LLVMModuleContext llvmModCtx)
private

◆ generateRuntimeFunctionImplementations()

void generateRuntimeFunctionImplementations ( LLVMModuleContext llvmModCtx)
private

◆ generateStructDeclarations()

◆ generateStructGCFunctionDeclarations()

◆ generateStructGCFunctionImplementations()

◆ generateStructShallowDeclarations()

void generateStructShallowDeclarations ( LLVMModuleContext llvmModCtx)
private

◆ generateTargetObjectCode()

void generateTargetObjectCode ( LLVMModuleContext llvmModCtx,
const yoi::wstr pathToOutput 
)
private

Definition at line 2621 of file llvmCodegenContext.cpp.

References yoi::panic(), LLVMCodegen::LLVMModuleContext::TheModule, and yoi::wstring2string().

Referenced by LLVMCodegen::generate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateWrapperForForeignCallablesIfNotExists()

void generateWrapperForForeignCallablesIfNotExists ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type 
)
private

Definition at line 4397 of file llvmCodegenContext.cpp.

◆ getArrayLLVMType()

llvm::Type * getArrayLLVMType ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
bool  enforceForeignType = false 
)
private

◆ getDIType()

◆ getDynamicArrayLLVMType()

llvm::Type * getDynamicArrayLLVMType ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
bool  enforceForeignType = false 
)
private

◆ getFunctionType()

llvm::FunctionType * getFunctionType ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRFunctionDefinition > &  funcDef 
)
private

Definition at line 2403 of file llvmCodegenContext.cpp.

Referenced by LLVMCodegen::generateFunctionDeclarations(), and LLVMCodegen::generateStructDeclarations().

Here is the caller graph for this function:

◆ getGcFunction()

llvm::Function * getGcFunction ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  yoiType,
bool  isIncrease 
)
private

Definition at line 2566 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::functionMap, yoi::managedPtr(), yoi::string2wstring(), and yoi::wstring2string().

Referenced by LLVMCodegen::actualizeInterfaceObject(), and LLVMCodegen::callGcFunction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGlobalInitializer()

llvm::Constant * getGlobalInitializer ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type 
)
private

Definition at line 2413 of file llvmCodegenContext.cpp.

◆ getLLVMCoroIntrinsic()

llvm::Function * getLLVMCoroIntrinsic ( LLVMModuleContext llvmModCtx,
llvm::Intrinsic::ID  Id,
llvm::ArrayRef< llvm::Type * >  Types = {} 
)
private

Definition at line 4709 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::TheModule.

Referenced by LLVMCodegen::generateGeneratorContextInitialization().

Here is the caller graph for this function:

◆ getLLVMModuleContext()

LLVMCodegen::LLVMModuleContext & getLLVMModuleContext ( const yoi::wstr absolutePath)
private

Definition at line 4425 of file llvmCodegenContext.cpp.

References LLVMCodegen::llvmModuleContext.

◆ getModule()

llvm::Module * getModule ( LLVMModuleContext llvmModCtx)
private

Definition at line 183 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::TheModule.

◆ handleBinaryOp()

void handleBinaryOp ( LLVMModuleContext llvmModCtx,
llvm::Instruction::BinaryOps  op,
bool  isFloat,
yoi::indexT  fromBlock,
yoi::indexT  toBlock 
)
private

◆ handleComparison()

void handleComparison ( LLVMModuleContext llvmModCtx,
llvm::CmpInst::Predicate  pred,
bool  isFloat,
yoi::indexT  fromBlock,
yoi::indexT  toBlock 
)
private

◆ handleForeignTypeConv() [1/2]

llvm::Value * handleForeignTypeConv ( LLVMModuleContext llvmModCtx,
llvm::Value *  val,
const std::shared_ptr< IRValueType > &  foreignType,
bool  convertToForeign = false 
)
private

Definition at line 3099 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::Builder, LLVMCodegen::LLVMModuleContext::TheContext, and yoi::yoi_assert().

Here is the call graph for this function:

◆ handleForeignTypeConv() [2/2]

llvm::Value * handleForeignTypeConv ( LLVMModuleContext llvmModCtx,
llvm::Value *  val,
yoi::indexT  foreignTypeIndex,
yoi::indexT  isArray,
bool  convertToForeign = false 
)
private

◆ handleIntrinsicCall()

◆ loadArrayElement()

llvm::Value * loadArrayElement ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
llvm::Value *  arrayPtr,
llvm::Value *  index 
)
private

Definition at line 3279 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::Builder, magic_enum::enum_name(), yoi::managedPtr(), yoi::panic(), and yoi::yoi_assert().

Here is the call graph for this function:

◆ loadIfDataStructObject()

llvm::Value * loadIfDataStructObject ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
llvm::Value *  value 
)
private

◆ normalizeForeignType()

std::shared_ptr< IRValueType > normalizeForeignType ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type 
)
private

Definition at line 3081 of file llvmCodegenContext.cpp.

◆ promiseInterfaceObjectIfInterface()

LLVMCodegen::StackValue promiseInterfaceObjectIfInterface ( LLVMModuleContext llvmModCtx,
const StackValue objectVal 
)
private

Definition at line 4362 of file llvmCodegenContext.cpp.

References IRValueType::interfaceObject, LLVMCodegen::wrapInterfaceObjectIfRegressed(), and LLVMCodegen::StackValue::yoiType.

Referenced by LLVMCodegen::storeMember().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ storeArrayElement()

void storeArrayElement ( LLVMModuleContext llvmModCtx,
const std::shared_ptr< IRValueType > &  type,
const std::shared_ptr< IRValueType > &  valueToStoreType,
llvm::Value *  arrayPtr,
llvm::Value *  index,
llvm::Value *  value 
)
private

Definition at line 3964 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::Builder, yoi::managedPtr(), and LLVMCodegen::LLVMModuleContext::TheContext.

Here is the call graph for this function:

◆ storeMember()

◆ storeYieldValue()

void storeYieldValue ( LLVMModuleContext llvmModCtx,
llvm::Value *  value,
const std::shared_ptr< IRValueType > &  yoiType 
)
private

◆ unboxValue()

llvm::Value * unboxValue ( LLVMModuleContext llvmModCtx,
llvm::Value *  objectPtr,
const std::shared_ptr< IRValueType > &  yoiType 
)
private

Definition at line 2545 of file llvmCodegenContext.cpp.

References LLVMCodegen::LLVMModuleContext::Builder, and LLVMCodegen::LLVMModuleContext::structTypeMap.

Referenced by LLVMCodegen::storeMember().

Here is the caller graph for this function:

◆ unwrapInterfaceObject()

◆ wrapInterfaceObjectIfRegressed()

LLVMCodegen::StackValue wrapInterfaceObjectIfRegressed ( LLVMModuleContext llvmModCtx,
const StackValue objectVal 
)
private

Definition at line 4336 of file llvmCodegenContext.cpp.

References LLVMCodegen::actualizeInterfaceObject(), LLVMCodegen::StackValue::llvmValue, yoi::managedPtr(), LLVMCodegen::yoiModule, and LLVMCodegen::StackValue::yoiType.

Referenced by LLVMCodegen::promiseInterfaceObjectIfInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yoiTypeToLLVMType()

Member Data Documentation

◆ codegenObjectCache

CodegenObjectCache codegenObjectCache
private

Definition at line 46 of file llvmCodegenContext.hpp.

Referenced by LLVMCodegen::generate(), and LLVMCodegen::LLVMCodegen().

◆ codegenTaskDispatcher

CodegenTaskDispatcher codegenTaskDispatcher
private

Definition at line 47 of file llvmCodegenContext.hpp.

Referenced by LLVMCodegen::generate().

◆ compilerCtx

◆ contextMutex

std::mutex contextMutex
mutableprivate

Definition at line 176 of file llvmCodegenContext.hpp.

◆ is_rtti_table_frozen

bool is_rtti_table_frozen = false
private

Definition at line 180 of file llvmCodegenContext.hpp.

◆ llvmModuleContext

std::map<yoi::wstr, std::unique_ptr<LLVMModuleContext> > llvmModuleContext
private

◆ yoiModule


The documentation for this class was generated from the following files: