sun::codegen::CodegenContext

sun::codegen::CodegenContext

class · Source (opens in a new tab)

class sun::codegen::CodegenContext

Creates the LLVM generation context for the requested module and target.

Public Functions

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 &)=delete

Delete 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 &&)=default

Allow 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() const

Reports whether source-level debug metadata should be emitted.

getContext

public · function · Source (opens in a new tab)

LLVMContext & sun::codegen::CodegenContext::getContext() const

Always 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 &)=delete

Disallows 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 &&)=default

Transfers 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() const

Whether to run IR optimization passes.

Independent of debug info.

~CodegenContext

public · function · Source (opens in a new tab)

sun::codegen::CodegenContext::~CodegenContext()=default

Destroys 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::builder

No documentation comment.

cgam

public · variable · Source (opens in a new tab)

std::unique_ptr<CGSCCAnalysisManager> sun::codegen::CodegenContext::cgam

No documentation comment.

context

public · variable · Source (opens in a new tab)

std::unique_ptr<LLVMContext> sun::codegen::CodegenContext::context

No documentation comment.

fam

public · variable · Source (opens in a new tab)

std::unique_ptr<FunctionAnalysisManager> sun::codegen::CodegenContext::fam

No documentation comment.

jit

public · variable · Source (opens in a new tab)

std::shared_ptr<sun::driver::SunJIT> sun::codegen::CodegenContext::jit

No documentation comment.

Related: sun::driver::SunJIT

lam

public · variable · Source (opens in a new tab)

std::unique_ptr<LoopAnalysisManager> sun::codegen::CodegenContext::lam

No documentation comment.

mainModule

public · variable · Source (opens in a new tab)

std::unique_ptr<Module> sun::codegen::CodegenContext::mainModule

No documentation comment.

mam

public · variable · Source (opens in a new tab)

std::unique_ptr<ModuleAnalysisManager> sun::codegen::CodegenContext::mam

No documentation comment.

mpm

public · variable · Source (opens in a new tab)

std::unique_ptr<ModulePassManager> sun::codegen::CodegenContext::mpm

No documentation comment.

pic

public · variable · Source (opens in a new tab)

std::unique_ptr<PassInstrumentationCallbacks> sun::codegen::CodegenContext::pic

No documentation comment.

si

public · variable · Source (opens in a new tab)

std::unique_ptr<StandardInstrumentations> sun::codegen::CodegenContext::si

No 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_ = false

No documentation comment.

moduleName

private · variable · Source (opens in a new tab)

std::string sun::codegen::CodegenContext::moduleName

No documentation comment.

optimize_

private · variable · Source (opens in a new tab)

bool sun::codegen::CodegenContext::optimize_ = true

No documentation comment.

ownsContext

private · variable · Source (opens in a new tab)

bool sun::codegen::CodegenContext::ownsContext = true

No documentation comment.

targetTriple_

private · variable · Source (opens in a new tab)

std::string sun::codegen::CodegenContext::targetTriple_

No documentation comment.