module volt.llvm.state
Backend | LLVM Backend

Implementation of the State class.

Code Map

//! Implementation of the State class.
module volt.llvm.state;


//! Collection of objects used by pretty much all of the translation code.
//! It isn't called Module, Context or Builder because it will collide in
//! meaning with language concepts.
class VoltState : State
{
public:
	this(lp: LanguagePass, irMod: ir.Module, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) { }
	fn close() { }
	fn compile(m: ir.Module) { }
	fn evaluateStatement(node: ir.Node) { }
	fn getValueAnyForm(exp: ir.Exp, result: Value) { }
	fn getConstant(exp: ir.Exp) LLVMValueRef { }
	fn getConstantValueAnyForm(exp: ir.Exp, result: Value) { }
	fn llvmTrap() LLVMValueRef { }
	fn ehPersonalityFunc() LLVMValueRef { }
	fn ehTypeIdFunc() LLVMValueRef { }
	fn ehLandingType() LLVMTypeRef { }
	fn ehIndexVar() LLVMValueRef { }
	fn ehExceptionVar() LLVMValueRef { }
	fn ehResumeBlock() LLVMBasicBlockRef { }
	fn ehExitBlock() LLVMBasicBlockRef { }
	fn buildCallNeverInvoke(loc: Location, argFunc: LLVMValueRef, args: LLVMValueRef[]) LLVMValueRef { }
	fn buildCallOrInvoke(loc: Location, argFunc: LLVMValueRef, args: LLVMValueRef[]) LLVMValueRef { }
	fn buildCallOrInvoke(loc: Location, argFunc: LLVMValueRef, args: LLVMValueRef[], landingBlock: LLVMBasicBlockRef) LLVMValueRef { }
	fn onFunctionClose() { }
	//! Return the LLVMValueRef for the given Function.
	fn getFunctionValue(argFunc: ir.Function, type: Type) LLVMValueRef { }
	//! Return the LLVMValueRef for the given Variable.
	fn getVariableValue(var: ir.Variable, type: Type) LLVMValueRef { }
	fn getVariableValue(var: ir.FunctionParam, type: Type) LLVMValueRef { }
	fn makeByValVariable(var: ir.FunctionParam, v: LLVMValueRef) { }
	fn makeThisVariable(var: ir.Variable, v: LLVMValueRef) { }
	fn makeNestVariable(var: ir.Variable, v: LLVMValueRef) { }
	fn addType(type: Type, mangledName: string) { }
	fn getTypeNoCreate(mangledName: string) Type { }


protected:
	//! Used to store defined Variables.
	struct Store
	{
	public:
		value: LLVMValueRef;
		type: Type;
	}


protected:
	valueStore: Store[u64];
	typeStore: Type[string];
	visitor: LlvmVisitor;
	mTrapFunc: LLVMValueRef;
	mPersonalityFunc: LLVMValueRef;
	mTypeIdFunc: LLVMValueRef;
	mPadFunc: LLVMValueRef;
	mLandingType: LLVMTypeRef;
}

fn isBuiltinFunction(func: ir.Function) bool { }
class VoltState : State

Collection of objects used by pretty much all of the translation code. It isn't called Module, Context or Builder because it will collide in meaning with language concepts.

One is created for each Volt module that is compiled.

struct Store

Used to store defined Variables.

fn getFunctionValue(argFunc: ir.Function, type: Type) LLVMValueRef

Return the LLVMValueRef for the given Function.

If the value is not defined it will do so.

fn getVariableValue(var: ir.Variable, type: Type) LLVMValueRef

Return the LLVMValueRef for the given Variable.

If the value is not defined it will do so.