sun::codegen::CodegenContext
class · Source (opens in a new tab)
class sun::codegen::CodegenContextCreates the LLVM generation context for the requested module and target.
Public Functions
- CodegenContext
- createNewModule
- createTempExpressionModule
- debugInfoEnabled
- getContext
- operator=
- optimizationEnabled
- ~CodegenContext
CodegenContext
CodegenContext(std::string moduleName, const std::shared_ptr< sun::driver::SunJIT > &jit, LLVMContext *existingContext=nullptr, std::string targetTriple="", bool debugInfo=false, bool optimize=true)
public · function · Source (opens in a new tab)
sun::codegen::CodegenContext::CodegenContext(std::string moduleName, const std::shared_ptr< sun::driver::SunJIT > &jit, LLVMContext *existingContext=nullptr, std::string targetTriple="", bool debugInfo=false, bool optimize=true)Creates the LLVM generation context for the requested module and target.
Related: sun::driver::SunJIT
CodegenContext(const CodegenContext &)=delete
public · function · Source (opens in a new tab)
sun::codegen::CodegenContext::CodegenContext(const CodegenContext &)=deleteDelete copy operations (LLVMContext cannot be shared/copied this way).
CodegenContext(CodegenContext &&)=default
public · function · Source (opens in a new tab)
sun::codegen::CodegenContext::CodegenContext(CodegenContext &&)=defaultAllow move semantics if needed.
createNewModule
public · function · Source (opens in a new tab)
void sun::codegen::CodegenContext::createNewModule(std::unique_ptr< Module > existingModule=nullptr)Starts code generation in a new or supplied LLVM module.
createTempExpressionModule
public · function · Source (opens in a new tab)
std::unique_ptr< llvm::orc::ThreadSafeModule > sun::codegen::CodegenContext::createTempExpressionModule()Helper for temporary expression evaluation.
debugInfoEnabled
public · function · Source (opens in a new tab)
bool sun::codegen::CodegenContext::debugInfoEnabled() constReports whether source-level debug metadata should be emitted.
getContext
public · function · Source (opens in a new tab)
LLVMContext & sun::codegen::CodegenContext::getContext() constAlways use this to get the LLVM context - handles both owned and borrowed cases.
operator=
operator=(const CodegenContext &)=delete
public · function · Source (opens in a new tab)
CodegenContext & sun::codegen::CodegenContext::operator=(const CodegenContext &)=deleteDisallows assignment so ownership and object identity cannot be duplicated.
Related: CodegenContext
operator=(CodegenContext &&)=default
public · function · Source (opens in a new tab)
CodegenContext & sun::codegen::CodegenContext::operator=(CodegenContext &&)=defaultTransfers the stored state from another instance during move assignment.
Related: CodegenContext
optimizationEnabled
public · function · Source (opens in a new tab)
bool sun::codegen::CodegenContext::optimizationEnabled() constWhether to run IR optimization passes.
Independent of debug info.
~CodegenContext
public · function · Source (opens in a new tab)
sun::codegen::CodegenContext::~CodegenContext()=defaultDestroys this object and releases its owned members.
Public Fields
builder
public · variable · Source (opens in a new tab)
std::unique_ptr<IRBuilder<> > sun::codegen::CodegenContext::builderNo documentation comment.
cgam
public · variable · Source (opens in a new tab)
std::unique_ptr<CGSCCAnalysisManager> sun::codegen::CodegenContext::cgamNo documentation comment.
context
public · variable · Source (opens in a new tab)
std::unique_ptr<LLVMContext> sun::codegen::CodegenContext::contextNo documentation comment.
fam
public · variable · Source (opens in a new tab)
std::unique_ptr<FunctionAnalysisManager> sun::codegen::CodegenContext::famNo documentation comment.
jit
public · variable · Source (opens in a new tab)
std::shared_ptr<sun::driver::SunJIT> sun::codegen::CodegenContext::jitNo documentation comment.
Related: sun::driver::SunJIT
lam
public · variable · Source (opens in a new tab)
std::unique_ptr<LoopAnalysisManager> sun::codegen::CodegenContext::lamNo documentation comment.
mainModule
public · variable · Source (opens in a new tab)
std::unique_ptr<Module> sun::codegen::CodegenContext::mainModuleNo documentation comment.
mam
public · variable · Source (opens in a new tab)
std::unique_ptr<ModuleAnalysisManager> sun::codegen::CodegenContext::mamNo documentation comment.
mpm
public · variable · Source (opens in a new tab)
std::unique_ptr<ModulePassManager> sun::codegen::CodegenContext::mpmNo documentation comment.
pic
public · variable · Source (opens in a new tab)
std::unique_ptr<PassInstrumentationCallbacks> sun::codegen::CodegenContext::picNo documentation comment.
si
public · variable · Source (opens in a new tab)
std::unique_ptr<StandardInstrumentations> sun::codegen::CodegenContext::siNo documentation comment.
Private Functions
initializeModule
private · function · Source (opens in a new tab)
void sun::codegen::CodegenContext::initializeModule(LLVMContext &ctx)Sets up the LLVM module and its target-dependent state.
initializePasses
private · function · Source (opens in a new tab)
void sun::codegen::CodegenContext::initializePasses(LLVMContext &ctx)Configures the LLVM passes used to optimize generated code.
Private Fields
debugInfo_
private · variable · Source (opens in a new tab)
bool sun::codegen::CodegenContext::debugInfo_ = falseNo documentation comment.
moduleName
private · variable · Source (opens in a new tab)
std::string sun::codegen::CodegenContext::moduleNameNo documentation comment.
optimize_
private · variable · Source (opens in a new tab)
bool sun::codegen::CodegenContext::optimize_ = trueNo documentation comment.
ownsContext
private · variable · Source (opens in a new tab)
bool sun::codegen::CodegenContext::ownsContext = trueNo documentation comment.
targetTriple_
private · variable · Source (opens in a new tab)
std::string sun::codegen::CodegenContext::targetTriple_No documentation comment.