main

module main;


struct ArgLooper
{
public:
	fn set(args: string[]) { }
	fn next() string { }
	fn nextOrNull() string { }
}

//! The entry point for the compiler.
fn main(strArgs: string[]) i32 { }
fn checkArgs(files: string[], settings: Settings) bool { }
fn handleArgs(strArgs: string[], args: Arg[], ver: VersionSet, settings: Settings) bool { }
fn getConfigLines() string[] { }
fn getLinesFromFile(file: string, lines: string[]) bool { }
fn printUsage() bool { }
fn printLicense() bool { }

volt.arg

module volt.arg;


class Arg
{
public:
	enum Conditional
	{
		None,
		Std,
		Arch,
		Platform,
	}

	enum Kind
	{
		File,
		Identifier,
		IncludePath,
		SrcPath,
		Warnings,
		//! -E
		PreprocessOnly,
		//! -S
		CompileOnly,
		//! --missing
		MissingDeps,
		//! --import-as-src
		ImportAsSrc,
		//! --debug
		Debug,
		//! --release
		Release,
		DebugSimpleTrace,
		//! --dep
		Dep,
		Output,
		//! --emit-llvm
		EmitLLVM,
		//! --emit-bitcode (depricated)
		EmitBitcode,
		NoLink,
		CCompiler,
		CCompilerArg,
		LD,
		LDArg,
		Link,
		LinkArg,
		Clang,
		ClangArg,
		LLVMAr,
		LLVMArArg,
		Linker,
		LinkerArg,
		LibraryPath,
		LibraryName,
		FrameworkPath,
		FrameworkName,
		StringImportPath,
		JSONOutput,
		PerfOutput,
		InternalDiff,
		InternalPerf,
		InternalDebug,
		InternalNoCatch,
	}


public:
	arg: string;
	condArch: i32;
	condPlatform: i32;
	kind: Kind;
	cond: Conditional;


public:
	this(kind: Kind) { }
	this(arg: string, kind: Kind) { }
}

fn filterArgs(args: Arg[], files: string[], ver: VersionSet, settings: Settings) { }
fn parseArch(a: string) Arch { }
fn parsePlatform(p: string, cRuntime: CRuntime) Platform { }

volta.settings

module volta.settings;


//! Holds a set of compiler settings.
class Settings
{
public:
	//! The -w argument.
	warningsEnabled: bool;
	//! The -S argument.
	noBackend: bool;
	//! The -c argument
	noLink: bool;
	//! The --emit-llvm argument.
	emitLLVM: bool;
	//! The --no-catch argument.
	noCatch: bool;
	//! The --no-stdlib argument.
	noStdLib: bool;
	//! The -E argument.
	removeConditionalsOnly: bool;
	//! The --simple-trace argument.
	simpleTrace: bool;
	//! The --internal-diff argument.
	internalDiff: bool;
	//! The --internal-dbg argument.
	internalDebug: bool;
	//! The --missing argument;
	missingDeps: bool;
	platform: Platform;
	arch: Arch;
	cRuntime: CRuntime;
	//! Compiler identifier string.
	identStr: string;
	//! How where we launched.
	execCmd: string;
	//! Set on create.
	execDir: string;
	//! Derived from platform.
	platformStr: string;
	//! Derived from arch.
	archStr: string;
	//! The --cc argument.
	cc: string;
	//! Arguments to cc, the --Xcc argument(s).
	xcc: string[];
	//! The --ld argument.
	ld: string;
	//! The --Xld argument(s).
	xld: string[];
	//! The --link argument.
	link: string;
	//! The --Xlink argument(s).
	xlink: string[];
	//! The --clang argument.
	clang: string;
	//! The --Xclang argument(s).
	xclang: string[];
	//! The --llvm-ar argument.
	llvmAr: string;
	//! The --Xllvm-ar argument(s).
	xllvmAr: string[];
	//! The --linker argument
	linker: string;
	//! Arguments to the linker, the -Xlinker argument(s).
	xlinker: string[];
	depFile: string;
	outputFile: string;
	//! The --import-as-src command.
	importAsSrc: string[];
	//! The -I arguments.
	includePaths: string[];
	//! The -src-I arguments.
	srcIncludePaths: string[];
	//! The -L arguments.
	libraryPaths: string[];
	//! The -l arguments.
	libraryFiles: string[];
	//! The -F arguments.
	frameworkPaths: string[];
	//! The --framework arguments.
	frameworkNames: string[];
	//! The -J arguments.
	stringImportPaths: string[];
	//! The -jo argument.
	jsonOutput: string;
	//! The --perf-output argument.
	perfOutput: string;


public:
	this(cmd: string, execDir: string) { }
	fn processConfigs() { }
	fn setStrs() { }
	fn replaceMacros() { }
	fn replaceEscapes(file: string) string { }
	fn setDefault() { }
}

volt.errors

module volt.errors;

public import volta.errors;


fn hackTypeWarning(n: ir.Node, nt: ir.Type, ot: ir.Type) { }
fn warningAssignInCondition(loc: const(Location), warningsEnabled: bool) { }
fn warningStringCat(loc: const(Location), warningsEnabled: bool) { }
fn warningEmitBitcode() { }
fn makeEmitLLVMNoLink(file: string, line: const(i32)) CompilerException { }
fn makeDefaultOnExpression(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeCannotCastPointerToDelegate(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeMismatchedTemplateInstanceAndDefinition(loc: const(Location), instanceKind: ir.TemplateKind, definitionKind: ir.TemplateKind, file: string, line: const(i32)) CompilerException { }
fn makeRangeForeachWithIndex(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNonIntegralEnumNullAssign(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeRedefinesReservedIdentifier(loc: const(Location), ident: string, file: string, line: const(i32)) CompilerException { }
fn makeInvalidTraitsModifier(loc: const(Location), modifier: string, file: string, line: const(i32)) CompilerException { }
fn makeInvalidTraitsWord(loc: const(Location), word: string, file: string, line: const(i32)) CompilerException { }
fn makeFunctionNamedInit(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeAggregateStaticVariableNamedInit(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeExpressionForNew(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeMisplacedContinue(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeOverloadedFunctionsAccessMismatch(a: ir.Function, b: ir.Function) CompilerException { }
fn makeOverriddenFunctionsAccessMismatch(a: ir.Function, b: ir.Function) CompilerException { }
fn makeBadAccess(loc: const(Location), name: string, access: ir.Access, file: string, line: const(i32)) CompilerException { }
fn makeBadComposableType(loc: const(Location), type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeNonConstantCompileTimeComposable(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeArgumentCountMismatch(loc: const(Location), func: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeAssigningVoid(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeStructValueCall(loc: const(Location), aggName: string, file: string, line: const(i32)) CompilerException { }
fn makeStructDefaultCtor(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeStructDestructor(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeExpectedOneArgument(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeClassAsAAKey(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeMutableStructAAKey(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeExpectedCall(runexp: ir.RunExp, file: string, line: const(i32)) CompilerException { }
fn makeNonNestedAccess(loc: const(Location), var: ir.Variable, file: string, line: const(i32)) CompilerException { }
fn makeMultipleMatches(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeNoStringImportPaths(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeImportFileOpenFailure(loc: const(Location), filename: string, file: string, line: const(i32)) CompilerException { }
fn makeStringImportWrongConstant(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNoSuperCall(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeInvalidIndexValue(n: ir.Node, type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeUnknownArch(a: string, file: string, line: const(i32)) CompilerException { }
fn makeUnknownPlatform(p: string, file: string, line: const(i32)) CompilerException { }
fn makeExpectedTypeMatch(loc: const(Location), type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeIndexVarTooSmall(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeNestedNested(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNonConstantStructLiteral(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeWrongNumberOfArgumentsToStructLiteral(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeCannotDeduceStructLiteralType(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeArrayNonArrayNotCat(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeCannotPickStaticFunction(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeCannotPickStaticFunctionVia(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeCannotPickMemberFunction(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeStaticViaInstance(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeMixingStaticMember(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNoZeroProperties(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeMultipleZeroProperties(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeUFCSAsProperty(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeUFCSAndProperty(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeCallingUncallable(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeForeachIndexRef(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeDoNotSpecifyForeachType(loc: const(Location), varname: string, file: string, line: const(i32)) CompilerException { }
fn makeNoFieldOrPropOrUFCS(postfix: ir.Postfix, file: string, line: const(i32)) CompilerException { }
fn makeAccessThroughWrongType(loc: const(Location), field: string, file: string, line: const(i32)) CompilerException { }
fn makeVoidReturnMarkedProperty(loc: const(Location), name: string, file: string, line: const(i32)) CompilerException { }
fn makeNoFieldOrPropertyOrIsUFCSWithoutCall(loc: const(Location), value: string, file: string, line: const(i32)) CompilerException { }
fn makeNoFieldOrPropertyOrUFCS(loc: const(Location), value: string, t: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeOverriddenNeedsProperty(f: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeOverridingFinal(f: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeBadBuiltin(loc: const(Location), t: ir.Type, field: string, file: string, line: const(i32)) CompilerException { }
fn makeBadMerge(a: ir.Alias, s: ir.Store, file: string, line: const(i32)) CompilerException { }
fn makeCannotDup(loc: const(Location), type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeCannotSlice(loc: const(Location), type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeCallClass(loc: const(Location), _class: ir.Class, file: string, line: const(i32)) CompilerException { }
fn makeMixedSignedness(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeStaticArrayLengthMismatch(loc: const(Location), expectedLength: size_t, gotLength: size_t, file: string, line: const(i32)) CompilerException { }
fn makeDoesNotImplement(loc: const(Location), _class: ir.Class, iface: ir._Interface, func: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeCaseFallsThrough(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNoNextCase(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeGotoOutsideOfSwitch(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeStrayDocComment(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeCallingWithoutInstance(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeForceLabel(loc: const(Location), fun: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeNoEscapeScope(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNoReturnScope(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeReturnValueExpected(loc: const(Location), type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeNoLoadBitcodeFile(filename: string, msg: string, file: string, line: const(i32)) CompilerException { }
fn makeNoWriteBitcodeFile(filename: string, msg: string, file: string, line: const(i32)) CompilerException { }
fn makeNoWriteObjectFile(filename: string, msg: string, file: string, line: const(i32)) CompilerException { }
fn makeNoLinkModule(filename: string, msg: string, file: string, line: const(i32)) CompilerException { }
fn makeDuplicateLabel(loc: const(Location), label: string, file: string, line: const(i32)) CompilerException { }
fn makeUnmatchedLabel(loc: const(Location), label: string, file: string, line: const(i32)) CompilerException { }
fn makeDollarOutsideOfIndex(constant: ir.Constant, file: string, line: const(i32)) CompilerException { }
fn makeBreakOutOfLoop(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeAggregateDoesNotDefineOverload(loc: const(Location), agg: ir.Aggregate, func: string, file: string, line: const(i32)) CompilerException { }
fn makeBadWithType(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeForeachReverseOverAA(fes: ir.ForeachStatement, file: string, line: const(i32)) CompilerException { }
fn makeAnonymousAggregateRedefines(agg: ir.Aggregate, name: string, file: string, line: const(i32)) CompilerException { }
fn makeInvalidMainSignature(func: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeNoValidFunction(loc: const(Location), fname: string, args: ir.Type[], file: string, line: const(i32)) CompilerException { }
fn makeCVaArgsOnlyOperateOnSimpleTypes(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeVaFooMustBeLValue(loc: const(Location), foo: string, file: string, line: const(i32)) CompilerException { }
fn makeNonLastVariadic(var: ir.Variable, file: string, line: const(i32)) CompilerException { }
fn makeStaticAssert(as: ir.AssertStatement, msg: string, file: string, line: const(i32)) CompilerException { }
fn makeConstField(v: ir.Variable, file: string, line: const(i32)) CompilerException { }
fn makeAssignToNonStaticField(v: ir.Variable, file: string, line: const(i32)) CompilerException { }
fn makeSwitchBadType(node: ir.Node, type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeSwitchDuplicateCase(node: ir.Node, file: string, line: const(i32)) CompilerException { }
fn makeFinalSwitchBadCoverage(node: ir.Node, file: string, line: const(i32)) CompilerException { }
fn makeArchNotSupported(file: string, line: const(i32)) CompilerException { }
fn makeSpuriousTag(exp: ir.Exp, taggedRef: bool, file: string, line: const(i32)) CompilerException { }
fn makeWrongTag(exp: ir.Exp, taggedRef: bool, file: string, line: const(i32)) CompilerException { }
fn makeNotTaggedOut(exp: ir.Exp, file: string, line: const(i32)) CompilerException { }
fn makeNotTaggedRef(exp: ir.Exp, file: string, line: const(i32)) CompilerException { }
fn makeFunctionNameOutsideOfFunction(fexp: ir.TokenExp, file: string, line: const(i32)) CompilerException { }
fn makeMultipleValidModules(node: ir.Node, paths: string[], file: string, line: const(i32)) CompilerException { }
fn makeAlreadyLoaded(m: ir.Module, filename: string, file: string, line: const(i32)) CompilerException { }
fn makeCannotOverloadNested(node: ir.Node, func: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeUsedBeforeDeclared(node: ir.Node, var: ir.Variable, file: string, line: const(i32)) CompilerException { }
fn makeStructConstructorsUnsupported(node: ir.Node, file: string, line: const(i32)) CompilerException { }
fn makeCallingStaticThroughInstance(node: ir.Node, func: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeMarkedOverrideDoesNotOverride(node: ir.Node, func: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeNewAbstract(node: ir.Node, _class: ir.Class, file: string, line: const(i32)) CompilerException { }
fn makeSubclassFinal(child: ir.Class, parent: ir.Class, file: string, line: const(i32)) CompilerException { }
fn makeNotAvailableInCTFE(node: ir.Node, s: string, file: string, line: const(i32)) CompilerException { }
fn makeNotAvailableInCTFE(node: ir.Node, feature: ir.Node, file: string, line: const(i32)) CompilerException { }
fn makeMultipleDefaults(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeFinalSwitchWithDefault(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNoDefaultCase(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeTryWithoutCatch(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeMultipleOutBlocks(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeNeedOverride(overrider: ir.Function, overridee: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeThrowOnlyThrowable(exp: ir.Exp, type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeThrowNoInherits(exp: ir.Exp, clazz: ir.Class, file: string, line: const(i32)) CompilerException { }
fn makeInvalidAAKey(aa: ir.AAType, file: string, line: const(i32)) CompilerException { }
fn makeBadAAAssign(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeBadAANullAssign(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeError(n: ir.Node, s: string, file: string, line: const(i32)) CompilerException { }
fn makeError(loc: const(Location), s: string, file: string, line: const(i32)) CompilerException { }
fn makeUnsupported(loc: const(Location), feature: string, file: string, line: const(i32)) CompilerException { }
fn makeExpected(node: ir.Node, s: string, file: string, line: const(i32)) CompilerException { }
fn makeExpected(loc: const(Location), s: string, b: bool, file: string, line: const(i32)) CompilerException { }
fn makeExpected(loc: const(Location), expected: string, got: string, file: string, line: const(i32)) CompilerException { }
fn makeUnexpected(loc: const(Location), s: string, file: string, line: const(i32)) CompilerException { }
fn makeBadOperation(node: ir.Node, file: string, line: const(i32)) CompilerException { }
fn makeExpectedContext(node: ir.Node, node2: ir.Node, file: string, line: const(i32)) CompilerException { }
fn makeNotReached(node: ir.Node, file: string, line: const(i32)) CompilerException { }
fn makeBadAggregateToPrimitive(node: ir.Node, from: ir.Type, to: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeBadImplicitCast(node: ir.Node, from: ir.Type, to: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeCannotModify(node: ir.Node, type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeNotLValueButRefOut(node: ir.Node, isRef: bool, file: string, line: const(i32)) CompilerException { }
fn makeTypeIsNot(node: ir.Node, from: ir.Type, to: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeInvalidType(node: ir.Node, type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeInvalidUseOfStore(node: ir.Node, store: ir.Store, file: string, line: const(i32)) CompilerException { }
fn makeWithCreatesAmbiguity(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeInvalidThis(node: ir.Node, was: ir.Type, expected: ir.Type, member: string, file: string, line: const(i32)) CompilerException { }
fn makeNotMember(node: ir.Node, aggregate: ir.Type, member: string, file: string, line: const(i32)) CompilerException { }
fn makeNotMember(loc: const(Location), aggregate: string, member: string, file: string, line: const(i32)) CompilerException { }
fn makeFailedLookup(node: ir.Node, lookup: string, file: string, line: const(i32)) CompilerException { }
fn makeFailedEnumLookup(loc: const(Location), enumName: string, name: string, file: string, line: const(i32)) CompilerException { }
fn makeFailedLookup(loc: const(Location), lookup: string, file: string, line: const(i32)) CompilerException { }
fn makeWrongNumberOfArguments(node: ir.Node, func: ir.Function, got: size_t, expected: size_t, file: string, line: const(i32)) CompilerException { }
fn makeBadCall(node: ir.Node, type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeBadPropertyCall(node: ir.Node, type: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeBadBinOp(binop: ir.BinOp, ltype: ir.Type, rtype: ir.Type, file: string, line: const(i32)) CompilerException { }
fn makeCannotDisambiguate(node: ir.Node, functions: ir.Function[], args: ir.Type[], file: string, line: const(i32)) CompilerException { }
fn makeCannotDisambiguate(loc: const(Location), functions: ir.Function[], args: ir.Type[], file: string, line: const(i32)) CompilerException { }
fn makeCannotInfer(loc: const(Location), file: string, line: const(i32)) CompilerException { }
fn makeCannotLoadDynamic(node: ir.Node, func: ir.Function, file: string, line: const(i32)) CompilerException { }
fn makeMultipleFunctionsMatch(loc: const(Location), functions: ir.Function[], file: string, line: const(i32)) CompilerException { }
fn panicOhGod(node: ir.Node, file: string, line: const(i32)) CompilerException { }
fn panic(node: ir.Node, msg: string, file: string, line: const(i32)) CompilerException { }
fn panic(loc: const(Location), msg: string, file: string, line: const(i32)) CompilerException { }
fn panic(msg: string, file: string, line: const(i32)) CompilerException { }
fn panicRuntimeObjectNotFound(name: string, file: string, line: const(i32)) CompilerException { }
fn panicUnhandled(node: ir.Node, unhandled: string, file: string, line: const(i32)) CompilerException { }
fn panicUnhandled(loc: const(Location), unhandled: string, file: string, line: const(i32)) CompilerException { }
fn panicNotMember(node: ir.Node, aggregate: string, field: string, file: string, line: const(i32)) CompilerException { }
fn panicExpected(loc: const(Location), msg: string, file: string, line: const(i32)) CompilerException { }
fn panicAssert(node: ir.Node, condition: bool, file: string, line: const(i32)) { }
fn panicAssert(loc: const(Location), condition: bool, file: string, line: const(i32)) { }

volta.license

//! License information.
module volta.license;


//! Identifier string for this Volta.
enum ident;
//! This is the license for the volt compiler.
enum license;

global licenseArray: string[];

fn __ctor() { }

volt.interfaces

module volt.interfaces;

public import volta.interfaces;


//! Used to determine the output of the backend.
enum TargetType
{
	DebugPrinting,
	LlvmBitcode,
	VoltCode,
	Object,
	CCode,
	Host,
}

//! Interface implemented by backends. Often the last stage of the compile
//! pipe that is implemented in this compiler, optimization and linking are
//! often done outside of the compiler, either invoked directly by us or a
//! build system.
interface Backend
{
public:
	//! Free resources.
	fn close();
	//! Return the supported target types.
	fn supported() TargetType[];
	//! Compile the given module to either a file or host result.
	fn compileFile(m: ir.Module, type: TargetType, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) BackendFileResult;
	//! Compile the given module to either a file or host result.
	fn compileHost(m: ir.Module, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) BackendHostResult;
}

//! A result from a backend compilation that can be saved onto disk.
interface BackendFileResult
{
public:
	//! Free resources.
	fn close();
	//! Save the result to disk.
	fn saveToFile(filename: string);
}

//! A JIT compiled a module that you can fetch functions from.
interface BackendHostResult
{
public:
	//! Return from getFunction method.
	alias CompiledDg = ir.Constant delegate(ir.Constant[]);


public:
	//! Free resources.
	fn close();
	//! Returns a delegate that runs the given function from the module that
	//! this object was compiled from.
	fn getFunction(ir.Function) CompiledDg;
}

//! Home to logic for tying Frontend, Pass and Backend together and
//! abstracts away several IO related functions. Such as looking up module
//! files and printing error messages.
class Driver
{
public:
	execDir: string;
	identStr: string;
	internalDebug: bool;


public:
	this() { }
	//! Free resources.
	fn close();
	//! Load a module source from file system.
	fn loadModule(name: ir.QualifiedName) ir.Module;
	//! Load a filename from the string import paths.
	fn stringImport(loc: const(Location), filename: string) string;
	//! Get the modules given on the command line.
	fn getCommandLineModules() ir.Module[];
	//! Returns a delegate that runs the given function from the given module.
	fn hostCompile(ir.Module) BackendHostResult;
}

//! Centre point for all language passes.
class LanguagePass
{
public:
	alias DoneDg = void delegate();


public:
	errSink: ErrorSink;
	driver: Driver;
	ver: VersionSet;
	target: TargetInfo;
	settings: Settings;
	frontend: Frontend;
	postParse: PostParsePass;
	warningsEnabled: bool;
	//! Cached lookup items.
	objObject: ir.Class;
	//! Cached lookup items.
	vaStartFunc: ir.Function;
	//! Cached lookup items.
	vaEndFunc: ir.Function;
	//! Cached lookup items.
	tiTypeInfo: ir.Class;
	//! Cached lookup items.
	tiClassInfo: ir.Class;
	//! Cached lookup items.
	tiInterfaceInfo: ir.Class;
	//! Cached lookup items.
	exceptThrowable: ir.Class;
	//! Cached lookup items.
	gcAllocDgVariable: ir.Variable;
	//! Cached lookup items.
	aaNew: ir.Function;
	//! Cached lookup items.
	aaDup: ir.Function;
	//! Cached lookup items.
	aaRehash: ir.Function;
	//! Cached lookup items.
	aaGetKeys: ir.Function;
	//! Cached lookup items.
	aaGetValues: ir.Function;
	//! Cached lookup items.
	aaGetLength: ir.Function;
	//! Cached lookup items.
	aaInsertPrimitive: ir.Function;
	//! Cached lookup items.
	aaInsertArray: ir.Function;
	//! Cached lookup items.
	aaInsertPtr: ir.Function;
	//! Cached lookup items.
	aaDeletePrimitive: ir.Function;
	//! Cached lookup items.
	aaDeleteArray: ir.Function;
	//! Cached lookup items.
	aaDeletePtr: ir.Function;
	//! Cached lookup items.
	aaInPrimitive: ir.Function;
	//! Cached lookup items.
	aaInArray: ir.Function;
	//! Cached lookup items.
	aaInPtr: ir.Function;
	//! Cached lookup items.
	aaInBinopPrimitive: ir.Function;
	//! Cached lookup items.
	aaInBinopArray: ir.Function;
	//! Cached lookup items.
	aaInBinopPtr: ir.Function;
	//! Cached lookup items.
	hashFunc: ir.Function;
	//! Cached lookup items.
	castFunc: ir.Function;
	//! Cached lookup items.
	memcmpFunc: ir.Function;
	//! Cached lookup items.
	utfDecode_u8_d: ir.Function;
	//! Cached lookup items.
	utfReverseDecode_u8_d: ir.Function;
	//! Cached lookup items.
	ehThrowFunc: ir.Function;
	//! Cached lookup items.
	ehRethrowFunc: ir.Function;
	//! Cached lookup items.
	ehThrowSliceErrorFunc: ir.Function;
	//! Cached lookup items.
	ehPersonalityFunc: ir.Function;
	//! Cached lookup items.
	ehThrowAssertErrorFunc: ir.Function;
	//! Cached lookup items.
	ehThrowKeyNotFoundErrorFunc: ir.Function;
	//! Cached lookup items.
	runMainFunc: ir.Function;
	//! Cached lookup items.
	llvmTypeidFor: ir.Function;
	//! Cached lookup items.
	llvmMemmove32: ir.Function;
	//! Cached lookup items.
	llvmMemmove64: ir.Function;
	//! Cached lookup items.
	llvmMemcpy32: ir.Function;
	//! Cached lookup items.
	llvmMemcpy64: ir.Function;
	//! Cached lookup items.
	llvmMemset32: ir.Function;
	//! Cached lookup items.
	llvmMemset64: ir.Function;
	//! Cached lookup items.
	sinkType: ir.Type;
	//! Cached lookup items.
	sinkStore: ir.Type;
	//! Cached lookup items.
	sinkInit: ir.Function;
	//! Cached lookup items.
	sinkGetStr: ir.Function;
	//! Cached lookup items.
	formatHex: ir.Function;
	//! Cached lookup items.
	formatI64: ir.Function;
	//! Cached lookup items.
	formatU64: ir.Function;
	//! Cached lookup items.
	formatF32: ir.Function;
	//! Cached lookup items.
	formatF64: ir.Function;
	//! Cached lookup items.
	formatDchar: ir.Function;
	//! Type id constants for TypeInfo.
	TYPE_STRUCT: i32;
	//! Type id constants for TypeInfo.
	TYPE_CLASS: i32;
	//! Type id constants for TypeInfo.
	TYPE_INTERFACE: i32;
	//! Type id constants for TypeInfo.
	TYPE_UNION: i32;
	//! Type id constants for TypeInfo.
	TYPE_ENUM: i32;
	//! Type id constants for TypeInfo.
	TYPE_ATTRIBUTE: i32;
	//! Type id constants for TypeInfo.
	TYPE_ANNOTATION: i32;
	//! Type id constants for TypeInfo.
	TYPE_VOID: i32;
	//! Type id constants for TypeInfo.
	TYPE_UBYTE: i32;
	//! Type id constants for TypeInfo.
	TYPE_BYTE: i32;
	//! Type id constants for TypeInfo.
	TYPE_CHAR: i32;
	//! Type id constants for TypeInfo.
	TYPE_BOOL: i32;
	//! Type id constants for TypeInfo.
	TYPE_USHORT: i32;
	//! Type id constants for TypeInfo.
	TYPE_SHORT: i32;
	//! Type id constants for TypeInfo.
	TYPE_WCHAR: i32;
	//! Type id constants for TypeInfo.
	TYPE_UINT: i32;
	//! Type id constants for TypeInfo.
	TYPE_INT: i32;
	//! Type id constants for TypeInfo.
	TYPE_DCHAR: i32;
	//! Type id constants for TypeInfo.
	TYPE_FLOAT: i32;
	//! Type id constants for TypeInfo.
	TYPE_ULONG: i32;
	//! Type id constants for TypeInfo.
	TYPE_LONG: i32;
	//! Type id constants for TypeInfo.
	TYPE_DOUBLE: i32;
	//! Type id constants for TypeInfo.
	TYPE_REAL: i32;
	//! Type id constants for TypeInfo.
	TYPE_POINTER: i32;
	//! Type id constants for TypeInfo.
	TYPE_ARRAY: i32;
	//! Type id constants for TypeInfo.
	TYPE_STATIC_ARRAY: i32;
	//! Type id constants for TypeInfo.
	TYPE_AA: i32;
	//! Type id constants for TypeInfo.
	TYPE_FUNCTION: i32;
	//! Type id constants for TypeInfo.
	TYPE_DELEGATE: i32;


public:
	this(errSink: ErrorSink, drv: Driver, ver: VersionSet, target: TargetInfo, frontend: Frontend) { }
	//! Free resources.
	fn close();
	//! Used by the Driver to store classes it loads from arguments.
	fn addModule(mod: ir.Module);
	//! Returns a already loaded module or loads it from file.
	fn getModule(name: ir.QualifiedName) ir.Module;
	//! Retuns all currently loaded modules.
	fn getModules() ir.Module[];
	//! These functions are used to assure that no circular dependancies
	//! happens when resolving nodes like: Class, Function, Variables, etc.
	fn startResolving(n: ir.Node) DoneDg;
	//! These functions are used to assure that no circular dependancies
	//! happens when resolving nodes like: Class, Function, Variables, etc.
	fn startActualizing(n: ir.Node) DoneDg;
	//! Resolves an Attribute, for UserAttribute usages.
	fn resolve(current: ir.Scope, a: ir.Attribute);
	//! Resolve a set of user attributes.
	fn resolve(current: ir.Scope, userAttrs: ir.Attribute[]);
	//! Resolves an ExpReference, forwarding the decl appropriately.
	fn resolve(current: ir.Scope, eref: ir.ExpReference);
	//! Resolves an EnumDeclaration setting its value.
	fn resolve(current: ir.Scope, ed: ir.EnumDeclaration);
	//! Resolves a TemplateInstance, causing it to be instantiated.
	fn resolve(current: ir.Scope, ti: ir.TemplateInstance);
	//! Resolves an ir.Store that is of kind Merge. Afterwards the kind is
	//! changed to kind Function, since only functions can be merged.
	fn resolve(ir.Store);
	//! Resolves a Function making it usable externaly,
	fn resolve(current: ir.Scope, func: ir.Function) { }
	//! Resolves a Variable making it usable externaly.
	fn resolve(current: ir.Scope, v: ir.Variable) { }
	//! Resolves a unresolved alias store, the store can change type to Type,
	//! either the field myAlias or type is set.
	fn resolve(a: ir.Alias) { }
	//! Resolves an Enum making it usable externaly, done on lookup of it.
	fn resolveNamed(e: ir.Enum) { }
	//! Resolves a Struct, done on lookup of it.
	fn resolveNamed(s: ir.Struct) { }
	//! Resolves a Union, done on lookup of it.
	fn resolveNamed(u: ir.Union) { }
	//! Resolves a Class, making sure the parent class is populated.
	fn resolveNamed(c: ir.Class) { }
	//! Resolves an Interface.
	fn resolveNamed(i: ir._Interface) { }
	//! Actualize a Struct, making sure all its fields and methods are
	//! populated, and any embedded structs (not referenced via pointers) are
	//! actualized as well. In short makes sure that the struct size is fully
	//! known.
	fn actualize(s: ir.Struct) { }
	//! Actualize a Union, making sure all its fields and methods are
	//! populated, and any embedded structs (not referenced via pointers) are
	//! resolved as well.
	fn actualize(u: ir.Union) { }
	//! Actualize an Interface.
	fn actualize(i: ir._Interface) { }
	//! Actualize a Class, making sure all its fields and methods are
	//! populated, Any embedded structs (not referenced via pointers) are
	//! resolved as well. Parent classes are resolved to.
	fn actualize(c: ir.Class) { }
	//! Run all post parse passes on the given modules.
	fn phase1(m: ir.Module[]);
	//! Run all semantic passes on the given modules.
	fn phase2(m: ir.Module[]);
	//! Run all lowering passes on the given modules.
	fn phase3(m: ir.Module[]);


protected:
	fn doResolve(current: ir.Scope, v: ir.Variable);
	fn doResolve(current: ir.Scope, func: ir.Function);
	fn doResolve(a: ir.Alias);
	fn doResolve(e: ir.Enum);
	fn doResolve(i: ir._Interface);
	fn doResolve(c: ir.Class);
	fn doResolve(u: ir.Union);
	fn doResolve(c: ir.Struct);
	fn doActualize(i: ir._Interface);
	fn doActualize(s: ir.Struct);
	fn doActualize(u: ir.Union);
	fn doActualize(c: ir.Class);
}

volt.driver

module volt.driver;


enum DEFAULT_A;
enum DEFAULT_BC;
enum DEFAULT_OBJ;
enum DEFAULT_EXE;

//! Default implementation of Driver, replace this if you wish to change
//! the basic operation of the compiler.
class VoltDriver : Driver, ErrorSink
{
public:
	ver: VersionSet;
	target: TargetInfo;
	frontend: Frontend;
	languagePass: LanguagePass;
	backend: Backend;
	tempMan: TempfileManager;
	debugVisitors: Pass[];


public:
	this(s: Settings, ver: VersionSet, target: TargetInfo, files: string[]) { }
	fn onWarning(msg: string, file: string, line: i32) { }
	fn onWarning(loc: const(ir.Location), msg: string, file: string, line: i32) { }
	fn onError(msg: string, file: string, line: i32) { }
	fn onError(loc: const(ir.Location), msg: string, file: string, line: i32) { }
	fn onPanic(msg: string, file: string, line: i32) { }
	fn onPanic(loc: const(ir.Location), msg: string, file: string, line: i32) { }
	//! Retrieve a Module by its name. Returns null if none is found.
	fn loadModule(name: ir.QualifiedName) ir.Module { }
	fn stringImport(loc: const(Location), fname: string) string { }
	fn getCommandLineModules() ir.Module[] { }
	fn close() { }
	fn addFile(file: string) { }
	fn addFiles(files: string[]) { }
	fn compile() i32 { }
	fn hostCompile(mod: ir.Module) BackendHostResult { }


protected:
	mArch: Arch;
	mPlatform: Platform;
	mNoLink: bool;
	mNoBackend: bool;
	mRemoveConditionalsOnly: bool;
	mMissingDeps: bool;
	mEmitLLVM: bool;
	mArWithLLLVM: bool;
	mOutput: string;
	mDepFile: string;
	//! All files used as input to this compiled.
	mDepFiles: string[];
	mIncludes: string[];
	mSrcIncludes: string[];
	mSourceFiles: string[];
	mImportAsSrc: string[];
	mBitcodeFiles: string[];
	mObjectFiles: string[];
	mStringImportPaths: string[];
	mInternalDiff: bool;
	mInternalDebug: bool;
	mInternalNoCatch: bool;
	mCommandLineModules: ir.Module[];
	mDebugPassesRun: bool;
	mAccumReading: Accumulator;
	mAccumParsing: Accumulator;
	mCompiledModules: BackendHostResult[u64];
	mJsonPrinter: JsonPrinter;
	mLLVMDriver: LLVMDriver;
	mLLVMSettings: LLVMDriverSettings;
	mRunVoltend: bool;
	mRunBackend: bool;


protected:
	fn writeDepFile() { }
	fn pathFromQualifiedName(name: ir.QualifiedName, includes: string[], suffix: string) string { }
	//! Loads a file and parses it.
	fn loadAndParse(file: string) ir.Module { }
	fn intCompile() i32 { }
	fn intCompileVoltend() i32 { }
	fn intCompileBackend() i32 { }
	fn decideStuff(settings: Settings) { }
	fn decideJson(settings: Settings) { }
	fn decideLinker(settings: Settings) { }
	fn decideOutputFile(settings: Settings) { }
	fn decideCheckErrors() { }
	fn decideParts() { }
	fn decideBackend() { }


protected:
	static fn decideMode(settings: Settings) Mode { }
}

fn setTargetInfo(target: TargetInfo, arch: Arch, platform: Platform, cRuntime: CRuntime, llvmIntrinsicVersion: i32) TargetInfo { }

volt.util.path

module volt.util.path;


//! Helper class to manage temporary files.
class TempfileManager
{
public:
	//! Uses getTemporarySubdirectoryName to get the system temporary
	//! directory.
	this() { }
	//! Creates a temporary file name with the given ending.
	fn getTempFile(ending: string) string { }
	//! Remove all tempfiles tracked by this manager.
	fn removeTempfiles() { }


protected:
	mSubdir: string;
	mTemporaryFiles: string[];
}

//! Does the same as unix's "mkdir -p" command.
fn mkdirP(name: string) { }
//! Turns a qualified module name into a list of possible file paths.
fn genPossibleFilenames(dir: string, names: string[], suffix: string) string[] { }
//! Get the temporary subdirectory name for this run of the compiler.
fn getTemporarySubdirectoryName() string { }

volt.util.perf

module volt.util.perf;


class Accumulator
{
public:
	accum: i64;
	then: i64;
	below: Accumulator;
	next: Accumulator;
	name: string;


public:
	this(name: string) { }
	fn start() { }
	fn stop() { }
}

class Counter
{
public:
	name: string;
	count: u64;
	next: Counter;


public:
	this(name: string) { }
}

class GCAccumulator : Accumulator
{
public:
	mAllocDg: AllocDg;


public:
	this() { }
	fn alloc(ti: TypeInfo, c: size_t) void* { }
}

//! Very simple perfing code, just gets timing info.
struct Perf
{
public:
	enum Mark
	{
		SETUP,
		PARSING,
		PHASE1,
		PHASE2,
		PHASE3,
		BACKEND,
		BITCODE,
		ASSEMBLE,
		LINK,
		EXIT,
		DONE,
		NUM_MARKS,
	}


public:
	pos: i32;
	times: i64[];
	counter: Counter;
	stack: Accumulator;
	accum: Accumulator;


public:
	fn perfInit() { }
	fn close() { }
	//! Place a mark in time, allows to skip phases.
	fn mark(mark: Mark) { }
	fn print(file: string, name: string) { }
}

global perf: Perf;

volta.interfaces

module volta.interfaces;


//! Each of these listed platforms corresponds to a Version identifier.
enum CRuntime
{
	None,
	MinGW,
	Glibc,
	Darwin,
	Microsoft,
}

//! Each of these listed platforms corresponds to a Version identifier.
enum Platform
{
	MinGW,
	MSVC,
	Linux,
	OSX,
	Metal,
}

//! Each of these listed architectures corresponds to a Version identifier.
enum Arch
{
	X86,
	X86_64,
	ARMHF,
	AArch64,
}

//! What kind of exception handling should the backend implement.
enum ExceptionHandlingType
{
	None,
	Posix,
	Windows,
}

//! Interface for communicating error conditions to the user.
interface ErrorSink
{
public:
	fn onWarning(msg: string, file: string, line: i32);
	fn onWarning(loc: const(ir.Location), msg: string, file: string, line: i32);
	fn onError(msg: string, file: string, line: i32);
	fn onError(loc: const(ir.Location), msg: string, file: string, line: i32);
	fn onPanic(msg: string, file: string, line: i32);
	fn onPanic(loc: const(ir.Location), msg: string, file: string, line: i32);
}

//! The part of the compiler that takes user supplied code and turns it
//! into IR.
interface Frontend
{
public:
	//! Free resources.
	fn close();
	//! Parse a module and all its children from the given source. Filename is
	//! the file from which file the source was loaded from.
	fn parseNewFile(source: string, filename: string) ir.Module;
	//! Parse a BlockStatement from a list of tokens.
	fn parseBlockStatement(tokens: ir.Token[], magicFlagD: bool) ir.BlockStatement;
	//! Parse a zero or more statements from a string, does not need to start
	//! with '{' or end with a '}'.
	fn parseStatements(source: string, loc: Location) ir.Node[];
}

//! Interface implemented by transformation, debug and/or validation
//! passes.
interface Pass
{
public:
	//! Free resources.
	fn close();
	//! Run the pass on the given module.
	fn transform(m: ir.Module);
}

//! Interface implemented by PostParse code, allows running certain
//! operations out of band from the normal transform entire module type.
interface PostParsePass
{
public:
	//! Resume the post-parsing process on the given Function.
	fn transformChildBlocks(func: ir.Function);
}

//! Holds information about the target that we are compiling to.
class TargetInfo
{
public:
	struct Alignments
	{
	public:
		int1: size_t;
		int8: size_t;
		int16: size_t;
		int32: size_t;
		int64: size_t;
		float32: size_t;
		float64: size_t;
		ptr: size_t;
		aggregate: size_t;
	}


public:
	arch: Arch;
	platform: Platform;
	cRuntime: CRuntime;
	ptrSize: size_t;
	alignment: Alignments;
	isP64: bool;
	ehType: ExceptionHandlingType;
	llvmIntrinsicVersion: i32;


public:
	this() { }
}

//! A set of version/debug identifiers.
class VersionSet
{
public:
	//! These are always set
	enum defaultVersions;
	enum reservedVersions;


public:
	debugEnabled: bool;


public:
	this() { }
	//! Throws: Exception if ident is reserved.
	fn setVersionIdentifierIfNotReserved(ident: string) bool { }
	//! Doesn't throw on ident reserve.
	fn overwriteVersionIdentifier(ident: string) { }
	//! Doesn't throw, debug identifiers can't be reserved.
	fn setDebugIdentifier(ident: string) { }
	//! Check if a given version identifier is set. Params: ident = the
	//! identifier to check. Returns: true if set, false otherwise.
	fn isVersionSet(ident: string) bool { }
	//! Check if a given debug identifier is set. Params: ident = the identifier
	//! to check. Returns: true if set, false otherwise.
	fn isDebugSet(ident: string) bool { }
	//! Set the correct version identifiers for the given arch, platform, and
	//! runtime.
	fn set(arch: Arch, platform: Platform, cRuntime: CRuntime, llvmIntrinsicVersion: i32) { }
	//! Quick helpers to get version flags.
	fn isP64() bool { }
}

volta.ir.location

module volta.ir.location;


//! Struct representing a location in a source file.
struct Location
{
public:
	filename: string;
	line: u32;
	column: u32;
	length: u32;


public:
	fn toString() string { }
	//! Return the line pointed to by this location.
	fn errorLine() string { }
	//! Return the chunk of an errorLine that this points at, or an empty
	//! string.
	fn errorChunk() string { }
	//! Return a few lines that show where in filename this Location is
	//! pointing.
	fn locationGuide() string { }
	//! Difference between two locations. end - begin == begin ... end
	fn opSub(begin: Location) Location { }
	fn spanTo(end: Location) { }


public:
	//! Difference between two locations. end - begin == begin ... end On
	//! mismatch of filename or if begin is after end _default is returned.
	static fn difference(end: Location, begin: Location, _default: Location) Location { }
}

volta.ir

module volta.ir;

public import volta.ir.base;
public import volta.ir.type;
public import volta.ir.context;
public import volta.ir.toplevel;
public import volta.ir.statement;
public import volta.ir.expression;
public import volta.ir.declaration;
public import volta.ir.templates;

volt.llvm.intrinsicVersion

//! Get the intrinsic version.
module volt.llvm.intrinsicVersion;


enum V1;
enum V2;

fn get() i32 { }

volt.util.cmdgroup

module volt.util.cmdgroup;


alias OsHandle = Pid.OsHandle;

//! Helper class to launch one or more processes to run along side the main
//! process.
class CmdGroup
{
public:
	alias DoneDg = void delegate(i32);


public:
	this(maxWaiting: u32) { }
	fn run(cmd: string, args: string[], dgt: DoneDg) { }
	fn waitOne() { }
	fn waitAll() { }
}

//! Exception form and when execquting commands.
class CmdException : Exception
{
public:
	this(cmd: string, args: string[], reason: string) { }
}

volt.exceptions

module volt.exceptions;


//! Base class for compiler exceptions.
class CompilerException : Exception
{
public:
	loc: Location;
	hasLocation: bool;
	neverIgnore: bool;
	more: CompilerError;
	fixHint: string;
	allocationLocation: string;


public:
	this(message: string, more: CompilerError, neverIgnore: bool, file: string, line: const(i32)) { }
	this(loc: const(Location), message: string, more: CompilerError, neverIgnore: bool, file: string, line: const(i32)) { }


protected:
	fn errorFormat() string { }
	fn locationFormat() string { }
}

//! Exception for compiler error messages arising from source code.
class CompilerError : CompilerException
{
public:
	this(message: string, file: string, line: const(i32)) { }
	this(message: string, more: CompilerError, file: string, line: const(i32)) { }
	this(loc: const(Location), message: string, neverIgnore: bool, file: string, line: const(i32)) { }
	this(loc: const(Location), message: string, file: string, line: const(i32)) { }
	this(loc: const(Location), message: string, more: CompilerError, file: string, line: const(i32)) { }
	this(loc: const(Location), message: string, more: CompilerError, neverIgnore: bool, file: string, line: const(i32)) { }
}

class MissingSemicolonError : CompilerError
{
public:
	this(loc: Location, type: string, file: string, line: const(i32)) { }
}

class PairMismatchError : CompilerError
{
public:
	this(pairStart: Location, loc: Location, type: string, token: string, file: string, line: const(i32)) { }
}

class ArgumentMismatchError : CompilerError
{
public:
	enum unspecified;


public:
	argNumber: ptrdiff_t;


public:
	this(loc: const(Location), message: string, file: string, line: const(i32)) { }
	this(loc: const(Location), message: string, argNumber: ptrdiff_t, file: string, line: const(i32)) { }
}

//! Aka Internal Compiler Error, aka ICE, aka CompilerPanic.
class CompilerPanic : CompilerException
{
public:
	this(message: string, file: string, line: const(i32)) { }
	this(loc: const(Location), message: string, file: string, line: const(i32)) { }


protected:
	fn errorFormat() string { }
	fn locationFormat() string { }
}

fn errorMessageOnly(loc: const(Location), message: string, file: string, line: const(i32)) { }

volta.parser.parser

module volta.parser.parser;


class Parser : Frontend
{
public:
	dumpLex: bool;
	settings: Settings;
	errSink: ErrorSink;


public:
	this(settings: Settings, errSink: ErrorSink) { }
	fn parseNewFile(source: string, filename: string) ir.Module { }
	fn parseBlockStatement(tokens: ir.Token[], magicFlagD: bool) ir.BlockStatement { }
	fn parseStatements(source: string, loc: Location) ir.Node[] { }
	fn close() { }


protected:
	fn doDumpLex(ps: ParserStream) { }
}

fn checkError(ps: ParserStream, status: ParseStatus) { }

volt.semantic.languagepass

module volt.semantic.languagepass;


enum Mode
{
	Normal,
	RemoveConditionalsOnly,
	MissingDeps,
}

//! Default implementation of LanguagePass, replace this if you wish to any
//! of the semantics of the language.
class VoltLanguagePass : LanguagePass
{
public:
	//! Phases fields.
	passes1: Pass[];
	//! Phases fields.
	passes2: Pass[];
	//! Phases fields.
	passes3: Pass[];
	postParseImpl: PostParseImpl;


public:
	this(err: ErrorSink, drv: Driver, ver: VersionSet, target: TargetInfo, settings: Settings, frontend: Frontend, mode: Mode, warnings: bool) { }
	fn close() { }
	//! This functions sets up the pointers to the often used inbuilt classes,
	//! such as object.Object and object.TypeInfo. This needs to be called
	//! after the Driver is fully setup.
	fn setupOneTruePointers() { }
	fn addModule(m: ir.Module) { }
	fn getModule(name: ir.QualifiedName) ir.Module { }
	fn getModules() ir.Module[] { }
	fn startResolving(n: ir.Node) DoneDg { }
	fn startActualizing(n: ir.Node) DoneDg { }
	fn resolve(current: ir.Scope, userAttrs: ir.Attribute[]) { }
	fn resolve(current: ir.Scope, eref: ir.ExpReference) { }
	fn resolve(current: ir.Scope, a: ir.Attribute) { }
	fn resolve(current: ir.Scope, ti: ir.TemplateInstance) { }
	fn resolve(current: ir.Scope, ed: ir.EnumDeclaration) { }
	fn resolve(s: ir.Store) { }
	fn phase1(m: ir.Module) { }
	fn phase2(m: ir.Module) { }
	fn phase3(m: ir.Module) { }
	fn phase1(ms: ir.Module[]) { }
	fn phase2(ms: ir.Module[]) { }
	fn phase3(ms: ir.Module[]) { }
	fn resolve(current: ir.Scope, members: ir.TopLevelBlock) { }


protected:
	fn doResolve(current: ir.Scope, v: ir.Variable) { }
	fn doResolve(current: ir.Scope, func: ir.Function) { }
	fn doResolve(a: ir.Alias) { }
	fn doResolve(e: ir.Enum) { }
	fn doResolve(s: ir.Struct) { }
	fn doResolve(u: ir.Union) { }
	fn doResolve(c: ir.Class) { }
	fn doResolve(i: ir._Interface) { }
	fn doActualize(i: ir._Interface) { }
	fn doActualize(s: ir.Struct) { }
	fn doActualize(u: ir.Union) { }
	fn doActualize(c: ir.Class) { }
}

volt.llvm.driver

module volt.llvm.driver;


//! Settings for LLVMDriver.
class LLVMDriverSettings
{
public:
	ar: string;
	clang: string;
	linker: string;
	libFiles: string[];
	libraryPaths: string[];
	libraryFlags: string[];
	frameworkPaths: string[];
	frameworkNames: string[];
	xCC: string[];
	xLD: string[];
	xLink: string[];
	xClang: string[];
	xLinker: string[];
	linkWithCC: bool;
	linkWithLink: bool;


public:
	this() { }
}

//! The beckend part of the Driver that handles the backend and running of
//! the commands.
class LLVMDriver
{
public:
	d: Driver;
	lp: LanguagePass;
	tempMan: TempfileManager;
	target: TargetInfo;
	backend: Backend;
	ls: LLVMDriverSettings;


public:
	this(d: Driver, tm: TempfileManager, target: TargetInfo, lp: LanguagePass, backend: Backend, ls: LLVMDriverSettings) { }
	//! Make a single bitcode files out of all given modules and bitcode files.
	fn makeBitcode(of: string, mods: ir.Module[], bitcodeFiles: string[]) i32 { }
	//! Make a single object files out of all given modules and bitcode files.
	fn makeObject(of: string, mods: ir.Module[], bitcodeFiles: string[]) i32 { }
	//! Make a single ar archive out of all given modules, bitcode files and
	//! object files.
	fn makeArchive(of: string, mods: ir.Module[], bitcodeFiles: string[], objectFiles: string[]) i32 { }
	//! Run the native linker.
	fn doNativeLink(of: string, mods: ir.Module[], bitcodeFiles: string[], objectFiles: string[]) i32 { }


protected:
	fn turnModulesIntoResults(mods: ir.Module[], targetType: TargetType) BackendFileResult[] { }
	fn turnBitcodeIntoObject(bitcodeFiles: string[]) string[] { }
	fn turnResultsIntoFiles(results: BackendFileResult[], ending: string) string[] { }
	fn turnBitcodesIntoObjects(bitcodeFiles: string[]) string[] { }
	fn runClang(ls: LLVMDriverSettings, results: BackendFileResult[], bitcodeFiles: string[]) string[] { }
	fn runAr(ar: string, of: string, objectFiles: string[]) i32 { }
	fn runCC(ls: LLVMDriverSettings, of: string, objectFiles: string[]) i32 { }
	fn runLink(ls: LLVMDriverSettings, of: string, objectFiles: string[]) i32 { }
	fn getClangArgs(ls: LLVMDriverSettings) string[] { }
	fn checkClangReturn(result: i32) { }
}

volt.llvm.backend

//! Main module for the LLVM Backend.
module volt.llvm.backend;


//! Layout strings grabbed from clang.
enum layoutWinLinux32;
//! Layout strings grabbed from clang.
enum layoutWinLinux64;
//! Layout strings grabbed from clang.
enum layoutOSX32;
//! Layout strings grabbed from clang.
enum layoutOSX64;
//! Layout strings grabbed from clang.
enum layoutAArch64Linux64;
//! Layout strings grabbed from clang.
enum layoutARMHFLinux32;
//! Bare metal layout, grabbed from clang with target "X-pc-none-elf".
enum layoutMetal32;
//! Bare metal layout, grabbed from clang with target "X-pc-none-elf".
enum layoutMetal64;

//! Main interface for the Driver to the llvm backend.
class LlvmBackend : Backend
{
public:
	this(lp: LanguagePass, internalDebug: bool) { }
	fn close() { }
	fn supported() TargetType[] { }
	fn compileFile(m: ir.Module, type: TargetType, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) BackendFileResult { }
	fn compileHost(m: ir.Module, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) BackendHostResult { }
	fn compileState(m: ir.Module, ehPersonality: ir.Function, llvmTypeidFor: ir.Function, execDir: string, currentWorkingDir: string, identStr: string) VoltState { }


protected:
	lp: LanguagePass;
	target: TargetInfo;
	llvmTarget: LLVMTargetRef;
	llvmMachineTarget: LLVMTargetMachineRef;
	mDump: bool;
}

//! A llvm result that saves to bitcode files.
class BitcodeResult : BackendFileResult
{
public:
	this(backend: LlvmBackend, state: VoltState) { }
	fn close() { }
	fn saveToFile(filename: string) { }


protected:
	mBackend: LlvmBackend;
	mContext: LLVMContextRef;
	mMod: LLVMModuleRef;
}

//! Backend results that procudes a object file.
class ObjectResult : BitcodeResult
{
public:
	this(b: LlvmBackend, s: VoltState) { }
	fn saveToFile(filename: string) { }
}

//! Load a LLVMModuleRef into memory from file.
fn loadModule(ctx: LLVMContextRef, filename: string) LLVMModuleRef { }
//! Helper function to link several LLVM modules together.
fn linkModules(output: string, inputs: string[]) { }
//! Write the given module into a bitcode file.
fn writeBitcodeFile(target: TargetInfo, output: string, mod: LLVMModuleRef) { }
//! Read a bitcode file from disk, assemble and write the given it to the
//! given filename using the given target. The assemble type and file
//! format is decided by the given target.
fn writeObjectFile(target: TargetInfo, output: string, input: string) { }
//! Assemble and write the given module to the given filename using the
//! given target. The assemble type and file format is decided by the given
//! machine.
fn writeObjectFile(machine: LLVMTargetMachineRef, output: string, mod: LLVMModuleRef) { }
//! Create a target machine.
fn createTargetMachine(target: TargetInfo) LLVMTargetMachineRef { }
//! Used to select LLVMTarget.
fn getArchTarget(target: TargetInfo) string { }
//! Returns the llvm triple string for the given target.
fn getTriple(target: TargetInfo) string { }
//! Returns the llvm layout string for the given target.
fn getLayout(target: TargetInfo) string { }

volt.lowerer.image

//! Holds ImageGatherer and various code for dealing with per image
//! things.
module volt.lowerer.image;


//! Collects various things that needs to emitted per image.
class ImageGatherer : NullVisitor, Pass
{
public:
	lp: LanguagePass;
	thisModule: ir.Module;
	thisModuleTorNum: u32;
	emittedMain: bool;
	mainVolt: ir.Function;
	mainC: ir.Function;
	prefix: string;
	//! Array literals to be assigned to the global variables.
	globalConstructors: ir.ArrayLiteral;
	//! Array literals to be assigned to the global variables.
	globalDestructors: ir.ArrayLiteral;
	//! Array literals to be assigned to the global variables.
	localConstructors: ir.ArrayLiteral;
	//! Array literals to be assigned to the global variables.
	localDestructors: ir.ArrayLiteral;


public:
	this(lp: LanguagePass) { }
	//! Collect the tors from m and emit extern(C) main if needed.
	fn transform(m: ir.Module) { }
	//! Nothing to do.
	fn close() { }
	//! The emitting code is run on leave.
	fn leave(m: ir.Module) Status { }
	//! Collect any local/global constructors and find main function.
	fn enter(func: ir.Function) Status { }
	//! Helper function that creates a variable and adds it to thisModule.
	fn emitVariable(arr: ir.ArrayLiteral, name: string) { }
	//! Sets the correct mangled name on the tor and adds it to the
	//! ArrayLiteral.
	fn handleTor(arr: ir.ArrayLiteral, name: string, func: ir.Function) { }
	fn setLocations(loc: Location) { }
}

//! If func is the main function, add a C main next to it.
fn lowerCMain(lp: LanguagePass, mod: ir.Module, func: ir.Function) { }

volt.util.mangledecoder

module volt.util.mangledecoder;


//! Take the first n characters from s, advance s by n characters, and
//! return the result.
fn take(s: string, n: size_t) string { }
fn takeDigit(mangledString: string) i32 { }
fn takeNameSegment(mangledString: string, loc: Location) ir.Identifier { }
fn takeName(mangledString: string, loc: Location) ir.QualifiedName { }
fn mangledToDeclaration(mangledString: string, loc: Location) ir.Declaration { }
fn mangledToVariable(mangledString: string, loc: Location) ir.Variable { }
fn mangledToType(mangledString: string, loc: Location) ir.Type { }
fn mangleToCallable(mangledString: string, loc: Location) ir.CallableType { }

volta.visitor.visitor

module volta.visitor.visitor;


alias VisitorStop = Visitor.Status.Stop;
alias VisitorContinue = Visitor.Status.Continue;
alias VisitorContinueParent = Visitor.Status.ContinueParent;

class Visitor
{
public:
	enum Status
	{
		Stop,
		Continue,
		ContinueParent,
	}


public:
	alias Stop = Status.Stop;
	alias Continue = Status.Continue;
	alias ContinueParent = Status.ContinueParent;


public:
	this() { }
	fn visitingError(n: ir.Node, msg: string) Status;
	fn enter(m: ir.Module) Status;
	fn leave(m: ir.Module) Status;
	fn enter(tlb: ir.TopLevelBlock) Status;
	fn leave(tlb: ir.TopLevelBlock) Status;
	fn enter(i: ir.Import) Status;
	fn leave(i: ir.Import) Status;
	fn enter(u: ir.Unittest) Status;
	fn leave(u: ir.Unittest) Status;
	fn enter(c: ir.Class) Status;
	fn leave(c: ir.Class) Status;
	fn enter(i: ir._Interface) Status;
	fn leave(i: ir._Interface) Status;
	fn enter(s: ir.Struct) Status;
	fn leave(s: ir.Struct) Status;
	fn enter(c: ir.Union) Status;
	fn leave(c: ir.Union) Status;
	fn enter(d: ir.Variable) Status;
	fn leave(d: ir.Variable) Status;
	fn enter(fp: ir.FunctionParam) Status;
	fn leave(fp: ir.FunctionParam) Status;
	fn enter(e: ir.Enum) Status;
	fn leave(e: ir.Enum) Status;
	fn enter(c: ir.Condition) Status;
	fn leave(c: ir.Condition) Status;
	fn enter(ctl: ir.ConditionTopLevel) Status;
	fn leave(ctl: ir.ConditionTopLevel) Status;
	fn enter(mf: ir.MixinFunction) Status;
	fn leave(mf: ir.MixinFunction) Status;
	fn enter(mt: ir.MixinTemplate) Status;
	fn leave(mt: ir.MixinTemplate) Status;
	fn visit(qname: ir.QualifiedName) Status;
	fn visit(name: ir.Identifier) Status;
	fn enter(e: ir.ExpStatement) Status;
	fn leave(e: ir.ExpStatement) Status;
	fn enter(ret: ir.ReturnStatement) Status;
	fn leave(ret: ir.ReturnStatement) Status;
	fn enter(b: ir.BlockStatement) Status;
	fn leave(b: ir.BlockStatement) Status;
	fn enter(a: ir.AsmStatement) Status;
	fn leave(a: ir.AsmStatement) Status;
	fn enter(i: ir.IfStatement) Status;
	fn leave(i: ir.IfStatement) Status;
	fn enter(w: ir.WhileStatement) Status;
	fn leave(w: ir.WhileStatement) Status;
	fn enter(d: ir.DoStatement) Status;
	fn leave(d: ir.DoStatement) Status;
	fn enter(f: ir.ForStatement) Status;
	fn leave(f: ir.ForStatement) Status;
	fn enter(fes: ir.ForeachStatement) Status;
	fn leave(fes: ir.ForeachStatement) Status;
	fn enter(ls: ir.LabelStatement) Status;
	fn leave(ls: ir.LabelStatement) Status;
	fn enter(ss: ir.SwitchStatement) Status;
	fn leave(ss: ir.SwitchStatement) Status;
	fn enter(c: ir.SwitchCase) Status;
	fn leave(c: ir.SwitchCase) Status;
	fn enter(gs: ir.GotoStatement) Status;
	fn leave(gs: ir.GotoStatement) Status;
	fn enter(ws: ir.WithStatement) Status;
	fn leave(ws: ir.WithStatement) Status;
	fn enter(ss: ir.SynchronizedStatement) Status;
	fn leave(ss: ir.SynchronizedStatement) Status;
	fn enter(ts: ir.TryStatement) Status;
	fn leave(ts: ir.TryStatement) Status;
	fn enter(ts: ir.ThrowStatement) Status;
	fn leave(ts: ir.ThrowStatement) Status;
	fn enter(ss: ir.ScopeStatement) Status;
	fn leave(ss: ir.ScopeStatement) Status;
	fn enter(ps: ir.PragmaStatement) Status;
	fn leave(ps: ir.PragmaStatement) Status;
	fn enter(cs: ir.ConditionStatement) Status;
	fn leave(cs: ir.ConditionStatement) Status;
	fn enter(ms: ir.MixinStatement) Status;
	fn leave(ms: ir.MixinStatement) Status;
	fn enter(as: ir.AssertStatement) Status;
	fn leave(as: ir.AssertStatement) Status;
	fn visit(bs: ir.BreakStatement) Status;
	fn visit(cs: ir.ContinueStatement) Status;
	fn enter(pointer: ir.PointerType) Status;
	fn leave(pointer: ir.PointerType) Status;
	fn enter(array: ir.ArrayType) Status;
	fn leave(array: ir.ArrayType) Status;
	fn enter(array: ir.StaticArrayType) Status;
	fn leave(array: ir.StaticArrayType) Status;
	fn enter(array: ir.AAType) Status;
	fn leave(array: ir.AAType) Status;
	fn enter(array: ir.AmbiguousArrayType) Status;
	fn leave(array: ir.AmbiguousArrayType) Status;
	fn enter(func: ir.FunctionType) Status;
	fn leave(func: ir.FunctionType) Status;
	fn enter(func: ir.DelegateType) Status;
	fn leave(func: ir.DelegateType) Status;
	fn enter(func: ir.Function) Status;
	fn leave(func: ir.Function) Status;
	fn enter(type: ir.StorageType) Status;
	fn leave(type: ir.StorageType) Status;
	fn enter(attr: ir.Attribute) Status;
	fn leave(attr: ir.Attribute) Status;
	fn enter(a: ir.Alias) Status;
	fn leave(a: ir.Alias) Status;
	fn enter(typeOf: ir.TypeOf) Status;
	fn leave(typeOf: ir.TypeOf) Status;
	fn enter(ir.EnumDeclaration) Status;
	fn leave(ir.EnumDeclaration) Status;
	fn enter(ir.AliasStaticIf) Status;
	fn leave(ir.AliasStaticIf) Status;
	fn visit(it: ir.PrimitiveType) Status;
	fn visit(tr: ir.TypeReference) Status;
	fn visit(nt: ir.NullType) Status;
	fn visit(at: ir.AutoType) Status;
	fn visit(at: ir.NoType) Status;
	fn enter(ti: ir.TemplateInstance) Status;
	fn leave(ti: ir.TemplateInstance) Status;
	fn visit(td: ir.TemplateDefinition) Status;
	fn enter(ir.Exp, ir.Postfix) Visitor.Status;
	fn leave(ir.Exp, ir.Postfix) Visitor.Status;
	fn enter(ir.Exp, ir.Unary) Visitor.Status;
	fn leave(ir.Exp, ir.Unary) Visitor.Status;
	fn enter(ir.Exp, ir.BinOp) Visitor.Status;
	fn leave(ir.Exp, ir.BinOp) Visitor.Status;
	fn enter(ir.Exp, ir.Ternary) Visitor.Status;
	fn leave(ir.Exp, ir.Ternary) Visitor.Status;
	fn enter(ir.Exp, ir.ArrayLiteral) Visitor.Status;
	fn leave(ir.Exp, ir.ArrayLiteral) Visitor.Status;
	fn enter(ir.Exp, ir.AssocArray) Visitor.Status;
	fn leave(ir.Exp, ir.AssocArray) Visitor.Status;
	fn enter(ir.Exp, ir.Assert) Visitor.Status;
	fn leave(ir.Exp, ir.Assert) Visitor.Status;
	fn enter(ir.Exp, ir.StringImport) Visitor.Status;
	fn leave(ir.Exp, ir.StringImport) Visitor.Status;
	fn enter(ir.Exp, ir.Typeid) Visitor.Status;
	fn leave(ir.Exp, ir.Typeid) Visitor.Status;
	fn enter(ir.Exp, ir.IsExp) Visitor.Status;
	fn leave(ir.Exp, ir.IsExp) Visitor.Status;
	fn enter(ir.Exp, ir.FunctionLiteral) Visitor.Status;
	fn leave(ir.Exp, ir.FunctionLiteral) Visitor.Status;
	fn enter(ir.Exp, ir.StructLiteral) Visitor.Status;
	fn leave(ir.Exp, ir.StructLiteral) Visitor.Status;
	fn enter(ir.Exp, ir.UnionLiteral) Visitor.Status;
	fn leave(ir.Exp, ir.UnionLiteral) Visitor.Status;
	fn enter(ir.Exp, ir.ClassLiteral) Visitor.Status;
	fn leave(ir.Exp, ir.ClassLiteral) Visitor.Status;
	fn enter(ir.Exp, ir.Constant) Visitor.Status;
	fn leave(ir.Exp, ir.Constant) Visitor.Status;
	fn enter(ir.Exp, ir.TypeExp) Visitor.Status;
	fn leave(ir.Exp, ir.TypeExp) Visitor.Status;
	fn enter(ir.Exp, ir.StatementExp) Visitor.Status;
	fn leave(ir.Exp, ir.StatementExp) Visitor.Status;
	fn enter(ir.Exp, ir.VaArgExp) Visitor.Status;
	fn leave(ir.Exp, ir.VaArgExp) Visitor.Status;
	fn enter(ir.Exp, ir.PropertyExp) Visitor.Status;
	fn leave(ir.Exp, ir.PropertyExp) Visitor.Status;
	fn enter(ir.Exp, ir.BuiltinExp) Visitor.Status;
	fn leave(ir.Exp, ir.BuiltinExp) Visitor.Status;
	fn enter(ir.Exp, ir.AccessExp) Visitor.Status;
	fn leave(ir.Exp, ir.AccessExp) Visitor.Status;
	fn enter(ir.Exp, ir.RunExp) Visitor.Status;
	fn leave(ir.Exp, ir.RunExp) Visitor.Status;
	fn enter(ir.Exp, ir.ComposableString) Visitor.Status;
	fn leave(ir.Exp, ir.ComposableString) Visitor.Status;
	fn visit(ir.Exp, ir.IdentifierExp) Visitor.Status;
	fn visit(ir.Exp, ir.ExpReference) Visitor.Status;
	fn visit(ir.Exp, ir.TokenExp) Visitor.Status;
	fn visit(ir.Exp, ir.StoreExp) Visitor.Status;
}

//! A visitor that does nothing.
class NullVisitor : Visitor
{
public:
	this() { }
	fn visitingError(n: ir.Node, msg: string) Status { }
	fn enter(m: ir.Module) Status { }
	fn leave(m: ir.Module) Status { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn leave(tlb: ir.TopLevelBlock) Status { }
	fn enter(i: ir.Import) Status { }
	fn leave(i: ir.Import) Status { }
	fn enter(u: ir.Unittest) Status { }
	fn leave(u: ir.Unittest) Status { }
	fn enter(c: ir.Class) Status { }
	fn leave(c: ir.Class) Status { }
	fn enter(i: ir._Interface) Status { }
	fn leave(i: ir._Interface) Status { }
	fn enter(u: ir.Union) Status { }
	fn leave(u: ir.Union) Status { }
	fn enter(s: ir.Struct) Status { }
	fn leave(s: ir.Struct) Status { }
	fn enter(d: ir.Variable) Status { }
	fn leave(d: ir.Variable) Status { }
	fn enter(fp: ir.FunctionParam) Status { }
	fn leave(fp: ir.FunctionParam) Status { }
	fn enter(e: ir.Enum) Status { }
	fn leave(e: ir.Enum) Status { }
	fn enter(c: ir.Condition) Status { }
	fn leave(c: ir.Condition) Status { }
	fn enter(ctl: ir.ConditionTopLevel) Status { }
	fn leave(ctl: ir.ConditionTopLevel) Status { }
	fn enter(mf: ir.MixinFunction) Status { }
	fn leave(mf: ir.MixinFunction) Status { }
	fn enter(mt: ir.MixinTemplate) Status { }
	fn leave(mt: ir.MixinTemplate) Status { }
	fn visit(qname: ir.QualifiedName) Status { }
	fn visit(name: ir.Identifier) Status { }
	fn enter(e: ir.ExpStatement) Status { }
	fn leave(e: ir.ExpStatement) Status { }
	fn enter(ret: ir.ReturnStatement) Status { }
	fn leave(ret: ir.ReturnStatement) Status { }
	fn enter(b: ir.BlockStatement) Status { }
	fn leave(b: ir.BlockStatement) Status { }
	fn enter(a: ir.AsmStatement) Status { }
	fn leave(a: ir.AsmStatement) Status { }
	fn enter(i: ir.IfStatement) Status { }
	fn leave(i: ir.IfStatement) Status { }
	fn enter(w: ir.WhileStatement) Status { }
	fn leave(w: ir.WhileStatement) Status { }
	fn enter(d: ir.DoStatement) Status { }
	fn leave(d: ir.DoStatement) Status { }
	fn enter(f: ir.ForStatement) Status { }
	fn leave(f: ir.ForStatement) Status { }
	fn enter(fes: ir.ForeachStatement) Status { }
	fn leave(fes: ir.ForeachStatement) Status { }
	fn enter(ls: ir.LabelStatement) Status { }
	fn leave(ls: ir.LabelStatement) Status { }
	fn enter(ss: ir.SwitchStatement) Status { }
	fn leave(ss: ir.SwitchStatement) Status { }
	fn enter(c: ir.SwitchCase) Status { }
	fn leave(c: ir.SwitchCase) Status { }
	fn enter(gs: ir.GotoStatement) Status { }
	fn leave(gs: ir.GotoStatement) Status { }
	fn enter(ws: ir.WithStatement) Status { }
	fn leave(ws: ir.WithStatement) Status { }
	fn enter(ss: ir.SynchronizedStatement) Status { }
	fn leave(ss: ir.SynchronizedStatement) Status { }
	fn enter(ts: ir.TryStatement) Status { }
	fn leave(ts: ir.TryStatement) Status { }
	fn enter(ts: ir.ThrowStatement) Status { }
	fn leave(ts: ir.ThrowStatement) Status { }
	fn enter(ss: ir.ScopeStatement) Status { }
	fn leave(ss: ir.ScopeStatement) Status { }
	fn enter(ps: ir.PragmaStatement) Status { }
	fn leave(ps: ir.PragmaStatement) Status { }
	fn enter(cs: ir.ConditionStatement) Status { }
	fn leave(cs: ir.ConditionStatement) Status { }
	fn enter(ms: ir.MixinStatement) Status { }
	fn leave(ms: ir.MixinStatement) Status { }
	fn enter(as: ir.AssertStatement) Status { }
	fn leave(as: ir.AssertStatement) Status { }
	fn visit(cs: ir.ContinueStatement) Status { }
	fn visit(bs: ir.BreakStatement) Status { }
	fn enter(pointer: ir.PointerType) Status { }
	fn leave(pointer: ir.PointerType) Status { }
	fn enter(array: ir.ArrayType) Status { }
	fn leave(array: ir.ArrayType) Status { }
	fn enter(array: ir.StaticArrayType) Status { }
	fn leave(array: ir.StaticArrayType) Status { }
	fn enter(array: ir.AAType) Status { }
	fn leave(array: ir.AAType) Status { }
	fn enter(array: ir.AmbiguousArrayType) Status { }
	fn leave(array: ir.AmbiguousArrayType) Status { }
	fn enter(func: ir.FunctionType) Status { }
	fn leave(func: ir.FunctionType) Status { }
	fn enter(func: ir.DelegateType) Status { }
	fn leave(func: ir.DelegateType) Status { }
	fn enter(func: ir.Function) Status { }
	fn leave(func: ir.Function) Status { }
	fn enter(type: ir.StorageType) Status { }
	fn leave(type: ir.StorageType) Status { }
	fn enter(attr: ir.Attribute) Status { }
	fn leave(attr: ir.Attribute) Status { }
	fn enter(a: ir.Alias) Status { }
	fn leave(a: ir.Alias) Status { }
	fn enter(to: ir.TypeOf) Status { }
	fn leave(to: ir.TypeOf) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn leave(ed: ir.EnumDeclaration) Status { }
	fn enter(asi: ir.AliasStaticIf) Status { }
	fn leave(asi: ir.AliasStaticIf) Status { }
	fn enter(ti: ir.TemplateInstance) Status { }
	fn leave(ti: ir.TemplateInstance) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn visit(it: ir.PrimitiveType) Status { }
	fn visit(tr: ir.TypeReference) Status { }
	fn visit(nt: ir.NullType) Status { }
	fn visit(at: ir.AutoType) Status { }
	fn visit(at: ir.NoType) Status { }
	fn enter(ir.Exp, ir.Postfix) Status { }
	fn leave(ir.Exp, ir.Postfix) Status { }
	fn enter(ir.Exp, ir.Unary) Status { }
	fn leave(ir.Exp, ir.Unary) Status { }
	fn enter(ir.Exp, ir.BinOp) Status { }
	fn leave(ir.Exp, ir.BinOp) Status { }
	fn enter(ir.Exp, ir.Ternary) Status { }
	fn leave(ir.Exp, ir.Ternary) Status { }
	fn enter(ir.Exp, ir.ArrayLiteral) Status { }
	fn leave(ir.Exp, ir.ArrayLiteral) Status { }
	fn enter(ir.Exp, ir.AssocArray) Status { }
	fn leave(ir.Exp, ir.AssocArray) Status { }
	fn enter(ir.Exp, ir.Assert) Status { }
	fn leave(ir.Exp, ir.Assert) Status { }
	fn enter(ir.Exp, ir.StringImport) Status { }
	fn leave(ir.Exp, ir.StringImport) Status { }
	fn enter(ir.Exp, ir.Typeid) Status { }
	fn leave(ir.Exp, ir.Typeid) Status { }
	fn enter(ir.Exp, ir.IsExp) Status { }
	fn leave(ir.Exp, ir.IsExp) Status { }
	fn enter(ir.Exp, ir.FunctionLiteral) Status { }
	fn leave(ir.Exp, ir.FunctionLiteral) Status { }
	fn enter(ir.Exp, ir.StructLiteral) Status { }
	fn leave(ir.Exp, ir.StructLiteral) Status { }
	fn enter(ir.Exp, ir.UnionLiteral) Status { }
	fn leave(ir.Exp, ir.UnionLiteral) Status { }
	fn enter(ir.Exp, ir.ClassLiteral) Status { }
	fn leave(ir.Exp, ir.ClassLiteral) Status { }
	fn enter(ir.Exp, ir.Constant) Status { }
	fn leave(ir.Exp, ir.Constant) Status { }
	fn enter(ir.Exp, ir.TypeExp) Status { }
	fn leave(ir.Exp, ir.TypeExp) Status { }
	fn enter(ir.Exp, ir.StatementExp) Status { }
	fn leave(ir.Exp, ir.StatementExp) Status { }
	fn enter(ir.Exp, ir.VaArgExp) Status { }
	fn leave(ir.Exp, ir.VaArgExp) Status { }
	fn enter(ir.Exp, ir.PropertyExp) Status { }
	fn leave(ir.Exp, ir.PropertyExp) Status { }
	fn enter(ir.Exp, ir.BuiltinExp) Status { }
	fn leave(ir.Exp, ir.BuiltinExp) Status { }
	fn enter(ir.Exp, ir.AccessExp) Status { }
	fn leave(ir.Exp, ir.AccessExp) Status { }
	fn enter(ir.Exp, ir.RunExp) Status { }
	fn leave(ir.Exp, ir.RunExp) Status { }
	fn enter(ir.Exp, ir.ComposableString) Status { }
	fn leave(ir.Exp, ir.ComposableString) Status { }
	fn visit(ir.Exp, ir.ExpReference) Status { }
	fn visit(ir.Exp, ir.IdentifierExp) Status { }
	fn visit(ir.Exp, ir.TokenExp) Status { }
	fn visit(ir.Exp, ir.StoreExp) Status { }
}

//! Helper function that returns VistorContinue if @s is
//! VisitorContinueParent, used to abort a leaf node, but not the whole
//! tree.
fn parentContinue(s: Visitor.Status) Visitor.Status { }
fn accept(n: ir.Node, av: Visitor) Visitor.Status { }
fn acceptExp(exp: ir.Exp, av: Visitor) Visitor.Status { }
fn acceptModule(m: ir.Module, av: Visitor) Visitor.Status { }
fn acceptTopLevelBlock(tlb: ir.TopLevelBlock, av: Visitor) Visitor.Status { }
fn acceptImport(i: ir.Import, av: Visitor) Visitor.Status { }
fn acceptVariable(d: ir.Variable, av: Visitor) Visitor.Status { }
fn acceptFunctionParam(fp: ir.FunctionParam, av: Visitor) Visitor.Status { }
fn acceptUnittest(u: ir.Unittest, av: Visitor) Visitor.Status { }
fn acceptClass(c: ir.Class, av: Visitor) Visitor.Status { }
fn acceptInterface(i: ir._Interface, av: Visitor) Visitor.Status { }
fn acceptStruct(s: ir.Struct, av: Visitor) Visitor.Status { }
fn acceptUnion(u: ir.Union, av: Visitor) Visitor.Status { }
fn acceptEnum(e: ir.Enum, av: Visitor) Visitor.Status { }
fn acceptCondition(c: ir.Condition, av: Visitor) Visitor.Status { }
fn acceptConditionTopLevel(ctl: ir.ConditionTopLevel, av: Visitor) Visitor.Status { }
fn acceptMixinFunction(mf: ir.MixinFunction, av: Visitor) Visitor.Status { }
fn acceptMixinTemplate(mt: ir.MixinTemplate, av: Visitor) Visitor.Status { }
fn acceptAttribute(attr: ir.Attribute, av: Visitor) Visitor.Status { }
fn acceptAlias(a: ir.Alias, av: Visitor) Visitor.Status { }
fn acceptTypeOf(typeOf: ir.TypeOf, av: Visitor) Visitor.Status { }
fn acceptStorageType(type: ir.StorageType, av: Visitor) Visitor.Status { }
fn acceptPointerType(pointer: ir.PointerType, av: Visitor) Visitor.Status { }
fn acceptArrayType(array: ir.ArrayType, av: Visitor) Visitor.Status { }
fn acceptAmbiguousArrayType(array: ir.AmbiguousArrayType, av: Visitor) Visitor.Status { }
fn acceptStaticArrayType(array: ir.StaticArrayType, av: Visitor) Visitor.Status { }
fn acceptAAType(array: ir.AAType, av: Visitor) Visitor.Status { }
fn acceptFunctionType(func: ir.FunctionType, av: Visitor) Visitor.Status { }
fn acceptDelegateType(func: ir.DelegateType, av: Visitor) Visitor.Status { }
fn acceptFunction(func: ir.Function, av: Visitor) Visitor.Status { }
fn acceptEnumDeclaration(ed: ir.EnumDeclaration, av: Visitor) Visitor.Status { }
fn acceptAliasStaticIf(asi: ir.AliasStaticIf, av: Visitor) Visitor.Status { }
fn acceptExpStatement(e: ir.ExpStatement, av: Visitor) Visitor.Status { }
fn acceptReturnStatement(ret: ir.ReturnStatement, av: Visitor) Visitor.Status { }
fn acceptBlockStatement(b: ir.BlockStatement, av: Visitor) Visitor.Status { }
fn acceptAsmStatement(a: ir.AsmStatement, av: Visitor) Visitor.Status { }
fn acceptIfStatement(i: ir.IfStatement, av: Visitor) Visitor.Status { }
fn acceptWhileStatement(w: ir.WhileStatement, av: Visitor) Visitor.Status { }
fn acceptDoStatement(d: ir.DoStatement, av: Visitor) Visitor.Status { }
fn acceptForStatement(f: ir.ForStatement, av: Visitor) Visitor.Status { }
fn acceptForeachStatement(fes: ir.ForeachStatement, av: Visitor) Visitor.Status { }
fn acceptLabelStatement(ls: ir.LabelStatement, av: Visitor) Visitor.Status { }
fn acceptSwitchStatement(ss: ir.SwitchStatement, av: Visitor) Visitor.Status { }
fn acceptSwitchCase(sc: ir.SwitchCase, av: Visitor) Visitor.Status { }
fn acceptGotoStatement(gs: ir.GotoStatement, av: Visitor) Visitor.Status { }
fn acceptWithStatement(ws: ir.WithStatement, av: Visitor) Visitor.Status { }
fn acceptSynchronizedStatement(ss: ir.SynchronizedStatement, av: Visitor) Visitor.Status { }
fn acceptTryStatement(ts: ir.TryStatement, av: Visitor) Visitor.Status { }
fn acceptThrowStatement(ts: ir.ThrowStatement, av: Visitor) Visitor.Status { }
fn acceptScopeStatement(ss: ir.ScopeStatement, av: Visitor) Visitor.Status { }
fn acceptPragmaStatement(ps: ir.PragmaStatement, av: Visitor) Visitor.Status { }
fn acceptConditionStatement(cs: ir.ConditionStatement, av: Visitor) Visitor.Status { }
fn acceptAssertStatement(as: ir.AssertStatement, av: Visitor) Visitor.Status { }
fn acceptMixinStatement(ms: ir.MixinStatement, av: Visitor) Visitor.Status { }
fn acceptPostfix(exp: ir.Exp, postfix: ir.Postfix, av: Visitor) Visitor.Status { }
fn acceptUnary(exp: ir.Exp, unary: ir.Unary, av: Visitor) Visitor.Status { }
fn acceptBinOp(exp: ir.Exp, binop: ir.BinOp, av: Visitor) Visitor.Status { }
fn acceptTernary(exp: ir.Exp, ternary: ir.Ternary, av: Visitor) Visitor.Status { }
fn acceptArrayLiteral(exp: ir.Exp, array: ir.ArrayLiteral, av: Visitor) Visitor.Status { }
fn acceptAssocArray(exp: ir.Exp, array: ir.AssocArray, av: Visitor) Visitor.Status { }
fn acceptAssert(exp: ir.Exp, _assert: ir.Assert, av: Visitor) Visitor.Status { }
fn acceptStringImport(exp: ir.Exp, strimport: ir.StringImport, av: Visitor) Visitor.Status { }
fn acceptTypeid(exp: ir.Exp, ti: ir.Typeid, av: Visitor) Visitor.Status { }
fn acceptIsExp(exp: ir.Exp, isExp: ir.IsExp, av: Visitor) Visitor.Status { }
fn acceptFunctionLiteral(exp: ir.Exp, functionLiteral: ir.FunctionLiteral, av: Visitor) Visitor.Status { }
fn acceptStructLiteral(exp: ir.Exp, sliteral: ir.StructLiteral, av: Visitor) Visitor.Status { }
fn acceptUnionLiteral(exp: ir.Exp, uliteral: ir.UnionLiteral, av: Visitor) Visitor.Status { }
fn acceptClassLiteral(exp: ir.Exp, cliteral: ir.ClassLiteral, av: Visitor) Visitor.Status { }
fn acceptTypeExp(exp: ir.Exp, texp: ir.TypeExp, av: Visitor) Visitor.Status { }
fn acceptStoreExp(exp: ir.Exp, sexp: ir.StoreExp, av: Visitor) Visitor.Status { }
fn acceptStatementExp(exp: ir.Exp, state: ir.StatementExp, av: Visitor) Visitor.Status { }
fn acceptTokenExp(exp: ir.Exp, fexp: ir.TokenExp, av: Visitor) Visitor.Status { }
fn acceptVaArgExp(exp: ir.Exp, vaexp: ir.VaArgExp, av: Visitor) Visitor.Status { }
fn acceptPropertyExp(exp: ir.Exp, prop: ir.PropertyExp, av: Visitor) Visitor.Status { }
fn acceptBuiltinExp(exp: ir.Exp, inbuilt: ir.BuiltinExp, av: Visitor) Visitor.Status { }
fn acceptAccessExp(exp: ir.Exp, ae: ir.AccessExp, av: Visitor) Visitor.Status { }
fn acceptRunExp(exp: ir.Exp, runexp: ir.RunExp, av: Visitor) Visitor.Status { }
fn acceptComposableString(exp: ir.Exp, cs: ir.ComposableString, av: Visitor) Visitor.Status { }
fn acceptExpReference(exp: ir.Exp, expref: ir.ExpReference, av: Visitor) Visitor.Status { }
fn acceptConstant(exp: ir.Exp, constant: ir.Constant, av: Visitor) Visitor.Status { }
fn acceptIdentifierExp(exp: ir.Exp, identifier: ir.IdentifierExp, av: Visitor) Visitor.Status { }
fn acceptTemplateInstance(ti: ir.TemplateInstance, av: Visitor) Visitor.Status { }
fn acceptTemplateDefinition(td: ir.TemplateDefinition, av: Visitor) Visitor.Status { }

volt.visitor.prettyprinter

module volt.visitor.prettyprinter;


class PrettyPrinter : Visitor, Pass
{
public:
	this(indentText: string, sink: void delegate(scope (const(scope (char)[]))) { }
	fn close() { }
	fn visitingError(n: ir.Node, msg: string) Status { }
	fn transform(m: ir.Module) { }
	fn transformType(t: ir.Type) { }
	fn visit(i: ir.Identifier) Status { }
	fn visit(qname: ir.QualifiedName) Status { }
	fn enter(m: ir.Module) Status { }
	fn leave(m: ir.Module) Status { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn leave(tlb: ir.TopLevelBlock) Status { }
	fn enter(i: ir.Import) Status { }
	fn leave(i: ir.Import) Status { }
	fn enter(u: ir.Unittest) Status { }
	fn leave(u: ir.Unittest) Status { }
	fn enter(c: ir.Class) Status { }
	fn leave(c: ir.Class) Status { }
	fn enter(i: ir._Interface) Status { }
	fn leave(i: ir._Interface) Status { }
	fn enter(s: ir.Struct) Status { }
	fn leave(s: ir.Struct) Status { }
	fn enter(u: ir.Union) Status { }
	fn leave(u: ir.Union) Status { }
	fn enter(d: ir.Variable) Status { }
	fn leave(d: ir.Variable) Status { }
	fn enter(fp: ir.FunctionParam) Status { }
	fn leave(fp: ir.FunctionParam) Status { }
	fn enter(e: ir.Enum) Status { }
	fn leave(e: ir.Enum) Status { }
	fn enter(attr: ir.Attribute) Status { }
	fn leave(attr: ir.Attribute) Status { }
	fn enter(mf: ir.MixinFunction) Status { }
	fn leave(mf: ir.MixinFunction) Status { }
	fn enter(mt: ir.MixinTemplate) Status { }
	fn leave(mt: ir.MixinTemplate) Status { }
	fn enter(c: ir.Condition) Status { }
	fn leave(c: ir.Condition) Status { }
	fn enter(ctl: ir.ConditionTopLevel) Status { }
	fn leave(ctl: ir.ConditionTopLevel) Status { }
	fn enter(e: ir.ExpStatement) Status { }
	fn leave(e: ir.ExpStatement) Status { }
	fn enter(ret: ir.ReturnStatement) Status { }
	fn leave(ret: ir.ReturnStatement) Status { }
	fn enter(b: ir.BlockStatement) Status { }
	fn leave(b: ir.BlockStatement) Status { }
	fn enter(a: ir.AsmStatement) Status { }
	fn leave(a: ir.AsmStatement) Status { }
	fn enter(i: ir.IfStatement) Status { }
	fn leave(i: ir.IfStatement) Status { }
	fn enter(w: ir.WhileStatement) Status { }
	fn leave(w: ir.WhileStatement) Status { }
	fn enter(d: ir.DoStatement) Status { }
	fn leave(d: ir.DoStatement) Status { }
	fn enter(fes: ir.ForeachStatement) Status { }
	fn leave(fes: ir.ForeachStatement) Status { }
	fn enter(f: ir.ForStatement) Status { }
	fn leave(f: ir.ForStatement) Status { }
	fn enter(ss: ir.SwitchStatement) Status { }
	fn leave(ss: ir.SwitchStatement) Status { }
	fn enter(sc: ir.SwitchCase) Status { }
	fn leave(sc: ir.SwitchCase) Status { }
	fn enter(ls: ir.LabelStatement) Status { }
	fn leave(ls: ir.LabelStatement) Status { }
	fn visit(cs: ir.ContinueStatement) Status { }
	fn visit(bs: ir.BreakStatement) Status { }
	fn enter(gs: ir.GotoStatement) Status { }
	fn leave(gs: ir.GotoStatement) Status { }
	fn enter(ws: ir.WithStatement) Status { }
	fn leave(ws: ir.WithStatement) Status { }
	fn enter(ss: ir.SynchronizedStatement) Status { }
	fn leave(ss: ir.SynchronizedStatement) Status { }
	fn enter(ts: ir.TryStatement) Status { }
	fn leave(ts: ir.TryStatement) Status { }
	fn enter(ts: ir.ThrowStatement) Status { }
	fn leave(ts: ir.ThrowStatement) Status { }
	fn enter(ss: ir.ScopeStatement) Status { }
	fn leave(ss: ir.ScopeStatement) Status { }
	fn enter(ps: ir.PragmaStatement) Status { }
	fn leave(ps: ir.PragmaStatement) Status { }
	fn enter(cs: ir.ConditionStatement) Status { }
	fn leave(cs: ir.ConditionStatement) Status { }
	fn enter(as: ir.AssertStatement) Status { }
	fn leave(as: ir.AssertStatement) Status { }
	fn enter(ms: ir.MixinStatement) Status { }
	fn leave(ms: ir.MixinStatement) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn leave(ed: ir.EnumDeclaration) Status { }
	fn enter(pointer: ir.PointerType) Status { }
	fn leave(pointer: ir.PointerType) Status { }
	fn visit(nullType: ir.NullType) Status { }
	fn enter(array: ir.ArrayType) Status { }
	fn leave(array: ir.ArrayType) Status { }
	fn enter(array: ir.StaticArrayType) Status { }
	fn leave(array: ir.StaticArrayType) Status { }
	fn enter(array: ir.AmbiguousArrayType) Status { }
	fn leave(array: ir.AmbiguousArrayType) Status { }
	fn enter(array: ir.AAType) Status { }
	fn enter(func: ir.FunctionType) Status { }
	fn leave(func: ir.FunctionType) Status { }
	fn enter(func: ir.DelegateType) Status { }
	fn leave(func: ir.DelegateType) Status { }
	fn leave(array: ir.AAType) Status { }
	fn enter(func: ir.Function) Status { }
	fn leave(func: ir.Function) Status { }
	fn enter(type: ir.StorageType) Status { }
	fn leave(type: ir.StorageType) Status { }
	fn visit(at: ir.AutoType) Status { }
	fn visit(at: ir.NoType) Status { }
	fn enter(asi: ir.AliasStaticIf) Status { }
	fn leave(asi: ir.AliasStaticIf) Status { }
	fn enter(a: ir.Alias) Status { }
	fn leave(a: ir.Alias) Status { }
	fn enter(typeOf: ir.TypeOf) Status { }
	fn leave(typeOf: ir.TypeOf) Status { }
	fn enter(ti: ir.TemplateInstance) Status { }
	fn leave(ti: ir.TemplateInstance) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn enter(ir.Exp, constant: ir.Constant) Status { }
	fn leave(ir.Exp, ir.Constant) Status { }
	fn visit(ir.Exp, identifier: ir.IdentifierExp) Status { }
	fn enter(ir.Exp, array: ir.ArrayLiteral) Status { }
	fn leave(ir.Exp, array: ir.ArrayLiteral) Status { }
	fn enter(ir.Exp, array: ir.AssocArray) Status { }
	fn leave(ir.Exp, array: ir.AssocArray) Status { }
	fn enter(ir.Exp, _assert: ir.Assert) Status { }
	fn leave(ir.Exp, _assert: ir.Assert) Status { }
	fn enter(ir.Exp, strimport: ir.StringImport) Status { }
	fn leave(ir.Exp, strimport: ir.StringImport) Status { }
	fn enter(ir.Exp, ternary: ir.Ternary) Status { }
	fn leave(ir.Exp, ternary: ir.Ternary) Status { }
	fn enter(ir.Exp, binop: ir.BinOp) Status { }
	fn leave(ir.Exp, binop: ir.BinOp) Status { }
	fn enter(ir.Exp, unary: ir.Unary) Status { }
	fn leave(ir.Exp, unary: ir.Unary) Status { }
	fn leave(ir.Exp, postfix: ir.Postfix) Status { }
	fn enter(ir.Exp, postfix: ir.Postfix) Status { }
	fn enter(exp: ir.Exp, prop: ir.PropertyExp) Status { }
	fn leave(ir.Exp, ir.PropertyExp) Status { }
	fn enter(exp: ir.Exp, inbuilt: ir.BuiltinExp) Status { }
	fn leave(ir.Exp, ir.BuiltinExp) Status { }
	fn enter(exp: ir.Exp, ae: ir.AccessExp) Status { }
	fn leave(exp: ir.Exp, ae: ir.AccessExp) Status { }
	fn enter(exp: ir.Exp, runexp: ir.RunExp) Status { }
	fn leave(exp: ir.Exp, runexp: ir.RunExp) Status { }
	fn enter(exp: ir.Exp, cs: ir.ComposableString) Status { }
	fn leave(exp: ir.Exp, cs: ir.ComposableString) Status { }
	fn enter(ir.Exp, ti: ir.Typeid) Status { }
	fn leave(ir.Exp, ti: ir.Typeid) Status { }
	fn enter(ir.Exp, isExp: ir.IsExp) Status { }
	fn leave(ir.Exp, isExp: ir.IsExp) Status { }
	fn enter(ir.Exp, functionLiteral: ir.FunctionLiteral) Status { }
	fn leave(ir.Exp, functionLiteral: ir.FunctionLiteral) Status { }
	fn enter(ir.Exp, sliteral: ir.StructLiteral) Status { }
	fn leave(ir.Exp, sliteral: ir.StructLiteral) Status { }
	fn enter(ir.Exp, sliteral: ir.UnionLiteral) Status { }
	fn leave(ir.Exp, sliteral: ir.UnionLiteral) Status { }
	fn enter(ir.Exp, cliteral: ir.ClassLiteral) Status { }
	fn leave(ir.Exp, cliteral: ir.ClassLiteral) Status { }
	fn enter(ir.Exp, texp: ir.TypeExp) Status { }
	fn leave(ir.Exp, texp: ir.TypeExp) Status { }
	fn enter(ir.Exp, statExp: ir.StatementExp) Status { }
	fn leave(ir.Exp, state: ir.StatementExp) Status { }
	fn enter(ir.Exp, vaexp: ir.VaArgExp) Status { }
	fn leave(ir.Exp, vaexp: ir.VaArgExp) Status { }
	fn visit(ir.Exp, e: ir.ExpReference) Status { }
	fn visit(ir.Exp, fexp: ir.TokenExp) Status { }
	fn visit(ir.Exp, e: ir.StoreExp) Status { }
	fn visit(type: ir.PrimitiveType) Status { }
	fn visit(tr: ir.TypeReference) Status { }


protected:
	mFilename: string;
	mStream: OutputStream;
	mSink: void delegate(scope (const(scope (char)[]));
	mIndent: i32;
	mIndentText: string;
	mPrintingTemplateDefinition: i32;


protected:
	fn internalPrintBlock(bs: ir.BlockStatement) { }
	fn wf(qn: ir.QualifiedName) { }
	fn t() { }
	fn twf(strings: string[]) { }
	fn twfln(strings: string[]) { }
	fn wf(strings: string[]) { }
	fn wf(i: i32) { }
	fn wf(i: u32) { }
	fn wf(l: i64) { }
	fn wf(i: u64) { }
	fn wfln(str: string) { }
	fn ln() { }
	//! Print storage types.
	fn wStorageTypes(t: ir.Type) { }
	fn wAfterStorageTypes(t: ir.Type) { }
}

fn prettyPrinter(m: ir.Module) { }

volt.visitor.debugprinter

module volt.visitor.debugprinter;


class DebugMarker : Pass
{
public:
	this(text: string) { }
	fn transform(m: ir.Module) { }
	fn close() { }


protected:
	mText: string;
}

class DebugPrinter : Visitor, Pass
{
public:
	this(indentText: string, sink: void delegate(scope (const(scope (char)[]))) { }
	fn visitingError(n: ir.Node, msg: string) Status { }
	fn close() { }
	fn transform(m: ir.Module) { }
	fn transformExp(exp: ir.Exp) { }
	fn transformNode(n: ir.Node) { }
	fn leave(n: ir.Module) Status { }
	fn enter(n: ir.TopLevelBlock) Status { }
	fn leave(n: ir.TopLevelBlock) Status { }
	fn enter(n: ir.Import) Status { }
	fn leave(n: ir.Import) Status { }
	fn enter(n: ir.Unittest) Status { }
	fn leave(n: ir.Unittest) Status { }
	fn enter(n: ir.Class) Status { }
	fn leave(n: ir.Class) Status { }
	fn enter(n: ir._Interface) Status { }
	fn leave(n: ir._Interface) Status { }
	fn enter(n: ir.Struct) Status { }
	fn leave(n: ir.Struct) Status { }
	fn enter(n: ir.Union) Status { }
	fn leave(n: ir.Union) Status { }
	fn enter(n: ir.Variable) Status { }
	fn leave(n: ir.Variable) Status { }
	fn enter(n: ir.FunctionParam) Status { }
	fn leave(n: ir.FunctionParam) Status { }
	fn enter(n: ir.Enum) Status { }
	fn leave(n: ir.Enum) Status { }
	fn enter(n: ir.Condition) Status { }
	fn leave(n: ir.Condition) Status { }
	fn enter(n: ir.ConditionTopLevel) Status { }
	fn leave(n: ir.ConditionTopLevel) Status { }
	fn leave(n: ir.MixinFunction) Status { }
	fn leave(n: ir.MixinTemplate) Status { }
	fn visit(n: ir.QualifiedName) Status { }
	fn enter(n: ir.Module) Status { }
	fn enter(n: ir.MixinFunction) Status { }
	fn enter(n: ir.MixinTemplate) Status { }
	fn visit(n: ir.Identifier) Status { }
	fn enter(n: ir.ExpStatement) Status { }
	fn leave(n: ir.ExpStatement) Status { }
	fn enter(n: ir.ReturnStatement) Status { }
	fn leave(n: ir.ReturnStatement) Status { }
	fn enter(n: ir.BlockStatement) Status { }
	fn leave(n: ir.BlockStatement) Status { }
	fn enter(n: ir.AsmStatement) Status { }
	fn leave(n: ir.AsmStatement) Status { }
	fn enter(n: ir.IfStatement) Status { }
	fn leave(n: ir.IfStatement) Status { }
	fn enter(n: ir.WhileStatement) Status { }
	fn leave(n: ir.WhileStatement) Status { }
	fn enter(n: ir.DoStatement) Status { }
	fn leave(n: ir.DoStatement) Status { }
	fn enter(n: ir.ForStatement) Status { }
	fn leave(n: ir.ForStatement) Status { }
	fn enter(n: ir.ForeachStatement) Status { }
	fn leave(n: ir.ForeachStatement) Status { }
	fn enter(n: ir.LabelStatement) Status { }
	fn leave(n: ir.LabelStatement) Status { }
	fn enter(n: ir.SwitchStatement) Status { }
	fn leave(n: ir.SwitchStatement) Status { }
	fn enter(n: ir.SwitchCase) Status { }
	fn leave(n: ir.SwitchCase) Status { }
	fn enter(n: ir.GotoStatement) Status { }
	fn leave(n: ir.GotoStatement) Status { }
	fn enter(n: ir.WithStatement) Status { }
	fn leave(n: ir.WithStatement) Status { }
	fn enter(n: ir.SynchronizedStatement) Status { }
	fn leave(n: ir.SynchronizedStatement) Status { }
	fn enter(n: ir.TryStatement) Status { }
	fn leave(n: ir.TryStatement) Status { }
	fn enter(n: ir.ThrowStatement) Status { }
	fn leave(n: ir.ThrowStatement) Status { }
	fn enter(n: ir.ScopeStatement) Status { }
	fn leave(n: ir.ScopeStatement) Status { }
	fn enter(n: ir.PragmaStatement) Status { }
	fn leave(n: ir.PragmaStatement) Status { }
	fn enter(n: ir.ConditionStatement) Status { }
	fn leave(n: ir.ConditionStatement) Status { }
	fn enter(n: ir.MixinStatement) Status { }
	fn leave(n: ir.MixinStatement) Status { }
	fn enter(n: ir.AssertStatement) Status { }
	fn leave(n: ir.AssertStatement) Status { }
	fn visit(n: ir.ContinueStatement) Status { }
	fn visit(n: ir.BreakStatement) Status { }
	fn enter(n: ir.PointerType) Status { }
	fn leave(n: ir.PointerType) Status { }
	fn enter(n: ir.ArrayType) Status { }
	fn leave(n: ir.ArrayType) Status { }
	fn enter(n: ir.StaticArrayType) Status { }
	fn leave(n: ir.StaticArrayType) Status { }
	fn enter(n: ir.AmbiguousArrayType) Status { }
	fn leave(n: ir.AmbiguousArrayType) Status { }
	fn enter(n: ir.AAType) Status { }
	fn leave(n: ir.AAType) Status { }
	fn enter(n: ir.FunctionType) Status { }
	fn leave(n: ir.FunctionType) Status { }
	fn enter(n: ir.DelegateType) Status { }
	fn leave(n: ir.DelegateType) Status { }
	fn enter(n: ir.Function) Status { }
	fn leave(n: ir.Function) Status { }
	fn enter(n: ir.StorageType) Status { }
	fn leave(n: ir.StorageType) Status { }
	fn enter(n: ir.Attribute) Status { }
	fn leave(n: ir.Attribute) Status { }
	fn enter(n: ir.Alias) Status { }
	fn leave(n: ir.Alias) Status { }
	fn enter(n: ir.TypeOf) Status { }
	fn leave(n: ir.TypeOf) Status { }
	fn enter(n: ir.EnumDeclaration) Status { }
	fn leave(n: ir.EnumDeclaration) Status { }
	fn enter(n: ir.AliasStaticIf) Status { }
	fn leave(n: ir.AliasStaticIf) Status { }
	fn enter(n: ir.TemplateInstance) Status { }
	fn leave(n: ir.TemplateInstance) Status { }
	fn visit(n: ir.TemplateDefinition) Status { }
	fn visit(n: ir.NullType) Status { }
	fn visit(n: ir.PrimitiveType) Status { }
	fn visit(n: ir.TypeReference) Status { }
	fn visit(n: ir.AutoType) Status { }
	fn visit(n: ir.NoType) Status { }
	fn enter(ir.Exp, n: ir.Postfix) Status { }
	fn leave(ir.Exp, n: ir.Postfix) Status { }
	fn enter(ir.Exp, n: ir.Unary) Status { }
	fn leave(ir.Exp, n: ir.Unary) Status { }
	fn enter(ir.Exp, n: ir.BinOp) Status { }
	fn leave(ir.Exp, n: ir.BinOp) Status { }
	fn enter(ir.Exp, n: ir.Ternary) Status { }
	fn leave(ir.Exp, n: ir.Ternary) Status { }
	fn enter(ir.Exp, n: ir.ArrayLiteral) Status { }
	fn leave(ir.Exp, n: ir.ArrayLiteral) Status { }
	fn enter(ir.Exp, n: ir.AssocArray) Status { }
	fn leave(ir.Exp, n: ir.AssocArray) Status { }
	fn enter(ir.Exp, n: ir.Assert) Status { }
	fn leave(ir.Exp, n: ir.Assert) Status { }
	fn enter(ir.Exp, n: ir.StringImport) Status { }
	fn leave(ir.Exp, n: ir.StringImport) Status { }
	fn enter(ir.Exp, n: ir.Typeid) Status { }
	fn leave(ir.Exp, n: ir.Typeid) Status { }
	fn enter(ir.Exp, n: ir.IsExp) Status { }
	fn leave(ir.Exp, n: ir.IsExp) Status { }
	fn enter(ir.Exp, n: ir.FunctionLiteral) Status { }
	fn leave(ir.Exp, n: ir.FunctionLiteral) Status { }
	fn enter(ir.Exp, n: ir.StructLiteral) Status { }
	fn leave(ir.Exp, n: ir.StructLiteral) Status { }
	fn enter(ir.Exp, n: ir.UnionLiteral) Status { }
	fn leave(ir.Exp, n: ir.UnionLiteral) Status { }
	fn enter(ir.Exp, n: ir.ClassLiteral) Status { }
	fn leave(ir.Exp, n: ir.ClassLiteral) Status { }
	fn enter(ir.Exp, n: ir.Constant) Status { }
	fn leave(ir.Exp, n: ir.Constant) Status { }
	fn enter(ir.Exp, n: ir.TypeExp) Status { }
	fn leave(ir.Exp, n: ir.TypeExp) Status { }
	fn enter(ir.Exp, n: ir.StatementExp) Status { }
	fn leave(ir.Exp, n: ir.StatementExp) Status { }
	fn enter(ir.Exp, n: ir.VaArgExp) Status { }
	fn leave(ir.Exp, n: ir.VaArgExp) Status { }
	fn enter(ir.Exp, n: ir.PropertyExp) Status { }
	fn leave(ir.Exp, n: ir.PropertyExp) Status { }
	fn enter(ir.Exp, n: ir.BuiltinExp) Status { }
	fn leave(ir.Exp, n: ir.BuiltinExp) Status { }
	fn enter(ir.Exp, n: ir.AccessExp) Status { }
	fn leave(ir.Exp, n: ir.AccessExp) Status { }
	fn enter(ir.Exp, n: ir.RunExp) Status { }
	fn leave(ir.Exp, n: ir.RunExp) Status { }
	fn enter(ir.Exp, n: ir.ComposableString) Status { }
	fn leave(ir.Exp, n: ir.ComposableString) Status { }
	fn visit(ir.Exp, n: ir.ExpReference) Status { }
	fn visit(ir.Exp, n: ir.TokenExp) Status { }
	fn visit(ir.Exp, n: ir.StoreExp) Status { }
	fn visit(ir.Exp, n: ir.IdentifierExp) Status { }


protected:
	mFilename: string;
	mStream: OutputStream;
	mSink: void delegate(scope (const(scope (char)[]));
	mIndent: i32;
	mLastIndent: i32;
	mIndentText: string;


protected:
	fn enterNode(node: ir.Node) { }
	fn enterNode(node: ir.Node, extra: string) { }
	fn printTypeFields(node: ir.Node) { }
	fn leaveNode(node: ir.Node) { }
	fn visitRef(node: ir.Node, r: ir.Node) { }
	fn visitNamed(n: ir.Node) { }
	fn visitNames(name: string, mangledName: string) { }
	fn visitName(name: string) { }
	fn visitNode(node: ir.Node) { }
	fn twf(strings: scope (scope (string)[])) { }
	fn twfln(strings: scope (scope (string)[])) { }
	fn wf(strings: scope (scope (string)[])) { }
	fn wf(i: size_t) { }
	fn wfln(str: string) { }
	fn ln() { }
}

fn debugPrinter(m: ir.Module) { }
fn debugPrintNode(n: ir.Node) { }

volt.visitor.jsonprinter

module volt.visitor.jsonprinter;


class JsonPrinter : NullVisitor
{
public:
	this(filename: string) { }
	fn transform(target: TargetInfo, mods: ir.Module[]) { }
	fn enter(m: ir.Module) Status { }
	fn enter(s: ir.Struct) Status { }
	fn enter(u: ir.Union) Status { }
	fn enter(c: ir.Class) Status { }
	fn enter(ifc: ir._Interface) Status { }
	fn enter(a: ir.Alias) Status { }
	fn enter(i: ir.Import) Status { }
	fn enter(f: ir.Function) Status { }
	fn enter(v: ir.Variable) Status { }
	fn enter(e: ir.Enum) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn leave(ir.Module) Status { }
	fn leave(ir.Struct) Status { }
	fn leave(ir.Union) Status { }
	fn leave(ir.Class) Status { }
	fn leave(ir.Enum) Status { }
	fn leave(ir._Interface) Status { }


protected:
	fn writeTargetInfo(target: TargetInfo) { }
	fn writeAlignments(alignment: TargetInfo.Alignments) { }
	fn writeNamedTyped(kind: string, name: string, doc: string, type: ir.Type) { }
	fn startObject() { }
	fn startObject(name: string) { }
	fn startList(name: string) { }
	fn endObject() { }
	fn endList() { }
	fn endListAndObject() { }
	fn tag(tag: scope (SinkArg), value: scope (SinkArg)) { }
	fn tag(tag: scope (SinkArg), value: bool) { }
	fn tag(tag: scope (SinkArg), n: size_t) { }
	//! Add quotes to s and make it a JSON string (w/ escaping etc).
	fn wq(s: scope (SinkArg)) { }
	fn wMaybeComma() { }
	fn w(s: scope (SinkArg)) { }
}

volta.postparse.missing

//! Module containing the MissingDeps class.
module volta.postparse.missing;


alias GetMod = ir.Module delegate(ir.QualifiedName);

//! Looks for missing dependancies via imports.
class MissingDeps : ScopeManager, Pass
{
public:
	this(errSink: ErrorSink, getMod: GetMod) { }
	fn transform(m: ir.Module) { }
	fn transform(m: ir.Module, func: ir.Function, bs: ir.BlockStatement) { }
	fn close() { }
	fn getMissing() string[] { }
	fn enter(i: ir.Import) Status { }
}

volta.ir.printer

module volta.ir.printer;


fn printType(type: ir.Type, alwaysGlossed: bool) string { }
fn write(sink: scope (Sink), type: ir.Type, alwaysGlossed: bool) { }
fn write(sink: scope (Sink), s: ir.Scope) { }
fn binopToString(op: ir.BinOp.Op) string { }

volta.errors

module volta.errors;

public import volta.util.errormessages;


fn panic(es: ErrorSink, message: string, file: string, line: i32) { }
fn panic(es: ErrorSink, loc: const(Location), message: string, file: string, line: i32) { }
fn panic(es: ErrorSink, n: ir.Node, message: string, file: string, line: i32) { }
fn passert(es: ErrorSink, n: ir.Node, condition: bool, file: string, line: i32) bool { }
fn errorMsg(es: ErrorSink, loc: const(Location), message: string, file: string, line: i32) { }
fn errorMsg(es: ErrorSink, n: ir.Node, message: string, file: string, line: i32) { }
fn errorExpected(es: ErrorSink, loc: const(Location), expected: string, file: string, line: i32) { }
fn errorExpected(es: ErrorSink, n: ir.Node, expected: string, file: string, line: i32) { }
fn errorRedefine(es: ErrorSink, newDef: const(Location), oldDef: const(Location), name: string, file: string, line: i32) { }
fn warning(loc: const(Location), message: string) { }
fn warning(es: ErrorSink, loc: const(Location), message: string, file: string, line: i32) { }
fn warning(es: ErrorSink, n: ir.Node, message: string, file: string, line: i32) { }
fn warningAssignToSelf(loc: const(Location), name: string, warningsEnabled: bool) { }
fn warningOldStyleVariable(loc: const(Location), magicFlagD: bool, settings: Settings) { }
fn warningOldStyleFunction(loc: const(Location), magicFlagD: bool, settings: Settings) { }
fn warningOldStyleFunctionPtr(loc: const(Location), magicFlagD: bool, settings: Settings) { }
fn warningOldStyleDelegateType(loc: const(Location), magicFlagD: bool, settings: Settings) { }
fn warningOldStyleHexTypeSuffix(loc: const(Location), magicFlagD: bool, settings: Settings) { }
fn warningShadowsField(newDecl: const(Location), oldDecl: const(Location), name: string, warningsEnabled: bool) { }

volta.ir.token

module volta.ir.token;


enum _tokenToString;

enum TokenType
{
	None,
	Begin,
	End,
	DocComment,
	BackwardsDocComment,
	Identifier,
	StringLiteral,
	CharacterLiteral,
	IntegerLiteral,
	FloatLiteral,
	Abstract,
	Alias,
	Align,
	Asm,
	Assert,
	Auto,
	Body,
	Bool,
	Break,
	Byte,
	Case,
	Cast,
	Catch,
	Cdouble,
	Cent,
	Cfloat,
	Char,
	Class,
	Const,
	Continue,
	Creal,
	Dchar,
	Debug,
	Default,
	Delegate,
	Delete,
	Deprecated,
	Dg,
	Do,
	Double,
	Else,
	Enum,
	Export,
	Extern,
	F32,
	F64,
	False,
	Final,
	Finally,
	Float,
	For,
	Foreach,
	ForeachReverse,
	Fn,
	Function,
	Global,
	Goto,
	I8,
	I16,
	I32,
	I64,
	Idouble,
	If,
	Ifloat,
	Immutable,
	Import,
	In,
	Inout,
	Int,
	Interface,
	Invariant,
	Ireal,
	Is,
	Isize,
	Lazy,
	Local,
	Long,
	Macro,
	Mixin,
	Module,
	New,
	Nothrow,
	Null,
	Out,
	Override,
	Pragma,
	Private,
	Protected,
	Public,
	Pure,
	Real,
	Ref,
	Return,
	Scope,
	Shared,
	Short,
	Static,
	Struct,
	Super,
	Switch,
	Synchronized,
	Template,
	This,
	Throw,
	True,
	Try,
	Typedef,
	Typeid,
	Typeof,
	U8,
	U16,
	U32,
	U64,
	Ubyte,
	Ucent,
	Uint,
	Ulong,
	Union,
	Unittest,
	Ushort,
	Usize,
	VaArg,
	Version,
	Void,
	Volatile,
	Wchar,
	While,
	With,
	__File__,
	__Function__,
	__Line__,
	__Location__,
	__Pretty_Function__,
	__Thread,
	HashRun,
	//! Symbols.
	Slash,
	SlashAssign,
	Dot,
	DoubleDot,
	TripleDot,
	Ampersand,
	AmpersandAssign,
	DoubleAmpersand,
	Pipe,
	PipeAssign,
	DoublePipe,
	Dash,
	DashAssign,
	DoubleDash,
	Plus,
	PlusAssign,
	DoublePlus,
	Less,
	LessAssign,
	DoubleLess,
	DoubleLessAssign,
	LessGreater,
	LessGreaterAssign,
	Greater,
	GreaterAssign,
	DoubleGreaterAssign,
	TripleGreaterAssign,
	DoubleGreater,
	TripleGreater,
	Bang,
	BangAssign,
	BangLessGreater,
	BangLessGreaterAssign,
	BangLess,
	BangLessAssign,
	BangGreater,
	BangGreaterAssign,
	OpenParen,
	CloseParen,
	OpenBracket,
	CloseBracket,
	OpenBrace,
	CloseBrace,
	QuestionMark,
	Comma,
	Semicolon,
	Colon,
	ColonAssign,
	Dollar,
	Assign,
	DoubleAssign,
	Asterix,
	AsterixAssign,
	Percent,
	PercentAssign,
	Caret,
	CaretAssign,
	DoubleCaret,
	DoubleCaretAssign,
	Tilde,
	TildeAssign,
	At,
}

//! Holds the type, the actual string and location within the source file.
struct Token
{
public:
	type: TokenType;
	value: string;
	loc: Location;
}

fn tokenToString(token: TokenType) string { }
fn isStorageTypeToken(token: TokenType) bool { }
fn isPrimitiveTypeToken(token: TokenType) bool { }
//! Go from a string identifier to a TokenType.
fn identifierType(ident: string) TokenType { }

volta.ir.base

module volta.ir.base;

public import volta.ir.location;
public import volta.ir.token;


//! Each concrete class derived from ir.Node has a value in this
//! enumeration. The value for the type is stored in ir.Node.nodeType by
//! the constructor. While using type tags is not very OOP, it is extremely
//! convenient. For example, during debugging you can simply inspect 
//! ir.Node.nodeType to find out the actual type of the object.
enum NodeType
{
	Invalid,
	NonVisiting,
	QualifiedName,
	Identifier,
	Module,
	TopLevelBlock,
	Import,
	Unittest,
	Struct,
	Class,
	Interface,
	Union,
	Enum,
	Attribute,
	Condition,
	ConditionTopLevel,
	MixinFunction,
	MixinTemplate,
	PrimitiveType,
	TypeReference,
	PointerType,
	ArrayType,
	AmbiguousArrayType,
	StaticArrayType,
	AAType,
	AAPair,
	FunctionType,
	DelegateType,
	FunctionSetType,
	StorageType,
	TypeOf,
	NullType,
	AutoType,
	NoType,
	AliasStaticIf,
	Variable,
	Alias,
	Function,
	FunctionParam,
	FunctionSet,
	EnumDeclaration,
	ReturnStatement,
	BlockStatement,
	AsmStatement,
	IfStatement,
	WhileStatement,
	DoStatement,
	ForStatement,
	ForeachStatement,
	LabelStatement,
	ExpStatement,
	SwitchStatement,
	SwitchCase,
	ContinueStatement,
	BreakStatement,
	GotoStatement,
	WithStatement,
	SynchronizedStatement,
	TryStatement,
	ThrowStatement,
	ScopeStatement,
	PragmaStatement,
	ConditionStatement,
	MixinStatement,
	AssertStatement,
	Constant,
	BinOp,
	Ternary,
	Unary,
	Postfix,
	ArrayLiteral,
	AssocArray,
	IdentifierExp,
	Assert,
	StringImport,
	Typeid,
	IsExp,
	FunctionLiteral,
	ExpReference,
	StructLiteral,
	UnionLiteral,
	ClassLiteral,
	TypeExp,
	StoreExp,
	StatementExp,
	TokenExp,
	VaArgExp,
	PropertyExp,
	BuiltinExp,
	AccessExp,
	RunExp,
	ComposableString,
	TemplateInstance,
	TemplateDefinition,
}

//! Common access levels used on declared functions, methods, classes,
//! interfaces, structs, enums and variables.
enum Access
{
	Invalid,
	Public,
	Private,
	Protected,
}

//! Controls the calling convention and how symbols are mangled.
enum Linkage
{
	Volt,
	C,
	CPlusPlus,
	D,
	Windows,
	Pascal,
	System,
}

//! Used by ScopeStatement and other nodes.
enum ScopeKind
{
	Exit,
	Failure,
	Success,
}

//! Type used for node unique ids.
alias NodeID = size_t;

//! Base class for all IR nodes.
class Node
{
public:
	loc: Location;
	docComment: string;


public:
	//! Retrieve the NodeType for this Node.
	fn nodeType() NodeType { }
	//! Retrieve the unique id of this node.
	fn uniqueId() size_t { }
	fn toIdentifierFast() Identifier { }
	fn toIdentifierChecked() Identifier { }
	fn toQualifiedNameFast() QualifiedName { }
	fn toQualifiedNameChecked() QualifiedName { }
	fn toModuleFast() Module { }
	fn toModuleChecked() Module { }
	fn toTopLevelBlockFast() TopLevelBlock { }
	fn toTopLevelBlockChecked() TopLevelBlock { }
	fn toImportFast() Import { }
	fn toImportChecked() Import { }
	fn toUnittestFast() Unittest { }
	fn toUnittestChecked() Unittest { }
	fn toStructFast() Struct { }
	fn toStructChecked() Struct { }
	fn toClassFast() Class { }
	fn toClassChecked() Class { }
	fn toInterfaceFast() _Interface { }
	fn toInterfaceChecked() _Interface { }
	fn toUnionFast() Union { }
	fn toUnionChecked() Union { }
	fn toEnumFast() Enum { }
	fn toEnumChecked() Enum { }
	fn toAttributeFast() Attribute { }
	fn toAttributeChecked() Attribute { }
	fn toConditionFast() Condition { }
	fn toConditionChecked() Condition { }
	fn toConditionTopLevelFast() ConditionTopLevel { }
	fn toConditionTopLevelChecked() ConditionTopLevel { }
	fn toMixinFunctionFast() MixinFunction { }
	fn toMixinFunctionChecked() MixinFunction { }
	fn toMixinTemplateFast() MixinTemplate { }
	fn toMixinTemplateChecked() MixinTemplate { }
	fn toTypeFast() Type { }
	fn toTypeChecked() Type { }
	fn toPrimitiveTypeFast() PrimitiveType { }
	fn toPrimitiveTypeChecked() PrimitiveType { }
	fn toTypeReferenceFast() TypeReference { }
	fn toTypeReferenceChecked() TypeReference { }
	fn toPointerTypeFast() PointerType { }
	fn toPointerTypeChecked() PointerType { }
	fn toArrayTypeFast() ArrayType { }
	fn toArrayTypeChecked() ArrayType { }
	fn toAmbiguousArrayTypeFast() AmbiguousArrayType { }
	fn toAmbiguousArrayTypeChecked() AmbiguousArrayType { }
	fn toStaticArrayTypeFast() StaticArrayType { }
	fn toStaticArrayTypeChecked() StaticArrayType { }
	fn toAATypeFast() AAType { }
	fn toAATypeChecked() AAType { }
	fn toAAPairFast() AAPair { }
	fn toAAPairChecked() AAPair { }
	fn toFunctionTypeFast() FunctionType { }
	fn toFunctionTypeChecked() FunctionType { }
	fn toDelegateTypeFast() DelegateType { }
	fn toDelegateTypeChecked() DelegateType { }
	fn toFunctionSetTypeFast() FunctionSetType { }
	fn toFunctionSetTypeChecked() FunctionSetType { }
	fn toStorageTypeFast() StorageType { }
	fn toStorageTypeChecked() StorageType { }
	fn toTypeOfFast() TypeOf { }
	fn toTypeOfChecked() TypeOf { }
	fn toNullTypeFast() NullType { }
	fn toNullTypeChecked() NullType { }
	fn toAutoTypeFast() AutoType { }
	fn toAutoTypeChecked() AutoType { }
	fn toNoTypeFast() NoType { }
	fn toNoTypeChecked() NoType { }
	fn toAliasStaticIfFast() AliasStaticIf { }
	fn toAliasStaticIfChecked() AliasStaticIf { }
	fn toCallableTypeFast() CallableType { }
	fn toCallableTypeChecked() CallableType { }
	fn toVariableFast() Variable { }
	fn toVariableChecked() Variable { }
	fn toAliasFast() Alias { }
	fn toAliasChecked() Alias { }
	fn toFunctionFast() Function { }
	fn toFunctionChecked() Function { }
	fn toFunctionParamFast() FunctionParam { }
	fn toFunctionParamChecked() FunctionParam { }
	fn toFunctionSetFast() FunctionSet { }
	fn toFunctionSetChecked() FunctionSet { }
	fn toEnumDeclarationFast() EnumDeclaration { }
	fn toEnumDeclarationChecked() EnumDeclaration { }
	fn toReturnStatementFast() ReturnStatement { }
	fn toReturnStatementChecked() ReturnStatement { }
	fn toBlockStatementFast() BlockStatement { }
	fn toBlockStatementChecked() BlockStatement { }
	fn toAsmStatementFast() AsmStatement { }
	fn toAsmStatementChecked() AsmStatement { }
	fn toIfStatementFast() IfStatement { }
	fn toIfStatementChecked() IfStatement { }
	fn toWhileStatementFast() WhileStatement { }
	fn toWhileStatementChecked() WhileStatement { }
	fn toDoStatementFast() DoStatement { }
	fn toDoStatementChecked() DoStatement { }
	fn toForStatementFast() ForStatement { }
	fn toForStatementChecked() ForStatement { }
	fn toForeachStatementFast() ForeachStatement { }
	fn toForeachStatementChecked() ForeachStatement { }
	fn toLabelStatementFast() LabelStatement { }
	fn toLabelStatementChecked() LabelStatement { }
	fn toExpStatementFast() ExpStatement { }
	fn toExpStatementChecked() ExpStatement { }
	fn toSwitchStatementFast() SwitchStatement { }
	fn toSwitchStatementChecked() SwitchStatement { }
	fn toSwitchCaseFast() SwitchCase { }
	fn toSwitchCaseChecked() SwitchCase { }
	fn toContinueStatementFast() ContinueStatement { }
	fn toContinueStatementChecked() ContinueStatement { }
	fn toBreakStatementFast() BreakStatement { }
	fn toBreakStatementChecked() BreakStatement { }
	fn toGotoStatementFast() GotoStatement { }
	fn toGotoStatementChecked() GotoStatement { }
	fn toWithStatementFast() WithStatement { }
	fn toWithStatementChecked() WithStatement { }
	fn toSynchronizedStatementFast() SynchronizedStatement { }
	fn toSynchronizedStatementChecked() SynchronizedStatement { }
	fn toTryStatementFast() TryStatement { }
	fn toTryStatementChecked() TryStatement { }
	fn toThrowStatementFast() ThrowStatement { }
	fn toThrowStatementChecked() ThrowStatement { }
	fn toScopeStatementFast() ScopeStatement { }
	fn toScopeStatementChecked() ScopeStatement { }
	fn toPragmaStatementFast() PragmaStatement { }
	fn toPragmaStatementChecked() PragmaStatement { }
	fn toConditionStatementFast() ConditionStatement { }
	fn toConditionStatementChecked() ConditionStatement { }
	fn toMixinStatementFast() MixinStatement { }
	fn toMixinStatementChecked() MixinStatement { }
	fn toAssertStatementFast() AssertStatement { }
	fn toAssertStatementChecked() AssertStatement { }
	fn toConstantFast() Constant { }
	fn toConstantChecked() Constant { }
	fn toBinOpFast() BinOp { }
	fn toBinOpChecked() BinOp { }
	fn toTernaryFast() Ternary { }
	fn toTernaryChecked() Ternary { }
	fn toUnaryFast() Unary { }
	fn toUnaryChecked() Unary { }
	fn toPostfixFast() Postfix { }
	fn toPostfixChecked() Postfix { }
	fn toArrayLiteralFast() ArrayLiteral { }
	fn toArrayLiteralChecked() ArrayLiteral { }
	fn toAssocArrayFast() AssocArray { }
	fn toAssocArrayChecked() AssocArray { }
	fn toIdentifierExpFast() IdentifierExp { }
	fn toIdentifierExpChecked() IdentifierExp { }
	fn toAssertFast() Assert { }
	fn toAssertChecked() Assert { }
	fn toStringImportFast() StringImport { }
	fn toStringImportChecked() StringImport { }
	fn toTypeidFast() Typeid { }
	fn toTypeidChecked() Typeid { }
	fn toIsExpFast() IsExp { }
	fn toIsExpChecked() IsExp { }
	fn toFunctionLiteralFast() FunctionLiteral { }
	fn toFunctionLiteralChecked() FunctionLiteral { }
	fn toExpReferenceFast() ExpReference { }
	fn toExpReferenceChecked() ExpReference { }
	fn toStructLiteralFast() StructLiteral { }
	fn toStructLiteralChecked() StructLiteral { }
	fn toUnionLiteralFast() UnionLiteral { }
	fn toUnionLiteralChecked() UnionLiteral { }
	fn toClassLiteralFast() ClassLiteral { }
	fn toClassLiteralChecked() ClassLiteral { }
	fn toTypeExpFast() TypeExp { }
	fn toTypeExpChecked() TypeExp { }
	fn toStoreExpFast() StoreExp { }
	fn toStoreExpChecked() StoreExp { }
	fn toStatementExpFast() StatementExp { }
	fn toStatementExpChecked() StatementExp { }
	fn toTokenExpFast() TokenExp { }
	fn toTokenExpChecked() TokenExp { }
	fn toVaArgExpFast() VaArgExp { }
	fn toVaArgExpChecked() VaArgExp { }
	fn toPropertyExpFast() PropertyExp { }
	fn toPropertyExpChecked() PropertyExp { }
	fn toBuiltinExpFast() BuiltinExp { }
	fn toBuiltinExpChecked() BuiltinExp { }
	fn toAccessExpFast() AccessExp { }
	fn toAccessExpChecked() AccessExp { }
	fn toRunExpFast() RunExp { }
	fn toRunExpChecked() RunExp { }
	fn toComposableStringFast() ComposableString { }
	fn toComposableStringChecked() ComposableString { }
	fn toTemplateInstanceFast() TemplateInstance { }
	fn toTemplateInstanceChecked() TemplateInstance { }
	fn toTemplateDefinitionFast() TemplateDefinition { }
	fn toTemplateDefinitionChecked() TemplateDefinition { }
}

//! A series of identifiers and dots referring to a declared item.
class QualifiedName : Node
{
public:
	identifiers: Identifier[];
	leadingDot: bool;


public:
	this() { }
	this(old: QualifiedName) { }
	fn toString() string { }
	fn strings() string[] { }
	fn equals(qname: QualifiedName) bool { }
}

//! A single string that could be a part of an ir.QualifiedName or
//! stand-alone node inside of the ir, referencing a declared item.
class Identifier : Node
{
public:
	value: string;


public:
	this() { }
	this(s: string) { }
	this(old: Identifier) { }
	fn equals(ident: Identifier) bool { }
}

//! Return the given Access as a string.
fn accessToString(access: Access) string { }
//! Return the given Linkage as a string.
fn linkageToString(linkage: Linkage) string { }
//! Returns a string representing the node's nodeType.
fn nodeToString(node: Node) string { }
//! Returns a string representing the nodeType.
fn nodeToString(nodeType: NodeType) string { }
//! For debugging helpers.
fn getNodeAddressString(node: Node) string { }
//! For debugging helpers.
fn getNodeUniqueString(node: Node) string { }

volta.ir.type

module volta.ir.type;


//! Base class for all types.
class Type : Node
{
public:
	//! Filled in with a pass.
	mangledName: string;
	//! StorageType flags.
	isConst: bool;
	//! StorageType flags.
	isImmutable: bool;
	//! StorageType flags.
	isScope: bool;
	glossedName: string;
}

//! PrimitiveTypes are types that are entirely well known to the compiler
//! ahead of time. Consisting mostly of integral types, the only abstract
//! one is Void, which indicates no type or (in the case of arrays and
//! pointers) any type.
class PrimitiveType : Type
{
public:
	enum Kind
	{
		Invalid,
		Void,
		Bool,
		Char,
		Wchar,
		Dchar,
		Byte,
		Ubyte,
		Short,
		Ushort,
		Int,
		Uint,
		Long,
		Ulong,
		Float,
		Double,
		Real,
	}


public:
	type: Kind;
	//! Used for printing both 'int' and 'i32', etc.
	originalToken: Token;


public:
	this() { }
	this(kind: Kind) { }
	this(old: PrimitiveType) { }
}

//! A TypeReference is generated for user defined types, and a pass fills
//! in the information so it can act as a cache, and not require multiple
//! lookups.
class TypeReference : Type
{
public:
	//! What Type this refers to. Filled in after parsing sometime.
	type: Type;
	//! The name of the Type. Filled in the initial parsing.
	id: QualifiedName;


public:
	this() { }
	this(old: TypeReference) { }
}

//! TypeOf is generated for typeof(expression), anywhere a type could be
//! used. This is then used as if the type of the expression had been
//! written out by hand.
class TypeOf : Type
{
public:
	//! The expression to get the type of.
	exp: Exp;


public:
	this() { }
	this(old: TypeOf) { }
}

//! A pointer is an abstraction of an address. You can dereference a
//! pointer (get the thing it's pointing to), perform pointer arithmetic
//! (move to the next possible address that could contain the same type),
//! or reseat a pointer (change what it points to). You can also slice a
//! pointer to get an array.
class PointerType : Type
{
public:
	base: Type;
	isReference: bool;


public:
	this() { }
	this(loc: const(Location), base: Type) { }
	this(old: PointerType) { }
}

//! The NullType represents the Type of a null.
class NullType : Type
{
public:
	this() { }
	this(old: NullType) { }
}

//! An ArrayType represents a slice of memory. It contains a pointer, that
//! contains elements of the base type, and a length, which says how many
//! elements this slice shows. This is lowered into a struct before the
//! backend gets it.
class ArrayType : Type
{
public:
	base: Type;


public:
	this() { }
	this(loc: const(Location), base: Type) { }
	this(old: ArrayType) { }
}

//! A type that is either an AAType or a StaticArrayType, but we cannot
//! tell which yet.
class AmbiguousArrayType : Type
{
public:
	base: Type;
	child: Exp;


public:
	this() { }
	this(old: AmbiguousArrayType) { }
}

//! A StaticArray is a list of elements of type base with a statically
//! (known at compile time) number of elements. Unlike C, these are passed
//! by value to functions.
class StaticArrayType : Type
{
public:
	base: Type;
	length: size_t;


public:
	this() { }
	this(old: StaticArrayType) { }
}

//! An AAType is an associative array -- it associates keys with values.
class AAType : Type
{
public:
	value: Type;
	key: Type;


public:
	this() { }
	this(old: AAType) { }
}

//! The common ancestor of DelegateTypes and FunctionTypes.
class CallableType : Type
{
public:
	linkage: Linkage;
	ret: Type;
	params: Type[];
	isArgRef: bool[];
	isArgOut: bool[];
	hiddenParameter: bool;
	hasVarArgs: bool;
	varArgsProcessed: bool;
	varArgsTypeids: Variable;
	varArgsArgs: Variable;
	isProperty: bool;
	homogenousVariadic: bool;
	forceLabel: bool;
	//! When the backend needs a TypeInfo for varargs and such.
	typeInfo: Class;
	abiModified: bool;
	abiData: void*[][];


public:
	this(nt: NodeType) { }
	this(nt: NodeType, old: CallableType) { }
}

//! Exists as a proxy for a FunctionSet.
class FunctionSetType : Type
{
public:
	set: FunctionSet;
	//! For use in typer.
	isFromCreateDelegate: bool;


public:
	this() { }
	this(set: FunctionSet) { }
	this(old: FunctionSetType) { }
}

//! A FunctionType represents the form of a function, and defines how it is
//! called. It has a return type and a number of parameters.
class FunctionType : CallableType
{
public:
	this() { }
	this(old: CallableType) { }
}

//! A DelegateType is a function pointer with an additional context
//! pointer.
class DelegateType : CallableType
{
public:
	this() { }
	this(old: CallableType) { }
}

//! A StorageType changes how a Type behaves.
class StorageType : Type
{
public:
	//! For bitfields.
	enum STORAGE_AUTO;
	enum STORAGE_CONST;
	enum STORAGE_IMMUTABLE;
	enum STORAGE_SCOPE;
	enum STORAGE_REF;
	enum STORAGE_OUT;


public:
	enum Kind
	{
		Invalid,
		Auto,
		Const,
		Immutable,
		Scope,
		Ref,
		Out,
	}


public:
	type: Kind;
	base: Type;


public:
	this() { }
	this(old: StorageType) { }
}

//! For representing inferred types. auto a = 3; const b = 2;
class AutoType : Type
{
public:
	//! The explicit type to replace this with.
	explicitType: Type;
	isForeachRef: bool;


public:
	this() { }
	this(old: AutoType) { }
}

//! For constructs that have no type, used to avoid nulls in the IR.
class NoType : Type
{
public:
	this() { }
	this(old: NoType) { }
}

//! A special kind of type that allows an alias to have multiple
//! configurations.
class AliasStaticIf : Type
{
public:
	conditions: Exp[];
	types: Type[];


public:
	this() { }
	this(old: AliasStaticIf) { }
}

volta.ir.context

module volta.ir.context;


enum Status
{
	Success,
	Error,
}

//! A container class for a various things that can be stored in a Scope.
class Store
{
public:
	//! Class specifier.
	enum Kind
	{
		Type,
		Value,
		Scope,
		MultiScope,
		Alias,
		Merge,
		Function,
		Template,
		Reserved,
		FunctionParam,
		EnumDeclaration,
		TemplateInstance,
	}


public:
	name: string;
	parent: Scope;
	kind: Kind;
	node: Node;
	originalNodes: Node[];
	myScope: Scope;
	scopes: Scope[];
	functions: Function[];
	aliases: Alias[];
	templateInstances: TemplateInstance[];
	myAlias: Store;
	importBindAccess: Access;
	importAlias: bool;
	fromImplicitContextChain: bool;


public:
	//! Used for Alias, Value, Type and Scope stores. Not really intended for
	//! general consumption but are instead called from the add members in
	//! Scope.
	this(s: Scope, n: Node, name: string, kind: Kind) { }
	//! Used for functions. Not really intended for general consumption but are
	//! instead called from the addFunction member in Scope.
	this(s: Scope, func: Function, name: string) { }
	//! As above but for multiple functions at once. Internal use only.
	this(s: Scope, func: Function[], name: string) { }
	//! Used for enums. The name will usually be the name of the enum
	//! declaration. Not really intended for general consumption, but called
	//! from the addEnumDeclaration member in Scope.
	this(parent: Scope, ed: EnumDeclaration, name: string) { }
	this(parent: Scope, ti: TemplateInstance) { }
	//! Construct an invalid Store. Used for copying Stores for CTFE, do not
	//! use for anything else.
	this() { }
	//! Retrieve the unique id of this node.
	fn uniqueId() size_t { }
	fn addTemplateInstance(templateInstance: TemplateInstance) { }
	fn markAliasResolved(s: Store) { }
	fn markAliasResolved(t: Type) { }
}

//! A single scope containing declared items and their identifiers.
class Scope
{
public:
	anon: u32;
	name: string;
	node: Node;
	parent: Scope;
	symbols: Store[string];
	multibindScopes: Scope[];
	importedModules: Module[];
	importedAccess: Access[];
	nestedDepth: i32;


public:
	//! For toplevel modules.
	this(m: Module, name: string) { }
	//! For named imports, classes, structs and unions.
	this(parent: Scope, node: Node, name: string, nestedDepth: i32) { }
	//! Create a scope that represents multiple scopes.
	this(scopes: Scope[]) { }
	//! Create an invalid Scope. Internal use only.
	this() { }
	fn remove(name: string) { }
	fn genAnonIdent() string { }
	//! Reserve a identifier in this scope.
	fn reserveId(n: Node, name: string) Store { }
	//! Add an unresolved Alias to this scope. The scope that the alias is
	//! resolved to is defaulted to this scope, but this can be changed with
	//! the look argument, used by import rebinds.
	fn addAlias(n: Alias, name: string, status: Status) Store { }
	//! Add a named scope, @n is the node which introduced this scope, must not
	//! be null.
	fn addScope(n: Node, s: Scope, name: string, status: Status) Store { }
	//! Add a named multiscope, n is the node which introduced this scope and
	//! must not be null.
	fn addMultiScope(n: Node, s: Scope[], name: string, status: Status) Store { }
	//! Add a user defined type.
	fn addType(n: Node, name: string, status: Status) Store { }
	//! Add a value like a constant or a function variable.
	fn addValue(n: Node, name: string, status: Status) Store { }
	//! Add a function to this scope, will append function if one of declared
	//! function of the same name is found.
	fn addFunction(func: Function, name: string, status: Status) Store { }
	//! Add a user defined template.
	fn addTemplate(n: Node, name: string, status: Status) Store { }
	//! Add a template instance to the scope.
	fn addTemplateInstance(ti: TemplateInstance, status: Status) Store { }
	//! Add a named expression to the scope.
	fn addEnumDeclaration(e: EnumDeclaration, status: Status) Store { }
	//! Doesn't look in parent scopes, just this Store.
	fn getStore(name: string) Store { }
	//! Get all Variables in the Scope the have Nested storage.
	fn getNestedDeclarations() Declaration[] { }
}

volta.ir.toplevel

module volta.ir.toplevel;


//! The toplevelest node.
class Module : Node
{
public:
	//! Name used for mangling.
	name: QualifiedName;
	//! Toplevel nodes.
	children: TopLevelBlock;
	//! Auto generated module name, unimportable.
	isAnonymous: bool;
	globalDocComments: string[];
	myScope: Scope;
	hasPhase1: bool;
	hasPhase2: bool;
	magicFlagD: bool;
	forceNoDebug: bool;
	gathered: bool;


public:
	this() { }
	this(old: Module) { }
	//! Get a unique number for this module.
	fn getId() size_t { }
}

//! A TopLevelBlock contains a series of nodes, appropriate for things like
//! modules, classes, structs, and so on.
class TopLevelBlock : Node
{
public:
	nodes: Node[];


public:
	this() { }
	this(old: TopLevelBlock) { }
}

//! An Import adds a module to the search path of identifiers inside the
//! module it's in.
class Import : Node
{
public:
	access: Access;
	isStatic: bool;
	names: QualifiedName[];
	bind: Identifier;
	aliases: Identifier[][];
	targetModules: Module[];


public:
	this() { }
	this(old: Import) { }
}

//! Attributes apply different behaviours and access levels to one or more
//! top level nodes. These are lowered onto the object by the attribremoval
//! pass.
class Attribute : Node
{
public:
	//! Used to specify the exact sort of attribute.
	enum Kind
	{
		Invalid,
		LinkageVolt,
		LinkageC,
		LinkageCPlusPlus,
		LinkageD,
		LinkageWindows,
		LinkagePascal,
		LinkageSystem,
		LoadDynamic,
		Align,
		Deprecated,
		Private,
		Protected,
		Public,
		Export,
		Static,
		Extern,
		Final,
		Synchronized,
		Override,
		Abstract,
		Const,
		Auto,
		Scope,
		Global,
		Local,
		Shared,
		Immutable,
		Inout,
		Disable,
		Property,
		Trusted,
		System,
		Safe,
		NoThrow,
		Pure,
		MangledName,
		Label,
	}


public:
	kind: Kind;
	members: TopLevelBlock;
	//! for "public abstract:"
	chain: Attribute;
	//! If kind == Annotation or MangledName.
	arguments: Exp[];
	alignAmount: i32;


public:
	this() { }
	this(old: Attribute) { }
}

//! Named is a base class for named types, like Enum, Struct, Class and so
//! on. This is slightly different from Aggregate since Enum is not a
//! Aggregate, but is a named type.
class Named : Type
{
public:
	isResolved: bool;
	access: Access;
	//! Unmangled name of the NamedType.
	name: string;
	//! Context for this NamedType.
	myScope: Scope;
	//! Filled in by the semantic pass.
	typeInfo: Variable;


public:
	this(nt: NodeType) { }
	this(nt: NodeType, old: Named) { }
}

//! Aggregate is a base class for Struct, Union & Class.
class Aggregate : Named
{
public:
	anonymousAggregates: Aggregate[];
	anonymousVars: Variable[];
	//! Toplevel nodes.
	members: TopLevelBlock;
	isActualized: bool;


public:
	this(nt: NodeType) { }
	this(nt: NodeType, old: Aggregate) { }
}

//! Plain Old Data aggregates. Struct and Union, basically.
class PODAggregate : Aggregate
{
public:
	constructors: Function[];


public:
	this(nt: NodeType) { }
	this(nt: NodeType, old: PODAggregate) { }
}

//! Java style class declaration. Classes enable polymorphism, and are
//! always accessed through opaque references (to prevent slicing -- look
//! it up!)
class Class : Aggregate
{
public:
	//! Optional.
	parent: QualifiedName;
	//! Optional.
	interfaces: QualifiedName[];
	userConstructors: Function[];
	vtableVariable: Variable;
	classinfoVariable: Variable;
	ifaceVariables: Variable[];
	initVariable: Variable;
	//! Filled in by the typeverifier.
	parentClass: Class;
	//! Filled in by the typeverifier.
	parentInterfaces: _Interface[];
	//! Filled in by the typeverifier.
	interfaceOffsets: size_t[];
	//! Filled in by the classresolver.
	methodsCache: Function[][];
	layoutStruct: Struct;
	isObject: bool;
	isAbstract: bool;
	isFinal: bool;


public:
	this() { }
	this(old: Class) { }
}

//! Java style interface declaration. An interface defines multiple
//! functions that an implementing class must define. A class can inherit
//! from multiple interfaces, and can be treated as an instance of any one
//! of them.
class _Interface : Aggregate
{
public:
	//! Super interfaces to this.
	interfaces: QualifiedName[];
	//! Filled in by the typeverifier.
	parentInterfaces: _Interface[];
	layoutStruct: Struct;


public:
	this() { }
	this(old: _Interface) { }
}

//! C style union. Structs are a POD data type, and should be binary
//! compatible with the same union as defined by your friendly
//! neighbourhood C compiler.
class Union : PODAggregate
{
public:
	totalSize: size_t;


public:
	this() { }
	this(old: Union) { }
}

//! C style struct. Structs are a POD data type, and should be binary
//! compatible with the same struct as defined by your friendly
//! neighbourhood C compiler.
class Struct : PODAggregate
{
public:
	//! If not null, this struct was lowered from this.
	loweredNode: Node;


public:
	this() { }
	this(old: Struct) { }
}

//! C style Enum. Enums create symbols that are associated with compile time
//! constants. By default, they are enumerated with ascending numbers,
//! hence the name.
class Enum : Named
{
public:
	//! At least one.
	members: EnumDeclaration[];
	base: Type;
	toSink: Function;


public:
	this() { }
	this(old: Enum) { }
}

//! Unittest code to be run on if selected by user.
class Unittest : Node
{
public:
	//! Contains statements.
	_body: BlockStatement;


public:
	this() { }
	this(old: Unittest) { }
}

//! Node represention a compile time conditional compilation.
class Condition : Node
{
public:
	//! Used to specify the exact sort of condition.
	enum Kind
	{
		Invalid,
		//! version (identifier) {}
		Version,
		//! debug {}, debug (identifier) {}
		Debug,
		//! static if (exp) {}
		StaticIf,
	}


public:
	kind: Kind;
	exp: Exp;


public:
	this() { }
	this(old: Condition) { }
}

//! Node represention a compile time conditional compilation, at the
//! toplevel. Uses Condition to specify the if it should be compiled.
class ConditionTopLevel : Node
{
public:
	condition: Condition;
	elsePresent: bool;
	members: TopLevelBlock;
	_else: TopLevelBlock;


public:
	this() { }
	this(old: ConditionTopLevel) { }
}

//! Node represention of a function mixin.
class MixinFunction : Node
{
public:
	//! Not optional.
	name: string;
	raw: BlockStatement;


public:
	this() { }
	this(old: MixinFunction) { }
}

//! Node represention of a template mixin.
class MixinTemplate : Node
{
public:
	name: string;
	raw: TopLevelBlock;


public:
	this() { }
	this(old: MixinTemplate) { }
}

volta.ir.statement

module volta.ir.statement;


//! Base class for all statements.
class Statement : Node
{
public:
	this(nt: NodeType) { }
	this(nt: NodeType, old: Statement) { }
}

//! A block statement is a group of zero or more statements. Why these
//! exist depends on where they live.
class BlockStatement : Statement
{
public:
	statements: Node[];
	myScope: Scope;


public:
	this() { }
	this(old: BlockStatement) { }
}

//! The return statement returns execution to the caller of the current
//! function, and optionally returns a value.
class ReturnStatement : Statement
{
public:
	exp: Exp;


public:
	this() { }
	this(old: ReturnStatement) { }
}

//! The asm statement contains inline assembly. It's a list of tokens so
//! different backends can parse it however they want. It all still has to
//! lex as valid Volt, of course.
class AsmStatement : Statement
{
public:
	tokens: Token[];


public:
	this() { }
	this(old: AsmStatement) { }
}

//! The assert statement aborts if condition is flase, optionally
//! displaying message. isStatic determines whether condition is checked at
//! compile time or not.
class AssertStatement : Statement
{
public:
	condition: Exp;
	message: Exp;
	isStatic: bool;


public:
	this() { }
	this(old: AssertStatement) { }
}

//! If exp is true, execution flows to thenState. If exp is false,
//! execution flows to elseState, if it exists, otherwise it skips to the
//! end of the if statement.
class IfStatement : Statement
{
public:
	exp: Exp;
	thenState: BlockStatement;
	elseState: BlockStatement;
	autoName: string;


public:
	this() { }
	this(old: IfStatement) { }
}

//! The while statement keeps executing the statements in block, as long as
//! condition evaluates in true.
class WhileStatement : Statement
{
public:
	condition: Exp;
	block: BlockStatement;


public:
	this() { }
	this(old: WhileStatement) { }
}

//! Like a while statement, executes block while condition is true. Unlike
//! the while statement, at least one execution of block is guaranteed.
class DoStatement : Statement
{
public:
	block: BlockStatement;
	condition: Exp;


public:
	this() { }
	this(old: DoStatement) { }
}

//! The for statement is a while statement that evaluates init first
//! (optionally introducing Variables into the for's scope), and running
//! increment at the end of each block's execution. Other than that, it
//! keeps executing block while test evaluates to true.
class ForStatement : Statement
{
public:
	initVars: Variable[];
	initExps: Exp[];
	test: Exp;
	increments: Exp[];
	block: BlockStatement;


public:
	this() { }
	this(old: ForStatement) { }
}

//! The foreach statement loops over elements in an aggregate. Arrays and
//! AAs have builtin support, but users can define iteration solutions for
//! their own types too.
class ForeachStatement : Statement
{
public:
	reverse: bool;
	itervars: Variable[];
	refvars: bool[];
	aggregate: Exp;
	beginIntegerRange: Exp;
	endIntegerRange: Exp;
	block: BlockStatement;
	opApplyType: Named;
	decodeFunction: Function;


public:
	this() { }
	this(old: ForeachStatement) { }
}

//! A label statement associates a string with a position in the statement
//! stream. Goto can then be used to jump to that position and anger
//! Dijkstra.
class LabelStatement : Statement
{
public:
	label: string;
	childStatement: Node[];


public:
	this() { }
	this(old: LabelStatement) { }
}

//! An ExpStatement wraps an Expression in a Statement.
class ExpStatement : Statement
{
public:
	exp: Exp;


public:
	this() { }
	this(old: ExpStatement) { }
}

//! Represents a case in a switch statement.
class SwitchCase : Node
{
public:
	firstExp: Exp;
	originalFirstExp: Exp;
	secondExp: Exp;
	originalSecondExp: Exp;
	exps: Exp[];
	originalExps: Exp[];
	isDefault: bool;
	statements: BlockStatement;


public:
	this() { }
	this(old: SwitchCase) { }
}

//! A switch statement jumps to various case labels depending on the value
//! of its condition.
class SwitchStatement : Statement
{
public:
	isFinal: bool;
	condition: Exp;
	cases: SwitchCase[];
	withs: Exp[];
	condVar: Variable;


public:
	this() { }
	this(old: SwitchStatement) { }
}

//! The continue statement restarts a loop (while, dowhile, for, foreach).
class ContinueStatement : Statement
{
public:
	label: string;


public:
	this() { }
	this(old: ContinueStatement) { }
}

//! The break statement halts execution of a loop or a switch statement.
class BreakStatement : Statement
{
public:
	label: string;


public:
	this() { }
	this(old: BreakStatement) { }
}

//! The goto statement jumps to a label, or controls flow inside a switch
//! statement.
class GotoStatement : Statement
{
public:
	label: string;
	isDefault: bool;
	isCase: bool;
	exp: Exp;


public:
	this() { }
	this(old: GotoStatement) { }
}

//! All lookups inside of a WithStatement first check exp before performing
//! a regular lookup. Ambiguities are still errors.
class WithStatement : Statement
{
public:
	exp: Exp;
	block: BlockStatement;


public:
	this() { }
	this(old: WithStatement) { }
}

//! A synchronized statement ensures that only one thread of execution can
//! enter its block. An explicit mutex may be provided.
class SynchronizedStatement : Statement
{
public:
	exp: Exp;
	block: BlockStatement;


public:
	this() { }
	this(old: SynchronizedStatement) { }
}

//! The try statement allows the resolution of throw statements, by
//! rerouting thrown exceptions into various catch blocks.
class TryStatement : Statement
{
public:
	tryBlock: BlockStatement;
	catchVars: Variable[];
	catchBlocks: BlockStatement[];
	finallyBlock: BlockStatement;


public:
	this() { }
	this(old: TryStatement) { }
}

//! A throw statements halts the current functions execution and unwinds
//! the stack until it hits a try statement with an appropriate catch
//! statement or, failing that, it halts execution of the entire program.
class ThrowStatement : Statement
{
public:
	exp: Exp;


public:
	this() { }
	this(old: ThrowStatement) { }
}

//! ScopeStatements are executed on various conditions. Exits are always
//! executed when the given scope is left. Successes are executed when the
//! scope is left normally. Failures are executed when the scope is left by
//! way of an Exception.
class ScopeStatement : Statement
{
public:
	kind: ScopeKind;
	block: BlockStatement;


public:
	this() { }
	this(old: ScopeStatement) { }
}

//! Pragma statements do magical things. pragma(lib, "SDL"), for instance,
//! tells the compiler to link with SDL without the user having to specify
//! it on the command line. What pragmas are supported vary from compiler
//! to compiler, the only thing specified is that complying implementations
//! must die on unknown pragmas by default.
class PragmaStatement : Statement
{
public:
	type: string;
	arguments: Exp[];
	block: BlockStatement;


public:
	this() { }
	this(old: PragmaStatement) { }
}

//! A ConditionStatement provides for conditional compilation of
//! statements. If condition is true, then it is as if block was where the
//! ConditionStatement was. Otherwise, the _else block replaces it (if
//! present).
class ConditionStatement : Statement
{
public:
	condition: Condition;
	block: BlockStatement;
	_else: BlockStatement;


public:
	this() { }
	this(old: ConditionStatement) { }
}

//! The mixin statement mixes in a mixin function, mixin template or a
//! string.
class MixinStatement : Statement
{
public:
	//! Not optional for mixin("string").
	stringExp: Exp;
	//! Not optional for mixin .my.Ident!(...)
	id: QualifiedName;
	resolved: BlockStatement;


public:
	this() { }
	this(old: MixinStatement) { }
}

volta.ir.expression

module volta.ir.expression;


//! Base class for all expressions.
class Exp : Node
{
}

//! Base class for literal expressions.
class LiteralExp : Exp
{
public:
	exps: Exp[];
	type: Type;
}

//! A ternary expression is a shorthand if statement in the form of an
//! expression.
class Ternary : Exp
{
public:
	//! The condition to test.
	condition: Exp;
	//! Evaluate and return this if condition is true.
	ifTrue: Exp;
	//! Evaluate and return this if condition is false.
	ifFalse: Exp;


public:
	this() { }
	this(old: Ternary) { }
}

//! A BinOp is an operation the operates on two expressions with a given
//! operation.
class BinOp : Exp
{
public:
	enum Op
	{
		None,
		Assign,
		AddAssign,
		SubAssign,
		MulAssign,
		DivAssign,
		ModAssign,
		AndAssign,
		OrAssign,
		XorAssign,
		CatAssign,
		LSAssign,
		SRSAssign,
		RSAssign,
		PowAssign,
		OrOr,
		AndAnd,
		Or,
		Xor,
		And,
		Equal,
		NotEqual,
		Is,
		NotIs,
		Less,
		LessEqual,
		GreaterEqual,
		Greater,
		In,
		NotIn,
		LS,
		SRS,
		RS,
		Add,
		Sub,
		Cat,
		Mul,
		Div,
		Mod,
		Pow,
	}


public:
	//! The operation to perform.
	op: Op;
	//! The left hand side of the expression.
	left: Exp;
	//! The right hand side of the expression.
	right: Exp;
	//! Is an assignment generated for passing context to a closure.
	isInternalNestedAssign: bool;


public:
	this() { }
	this(old: BinOp) { }


public:
	static fn opToString(op: Op) string { }
}

//! A Unary operation is prepended to the back of an expression.
class Unary : Exp
{
public:
	enum Op
	{
		None,
		AddrOf,
		Increment,
		Decrement,
		Dereference,
		Minus,
		Plus,
		Not,
		Complement,
		New,
		TypeIdent,
		Cast,
		Dup,
	}


public:
	op: Op;
	value: Exp;
	hasArgumentList: bool;
	type: Type;
	argumentList: Exp[];
	argumentTags: Postfix.TagKind[];
	argumentLabels: string[];
	//! The constructor to call.
	ctor: Function;
	dupBeginning: Exp;
	dupEnd: Exp;
	fullShorthand: bool;


public:
	this() { }
	this(n: Type, e: Exp) { }
	this(old: Unary) { }
}

//! A postfix operation is appended to an expression.
class Postfix : Exp
{
public:
	enum Op
	{
		None,
		Identifier,
		Increment,
		Decrement,
		Call,
		Index,
		Slice,
		CreateDelegate,
		//! T.default -- default initialiser of T
		Default,
	}

	enum TagKind
	{
		None,
		Ref,
		Out,
	}


public:
	op: Op;
	child: Exp;
	arguments: Exp[];
	argumentTags: TagKind[];
	argumentLabels: string[];
	identifier: Identifier;
	memberFunction: ExpReference;
	templateInstance: Exp;
	isImplicitPropertyCall: bool;
	supressVtableLookup: bool;


public:
	this() { }
	this(old: Postfix) { }


public:
	static fn opToString(op: Op) string { }
}

//! A looked up postfix operation is appended to an expression.
class PropertyExp : Exp
{
public:
	child: Exp;
	//! For property get.
	getFn: Function;
	//! For property sets.
	setFns: Function[];
	identifier: Identifier;


public:
	this() { }
	this(old: PropertyExp) { }
}

//! A Constant is a literal value of a given type.
class Constant : Exp
{
public:
	union U
	{
	public:
		_byte: i8;
		_ubyte: u8;
		_short: i16;
		_ushort: u16;
		_int: i32;
		_uint: u32;
		_long: i64;
		_ulong: u64;
		_float: f32;
		_double: f64;
		_bool: bool;
		_pointer: void*;
	}


public:
	u: U;
	_string: string;
	isNull: bool;
	arrayData: immutable(void)[];
	type: Type;
	fromEnum: Enum;


public:
	this() { }
	this(old: Constant) { }
}

//! Represents an array literal. Contains a list of expressions with (if
//! semantically sound) a common type.
class ArrayLiteral : LiteralExp
{
public:
	this() { }
	this(old: ArrayLiteral) { }
}

class AAPair : Node
{
public:
	key: Exp;
	value: Exp;


public:
	this() { }
	this(key: Exp, value: Exp) { }
	this(old: AAPair) { }
}

//! Represents an associative array literal -- a list of key/value pairs.
class AssocArray : Exp
{
public:
	pairs: AAPair[];
	//! The type of the associative array.
	type: Type;


public:
	this() { }
	this(old: AssocArray) { }
}

//! Represents a single identifier. Replaced with ExpReference in a pass.
class IdentifierExp : Exp
{
public:
	globalLookup: bool;
	value: string;


public:
	this() { }
	this(s: string) { }
	this(old: IdentifierExp) { }
}

//! An Assert checks that a condition is true, and dies with an optional
//! message if not.
class Assert : Exp
{
public:
	condition: Exp;
	message: Exp;


public:
	this() { }
	this(old: Assert) { }
}

//! A StringImport creates a string literal from a file on disk at compile
//! time.
class StringImport : Exp
{
public:
	filename: Exp;


public:
	this() { }
	this(old: StringImport) { }
}

//! The typeid expression returns the typeinfo of a given type or
//! expression.
class Typeid : Exp
{
public:
	exp: Exp;
	type: Type;
	tinfoType: Type;


public:
	this() { }
	this(old: Typeid) { }
}

//! The is expression is a bit of a swiss army knife. It can be simply used
//! to determine whether a given type is well-formed, or if a given type is
//! a certain other type, or can be converted into another type.
class IsExp : Exp
{
public:
	enum Specialisation
	{
		None,
		Type,
		Struct,
		Union,
		Class,
		Interface,
		Enum,
		Function,
		Delegate,
		Super,
		Const,
		Immutable,
		Inout,
		Shared,
		Return,
	}

	enum Comparison
	{
		None,
		Implicit,
		Exact,
		TraitsWord,
	}


public:
	type: Type;
	specialisation: Specialisation;
	specType: Type;
	compType: Comparison;
	traitsWord: string;
	traitsModifier: string;


public:
	this() { }
	this(old: IsExp) { }
}

class FunctionParameter : Node
{
public:
	type: Type;
	name: string;


public:
	this() { }
	this(old: FunctionParameter) { }
}

//! A function literal can define a normal function, or a delegate (a
//! function with context). There are multiple ways to define these but the
//! long hand way is int function(int a, int b) { return a + b; } Defines a
//! function that takes two integers and returns them added up. int
//! delegate(int a, int b) { return a + b + c; } Is the same, except it has
//! access to the outer scope's variables.
class FunctionLiteral : Exp
{
public:
	isDelegate: bool;
	returnType: Type;
	params: FunctionParameter[];
	block: BlockStatement;
	singleLambdaParam: string;
	lambdaExp: Exp;


public:
	this() { }
	this(old: FunctionLiteral) { }
}

//! An ExpReference replaces chained postfix look ups with the result of
//! the lookup. A cache that is inserted later, in other words.
class ExpReference : Exp
{
public:
	idents: string[];
	decl: Declaration;
	//! A raw get to a function to bypass @property.
	rawReference: bool;
	doNotRewriteAsNestedLookup: bool;
	isSuperOrThisCall: bool;


public:
	this() { }
	this(old: ExpReference) { }
}

//! A StructLiteral is an expression form of a struct.
class StructLiteral : LiteralExp
{
public:
	this() { }
	this(old: StructLiteral) { }
}

//! A UnionLiteral is a compiler internal expression form of a struct
class UnionLiteral : LiteralExp
{
public:
	this() { }
	this(old: UnionLiteral) { }
}

//! A ClassLiteral is a compiler internal expression form of a class.
class ClassLiteral : LiteralExp
{
public:
	useBaseStorage: bool;


public:
	this() { }
	this(old: ClassLiteral) { }
}

//! A TypeExp is used when a primitive type is used in an expression. This
//! is currently limited to .max/min and (void*).max/min.
class TypeExp : Exp
{
public:
	type: Type;


public:
	this() { }
	this(old: TypeExp) { }
}

//! A StoreExp is used when a NamedType is used in an expression within a
//! WithStatement, like so: with (Class.Enum) { int val = DeclInEnum; }.
class StoreExp : Exp
{
public:
	idents: string[];
	store: Store;


public:
	this() { }
	this(old: StoreExp) { }
}

//! A StatementExp is a internal expression for inserting statements into a
//! expression. Note that this is not a function and executes the
//! statements just as if they where inserted in the BlockStatement that
//! the StatementExp is in. Meaning any ReturnStatement will return the
//! current function not this StatementExp.
class StatementExp : Exp
{
public:
	//! A list of statements to be executed.
	statements: Node[];
	//! The value of the StatementExp
	exp: Exp;
	//! If this was lowered from something, the original will go here.
	originalExp: Exp;


public:
	this() { }
	this(old: StatementExp) { }
}

//! Expression that corresponds to what was once special tokens. FUNCTION, 
//! PRETTY_FUNCTION, FILE, and __LINE.
class TokenExp : Exp
{
public:
	enum Type
	{
		//! Just the function name. (e.g. math.add)
		Function,
		//! Full signature. (e.g. int math.add(int a, int b))
		PrettyFunction,
		//! Current file. (e.g. foo.volt)
		File,
		//! Current line number. (e.g. 32)
		Line,
		//! Current file loc. (e.g. expression.d:933
		Location,
	}


public:
	type: Type;


public:
	this(type: TokenExp.Type) { }
	this(old: TokenExp) { }
}

//! Expression that assists in working with varargs.
class VaArgExp : Exp
{
public:
	arg: Exp;
	type: Type;


public:
	this() { }
	this(old: VaArgExp) { }
}

//! Representing a expression that is working on inbuilt types.
class BuiltinExp : Exp
{
public:
	enum Kind
	{
		//! Invalid.
		Invalid,
		//! arr.ptr
		ArrayPtr,
		//! arr.length
		ArrayLength,
		//! new arr[..]
		ArrayDup,
		//! aa.length
		AALength,
		//! aa.keys
		AAKeys,
		//! aa.values
		AAValues,
		//! aa.rehash
		AARehash,
		//! aa.get
		AAGet,
		//! aa.remove
		AARemove,
		//! "foo" in aa
		AAIn,
		//! new aa[..]
		AADup,
		//! '(exp).func'()
		UFCS,
		//! obj.classinfo
		Classinfo,
		//! s := StructName(structArg)
		PODCtor,
		//! va_start(vl)
		VaStart,
		//! va_arg!i32(vl)
		VaArg,
		//! va_end(vl)
		VaEnd,
		//! Build a class vtable.
		BuildVtable,
		//! The body of a toSink(sink, enum) function.
		EnumMembers,
	}


public:
	//! What kind of builtin is this.
	kind: Kind;
	//! The type of this exp, helps keeping the typer simple.
	type: Type;
	//! Common child exp.
	children: Exp[];
	//! For UFCS, PODCtor, EnumMembers, and VaArg.
	functions: Function[];
	//! For BuildVtable.
	_class: Class;
	//! For BuildVtable.
	functionSink: FunctionSink;
	//! For EnumMembers
	_enum: Enum;


public:
	this(kind: Kind, type: Type, children: Exp[]) { }
	this(kind: Kind, type: Type, _class: Class, functionSink: FunctionSink) { }
	this(old: BuiltinExp) { }
}

//! An expression that represents a simple identifier.identifier lookup.
class AccessExp : Exp
{
public:
	//! The instance we're looking up. (instance).field
	child: Exp;
	//! The field we're looking up. instance.(field)
	field: Variable;
	//! Cached instance type.
	aggregate: Type;


public:
	this() { }
	this(old: AccessExp) { }
}

//! An expression that forces the compiler to evaluate another expression
//! at compile time.
class RunExp : Exp
{
public:
	//! The expression to run.
	child: Exp;


public:
	this() { }
	this(old: RunExp) { }
}

//! A string that contains expressions to be formatted inline.
class ComposableString : Exp
{
public:
	//! True if it wasn't prefixed by 'new'.
	compileTimeOnly: bool;
	//! The components for the string, those that were contained in ${}.
	components: Exp[];


public:
	this() { }
	this(old: ComposableString) { }
}

volta.ir.declaration

module volta.ir.declaration;


//! Base class for all declarations.
class Declaration : Node
{
public:
	enum Kind
	{
		Invalid,
		Function,
		Variable,
		EnumDeclaration,
		FunctionSet,
		FunctionParam,
	}


public:
	annotations: Attribute[];


public:
	this(nt: NodeType) { }
	this(nt: NodeType, old: Declaration) { }
	fn declKind() Kind { }
}

//! Represents an instance of a type.
class Variable : Declaration
{
public:
	enum Storage
	{
		Invalid,
		//! Member of a struct/class.
		Field,
		//! Variable in a function.
		Function,
		//! Accessed in a nested function.
		Nested,
		//! Stored in TLS.
		Local,
		//! Stored in the global data segment.
		Global,
	}


public:
	isResolved: bool;
	access: Access;
	type: Type;
	name: string;
	mangledName: string;
	assign: Exp;
	storage: Storage;
	linkage: Linkage;
	isMergable: bool;
	//! Only for global variables.
	isExtern: bool;
	//! The type will be a ref storage type if this is set.
	isOut: bool;
	//! Has this variable been declared yet? (only useful in extyper)
	hasBeenDeclared: bool;
	useBaseStorage: bool;
	specialInitValue: bool;
	noInitialise: bool;


public:
	this() { }
	//! Construct a Variable with a given type and name.
	this(t: Type, name: string) { }
	this(old: Variable) { }


public:
	static fn storageToString(s: Storage) string { }
}

//! An Alias associates names with a Type. Once declared, using that name
//! is as using that Type directly.
class Alias : Node
{
public:
	isResolved: bool;
	access: Access;
	name: string;
	//! Non null type.
	externAttr: Attribute;
	type: Type;
	id: QualifiedName;
	staticIf: AliasStaticIf;
	//! Where are we looking for the symbol.
	lookScope: Scope;
	//! Where are we looking for the symbol.
	lookModule: Module;
	store: Store;
	//! Not with id. Optional.
	templateInstance: Exp;


public:
	this() { }
	this(old: Alias) { }
}

//! A function is a block of code that takes parameters, and may return a
//! value. There may be additional implied context, depending on where it's
//! defined.
class Function : Declaration
{
public:
	//! Used to specify function type.
	enum Kind
	{
		Invalid,
		//! foo()
		Function,
		//! this.foo()
		Member,
		//! Clazz.foo()
		LocalMember,
		//! Clazz.foo()
		GlobalMember,
		//! auto foo = new Clazz()
		Constructor,
		//! delete foo
		Destructor,
		//! local this() {}
		LocalConstructor,
		//! local ~this() {}
		LocalDestructor,
		//! global this() {}
		GlobalConstructor,
		//! global ~this() {}
		GlobalDestructor,
		//! void aFunction() { void foo() {} }
		Nested,
		//! void aFunction() { global void foo() {} }
		GlobalNested,
	}


public:
	isResolved: bool;
	isActualized: bool;
	access: Access;
	//! Needed for params
	myScope: Scope;
	//! What kind of function.
	kind: Kind;
	//! Prototype.
	type: FunctionType;
	params: FunctionParam[];
	nestedFunctions: Function[];
	//! The various scope (exit/success/failures) turned into inline
	//! functions.
	scopeSuccesses: Function[];
	//! The various scope (exit/success/failures) turned into inline
	//! functions.
	scopeExits: Function[];
	//! The various scope (exit/success/failures) turned into inline
	//! functions.
	scopeFailures: Function[];
	//! Pre mangling.
	name: string;
	mangledName: string;
	outParameter: string;
	//! Optional in contract.
	parsedIn: BlockStatement;
	//! Optional out contract.
	parsedOut: BlockStatement;
	//! Optional body.
	parsedBody: BlockStatement;
	//! Optional lazy parsed in contract.
	tokensIn: Token[];
	//! Optional lazy parsed out contract.
	tokensOut: Token[];
	//! Optional lazy parsed body.
	tokensBody: Token[];
	thisHiddenParameter: Variable;
	nestedHiddenParameter: Variable;
	nestedVariable: Variable;
	composableSinkVariable: Variable;
	nestStruct: Struct;
	isMergable: bool;
	//! If this is a member function, where in the vtable does it live?
	vtableIndex: i32;
	loadDynamic: bool;
	isMarkedOverride: bool;
	isOverridingInterface: bool;
	isAbstract: bool;
	isFinal: bool;
	isAutoReturn: bool;
	//! Is this a function a lowered construct, like scope.
	isLoweredScopeExit: bool;
	//! Is this a function a lowered construct, like scope.
	isLoweredScopeFailure: bool;
	//! Is this a function a lowered construct, like scope.
	isLoweredScopeSuccess: bool;
	templateName: string;
	templateType: Type;


public:
	this() { }
	this(old: Function) { }
	fn hasBody() bool { }
	fn hasInContract() bool { }
	fn hasOutContract() bool { }
}

class EnumDeclaration : Declaration
{
public:
	type: Type;
	assign: Exp;
	name: string;
	prevEnum: EnumDeclaration;
	resolved: bool;
	access: Access;
	isStandalone: bool;


public:
	this() { }
	this(old: EnumDeclaration) { }
}

//! Represents multiple functions associated with a single name.
class FunctionSet : Declaration
{
public:
	functions: Function[];
	//! For assigning an overloaded function to a delegate.
	reference: ExpReference;


public:
	this() { }
	this(old: FunctionSet) { }
	fn type() FunctionSetType { }
	//! Update reference to indicate function set has been resolved. Returns
	//! the function passed to it.
	fn resolved(func: Function) Function { }
}

//! Represents a parameter to a function.
class FunctionParam : Declaration
{
public:
	func: Function;
	index: size_t;
	assign: Exp;
	name: string;
	//! Has this parameter been nested into a nested context struct?
	hasBeenNested: bool;


public:
	this() { }
	this(old: FunctionParam) { }
	fn type() Type { }
}

volta.ir.templates

module volta.ir.templates;


enum TemplateKind
{
	Struct,
	Class,
	Union,
	Interface,
	Function,
}

//! Creates a concrete instance of a template.
class TemplateInstance : Node
{
public:
	kind: TemplateKind;
	definitionName: QualifiedName;
	instanceName: string;
	explicitMixin: bool;
	arguments: Node[];
	names: string[];
	myScope: Scope;
	oldParent: Scope;
	_struct: Struct;
	_function: Function;
	_class: Class;
	_union: Union;
	_interface: _Interface;


public:
	this() { }
	this(old: TemplateInstance) { }
}

class TemplateDefinition : Node
{
public:
	struct Parameter
	{
	public:
		type: Type;
		name: string;
	}


public:
	kind: TemplateKind;
	name: string;
	parameters: Parameter[];
	//! Filled in by the gatherer.
	typeReferences: TypeReference[];
	//! Filled in by the gatherer.
	myScope: Scope;
	//! Only one of these fields will be non-null, depending on kind.
	_struct: Struct;
	//! Only one of these fields will be non-null, depending on kind.
	_union: Union;
	//! Only one of these fields will be non-null, depending on kind.
	_interface: _Interface;
	//! Only one of these fields will be non-null, depending on kind.
	_class: Class;
	//! Only one of these fields will be non-null, depending on kind.
	_function: Function;


public:
	this() { }
	this(old: TemplateDefinition) { }
}

volta.token.lexer

module volta.token.lexer;


//! Tokenizes a source file.
fn lex(source: Source) TokenWriter { }

volta.token.source

module volta.token.source;


alias Mark = size_t;

//! Class for handling reading of Volt source code.
class Source
{
public:
	source: string;
	loc: Location;
	eof: bool;
	errSink: ErrorSink;


public:
	//! Sets the source to string and the current location and validate it as a
	//! utf8 source.
	this(s: string, filename: string, errSink: ErrorSink) { }
	//! Copy contructor, same as dup.
	this(src: Source) { }
	//! Validate that the current start of source has a valid utf8 BOM.
	fn checkBOM() { }
	//! Set the loc to newFilename(line:1).
	fn changeCurrentLocation(newFilename: string, newLine: u32) { }
	//! Used to skip the first script line in D sources.
	fn skipScriptLine() { }
	//! Used to skip whitespace in the source file, as defined by
	//! watt.text.ascii.isWhite.
	fn skipWhitespace() { }
	//! Skips till character after next end of line or eof.
	fn skipEndOfLine() { }
	fn decodeChar() dchar { }
	fn decodeChar(index: size_t) dchar { }
	//! Get the next unicode character.
	fn next() dchar { }
	//! Returns the current utf8 char.
	fn current() dchar { }
	//! Return the unicode character n chars forwards. lookaheadEOF set to true
	//! if we reached EOF, otherwise false.
	fn lookahead(n: size_t, lookaheadEOF: bool) dchar { }
	//! Returns a index for the current loc.
	fn save() Mark { }
	//! Get a slice from the current token to mark. mark must before current
	//! token.
	fn sliceFrom(mark: Mark) string { }
	//! Synchronise this source with a duplicated one.
	fn sync(src: Source) { }
}

volta.parser.base

module volta.parser.base;

public import volta.ir.token;


enum ParseStatus
{
	Succeeded,
	Failed,
}

alias Succeeded = ParseStatus.Succeeded;
alias Failed = ParseStatus.Failed;
//! Just for convenience.
alias NodeSinkDg = void delegate(ir.Node);

//! Used as a sink for functions that return multiple nodes.
class NodeSink
{
public:
	this() { }
	fn push(n: ir.Node) { }
	fn pushNodes(nodes: ir.Node[]) { }
	fn array() ir.Node[] { }
}

class ParserStream : TokenStream
{
public:
	parserErrors: ParserError[];
	neverIgnoreError: bool;
	lastDocComment: Token;
	//! For backwards doc comments (like this one).
	retroComment: ir.Node;
	multiDepth: i32;
	settings: Settings;
	globalDocComments: string[];
	magicFlagD: bool;
	setExpLocationVisitor: SetExpLocationVisitor;


public:
	this(tokens: Token[], settings: Settings, errSink: ErrorSink) { }
	fn eof() bool { }
	fn eofIndex(i: size_t) bool { }
	//! Get the current token and advances the stream to the next token.
	fn get() Token { }
	fn saveTokens() size_t { }
	fn doneSavingTokens(startIndex: size_t) Token[] { }
	fn resetErrors() { }
	fn pushCommentLevel() { }
	fn popCommentLevel() { }
	//! Add a comment to the current comment level.
	fn addComment(comment: Token) { }
	//! Retrieve and clear the current comment.
	fn comment() string { }
	//! True if we found @ { on its own, so apply the last doccomment multiple
	//! times, until we see a matching number of @ }s.
	fn inMultiCommentBlock() bool { }
}

fn parsePanic(ps: ParserStream, loc: const(Location), nodeType: ir.NodeType, message: string, file: string, line: const(i32)) ParseStatus { }
fn unexpectedToken(ps: ParserStream, ntype: ir.NodeType, file: string, line: const(i32)) ParseStatus { }
fn unexpectedToken(ps: ParserStream, n: ir.Node, file: string, line: const(i32)) ParseStatus { }
fn wrongToken(ps: ParserStream, ntype: ir.NodeType, found: Token, expected: TokenType, file: string, line: const(i32)) ParseStatus { }
fn parseFailed(ps: ParserStream, ntype: ir.NodeType, file: string, line: const(i32)) ParseStatus { }
fn parseFailed(ps: ParserStream, n: ir.Node, file: string, line: const(i32)) ParseStatus { }
fn parseFailed(ps: ParserStream, ntype: ir.NodeType, ntype2: ir.NodeType, file: string, line: const(i32)) ParseStatus { }
fn unsupportedFeature(ps: ParserStream, n: ir.Node, s: string, file: string, l: const(i32)) ParseStatus { }
fn invalidIntegerLiteral(ps: ParserStream, loc: const(Location), file: string, line: const(i32)) ParseStatus { }
fn parseExpected(ps: ParserStream, loc: const(Location), nodeType: ir.NodeType, message: string, file: string, line: const(i32)) ParseStatus { }
fn parseExpected(ps: ParserStream, loc: const(Location), n: ir.Node, message: string, file: string, line: const(i32)) ParseStatus { }
fn allArgumentsMustBeLabelled(ps: ParserStream, loc: const(Location), file: string, line: const(i32)) ParseStatus { }
fn docCommentMultiple(ps: ParserStream, loc: const(Location), file: string, line: const(i32)) ParseStatus { }
fn strayDocComment(ps: ParserStream, loc: const(Location), file: string, line: const(i32)) ParseStatus { }
fn badComposable(ps: ParserStream, loc: const(Location), file: string, line: const(i32)) ParseStatus { }
fn badMultiBind(ps: ParserStream, loc: const(Location), file: string, line: const(i32)) ParseStatus { }
//! Match the current token on the parserstream @ps against @type. Does not
//! advance the parserstream.
fn checkToken(ps: ParserStream, ntype: ir.NodeType, type: TokenType, file: string, line: const(i32)) ParseStatus { }
//! Match the current token on the parserstream @ps against @type. Does not
//! advance the parserstream.
fn checkTokens(ps: ParserStream, ntype: ir.NodeType, types: scope (const(scope (TokenType)[]), file: string, line: const(i32)) ParseStatus { }
//! Match the current Token on the ParserStream @ps against @type.
fn match(ps: ParserStream, ntype: ir.NodeType, type: TokenType, file: string, line: const(i32)) ParseStatus { }
//! Match the current token on the parserstream @ps against @type.
fn match(ps: ParserStream, node: ir.Node, type: TokenType, file: string, line: const(i32)) ParseStatus { }
//! Match the current tokens on the parserstream @ps against @types.
fn match(ps: ParserStream, ntype: ir.NodeType, types: scope (const(scope (TokenType)[]), file: string, line: const(i32)) ParseStatus { }
//! Match the current token on the parserstream @ps against @type.
fn match(ps: ParserStream, n: ir.Node, type: TokenType, tok: Token, file: string, line: const(i32)) ParseStatus { }
//! Match the current token on the parserstream @ps against @type.
fn match(ps: ParserStream, nodeType: ir.NodeType, type: TokenType, tok: Token, file: string, line: const(i32)) ParseStatus { }
//! Matches the current token on the parserstream @ps against @type and if
//! they matches gets it from the stream.
fn matchIf(ps: ParserStream, type: TokenType) bool { }
//! Add all doccomment tokens to the current comment level.
fn eatComments(ps: ParserStream) ParseStatus { }
//! Parse a QualifiedName, leadingDot optinal.
fn parseQualifiedName(ps: ParserStream, name: ir.QualifiedName, allowLeadingDot: bool) ParseStatus { }
//! Parse a single Identifier.
fn parseIdentifier(ps: ParserStream, i: ir.Identifier) ParseStatus { }
//! Returns true if the ParserStream is in a state where there is a colon
//! (along with optional identifiers and commas) before a semicolon.
//! Basically, returns true if we're at a new-style (a : i32) variable
//! declaration.
fn isColonDeclaration(ps: ParserStream) bool { }

volta.parser.errors

module volta.parser.errors;


//! Describes a parse failure.
class ParserError
{
public:
	enum Kind
	{
		//! No error.
		Ok,
		//! The parser has made an error.
		Panic,
		//! A token wasn't where we expected it to be.
		UnexpectedToken,
		//! Wrong token was found.
		WrongToken,
		//! A parse failed. That failure will be i-1 on parseErrors.
		ParseFailed,
		//! A feature was used that is unsupported.
		UnsupportedFeature,
		//! An invalid integer literal was supplied.
		InvalidIntegerLiteral,
		//! We expected something and didn't get it.
		Expected,
		//! All arguments must be labelled.
		AllArgumentsMustBeLabelled,
		//! Doc comment applies to multiple nodes.
		DocCommentMultiple,
		//! Start doc comment in token stream.
		StrayDocComment,
		//! new "string without component"
		BadComposableString,
		//! Only bind imports can use multibind.
		BadMultiBind,
	}


public:
	//! Every error type uses at least these three. type: The type of error
	//! that occurred. location: Where the error occurred. nodeType: The node
	//! that was being parsed when the error occured.
	kind: Kind;
	//! Every error type uses at least these three. type: The type of error
	//! that occurred. location: Where the error occurred. nodeType: The node
	//! that was being parsed when the error occured.
	loc: Location;
	//! Every error type uses at least these three. type: The type of error
	//! that occurred. location: Where the error occurred. nodeType: The node
	//! that was being parsed when the error occured.
	nodeType: NodeType;
	//! Keeps track of where the error was raised. For internal debug.
	raiseFile: string;
	//! Keeps track of where the error was raised. For internal debug.
	raiseLine: i32;


public:
	this(kind: Kind, loc: Location, nodeType: NodeType, file: string, line: const(i32)) { }
	fn errorMessage() string;
}

class ParserPanic : ParserError
{
public:
	//! The panic error message.
	message: string;


public:
	this(loc: const(Location), nodeType: NodeType, message: string, file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserUnexpectedToken : ParserError
{
public:
	found: string;


public:
	this(loc: const(Location), nodeType: NodeType, found: string, file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserWrongToken : ParserError
{
public:
	found: TokenType;
	expected: TokenType;


public:
	this(loc: const(Location), nodeType: NodeType, found: TokenType, expected: TokenType, file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserParseFailed : ParserError
{
public:
	otherNodeType: NodeType;


public:
	this(loc: const(Location), nodeType: NodeType, otherNodeType: NodeType, file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserUnsupportedFeature : ParserError
{
public:
	description: string;


public:
	this(loc: const(Location), nodeType: NodeType, description: string, file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserInvalidIntegerLiteral : ParserError
{
public:
	this(loc: const(Location), nodeType: NodeType, file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserAllArgumentsMustBeLabelled : ParserError
{
public:
	this(loc: const(Location), file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserExpected : ParserError
{
public:
	//! What was expected.
	message: string;


public:
	this(loc: const(Location), nodeType: NodeType, message: string, file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserDocMultiple : ParserError
{
public:
	this(loc: const(Location), file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserStrayDocComment : ParserError
{
public:
	this(loc: const(Location), file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserNotAComposableString : ParserError
{
public:
	this(loc: const(Location), file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

class ParserBadMultiBind : ParserError
{
public:
	this(loc: const(Location), file: string, line: const(i32)) { }
	fn errorMessage() string { }
}

volta.parser.toplevel

module volta.parser.toplevel;

public import volta.parser.statements;


fn parseModule(ps: ParserStream, mod: ir.Module) ParseStatus { }
fn createImport(loc: const(Location), names: scope (scope (string)[])) ir.Node { }
fn parseOneTopLevelBlock(ps: ParserStream, tlb: ir.TopLevelBlock) ParseStatus { }
fn ifDocCommentsUntilEndThenSkip(ps: ParserStream) bool { }
fn parseTopLevelBlock(ps: ParserStream, tlb: ir.TopLevelBlock, end: TokenType) ParseStatus { }
fn parseImport(ps: ParserStream, _import: ir.Import) ParseStatus { }
fn parseUnittest(ps: ParserStream, u: ir.Unittest) ParseStatus { }
fn parseConstructor(ps: ParserStream, c: ir.Function) ParseStatus { }
fn parseDestructor(ps: ParserStream, d: ir.Function) ParseStatus { }
fn parseClass(ps: ParserStream, c: ir.Class, templateName: string) ParseStatus { }
fn parseInterface(ps: ParserStream, i: ir._Interface, templateName: string) ParseStatus { }
fn parseUnion(ps: ParserStream, u: ir.Union, templateName: string) ParseStatus { }
fn parseStruct(ps: ParserStream, s: ir.Struct, templateName: string) ParseStatus { }
fn parseEnum(ps: ParserStream, output: ir.Node[]) ParseStatus { }
fn parseMixinFunction(ps: ParserStream, m: ir.MixinFunction) ParseStatus { }
fn parseMixinTemplate(ps: ParserStream, m: ir.MixinTemplate) ParseStatus { }
fn parseAttribute(ps: ParserStream, attr: ir.Attribute, noTopLevel: bool) ParseStatus { }
fn parseCondition(ps: ParserStream, condition: ir.Condition) ParseStatus { }
fn parseConditionTopLevel(ps: ParserStream, ctl: ir.ConditionTopLevel) ParseStatus { }

volta.parser.statements

module volta.parser.statements;


fn parseStatement(ps: ParserStream, dgt: NodeSinkDg) ParseStatus { }
fn parseVariableOrExpression(ps: ParserStream, dgt: NodeSinkDg) ParseStatus { }
fn parseAssertStatement(ps: ParserStream, as: ir.AssertStatement) ParseStatus { }
fn parseExpStatement(ps: ParserStream, e: ir.ExpStatement) ParseStatus { }
fn parseReturnStatement(ps: ParserStream, r: ir.ReturnStatement) ParseStatus { }
fn parseBlockStatement(ps: ParserStream, bs: ir.BlockStatement) ParseStatus { }
fn parseAsmStatement(ps: ParserStream, as: ir.AsmStatement) ParseStatus { }
fn parseIfStatement(ps: ParserStream, i: ir.IfStatement) ParseStatus { }
fn parseWhileStatement(ps: ParserStream, w: ir.WhileStatement) ParseStatus { }
fn parseDoStatement(ps: ParserStream, d: ir.DoStatement) ParseStatus { }
fn parseForeachStatement(ps: ParserStream, f: ir.ForeachStatement) ParseStatus { }
fn parseForStatement(ps: ParserStream, f: ir.ForStatement) ParseStatus { }
fn parseLabelStatement(ps: ParserStream, ls: ir.LabelStatement) ParseStatus { }
fn parseSwitchStatement(ps: ParserStream, ss: ir.SwitchStatement) ParseStatus { }
fn parseContinueStatement(ps: ParserStream, cs: ir.ContinueStatement) ParseStatus { }
fn parseBreakStatement(ps: ParserStream, bs: ir.BreakStatement) ParseStatus { }
fn parseGotoStatement(ps: ParserStream, gs: ir.GotoStatement) ParseStatus { }
fn parseWithStatement(ps: ParserStream, ws: ir.WithStatement) ParseStatus { }
fn parseSynchronizedStatement(ps: ParserStream, ss: ir.SynchronizedStatement) ParseStatus { }
fn parseTryStatement(ps: ParserStream, t: ir.TryStatement) ParseStatus { }
fn parseThrowStatement(ps: ParserStream, t: ir.ThrowStatement) ParseStatus { }
fn parseScopeStatement(ps: ParserStream, ss: ir.ScopeStatement) ParseStatus { }
fn parsePragmaStatement(ps: ParserStream, prs: ir.PragmaStatement) ParseStatus { }
fn parseConditionStatement(ps: ParserStream, cs: ir.ConditionStatement) ParseStatus { }
fn parseMixinStatement(ps: ParserStream, ms: ir.MixinStatement) ParseStatus { }
fn parseStaticIs(ps: ParserStream, as: ir.AssertStatement) ParseStatus { }
fn parseColonAssign(ps: ParserStream, dgt: NodeSinkDg) ParseStatus { }
fn parseColonDeclaration(ps: ParserStream, comment: string, idents: Token[], dgt: NodeSinkDg) ParseStatus { }

volta.parser.declaration

module volta.parser.declaration;


fn parseVariable(ps: ParserStream, dgt: NodeSinkDg) ParseStatus { }
fn parseJustVariable(ps: ParserStream, dgt: NodeSinkDg) ParseStatus { }
fn parseAlias(ps: ParserStream, a: ir.Alias) ParseStatus { }
fn parseAliasStaticIf(ps: ParserStream, asi: ir.AliasStaticIf) ParseStatus { }
fn reallyParseVariable(ps: ParserStream, base: ir.Type, dgt: NodeSinkDg) ParseStatus { }
fn parseType(ps: ParserStream, base: ir.Type) ParseStatus { }
fn parseTypeOf(ps: ParserStream, typeOf: ir.TypeOf) ParseStatus { }
fn parseTypeReference(ps: ParserStream, typeReference: ir.TypeReference) ParseStatus { }
fn parseStorageType(ps: ParserStream, storageType: ir.StorageType) ParseStatus { }
fn parseNewFunctionParams(ps: ParserStream, func: ir.CallableType) ParseStatus { }
fn parseNewFunctionType(ps: ParserStream, func: ir.CallableType) ParseStatus { }
fn parseFunctionType(ps: ParserStream, func: ir.FunctionType, base: ir.Type) ParseStatus { }
fn parseDelegateType(ps: ParserStream, func: ir.DelegateType, base: ir.Type) ParseStatus { }
fn parseParameterListFPtr(ps: ParserStream, types: ir.Type[], parentCallable: ir.CallableType) ParseStatus { }
fn parseParameterList(ps: ParserStream, vars: ir.Variable[], parentCallable: ir.CallableType) ParseStatus { }
fn parseParameter(ps: ParserStream, p: ir.Variable) ParseStatus { }
fn isUnambiguouslyAA(ps: ParserStream) bool { }
fn parseTypeSigils(ps: ParserStream, outType: ir.Type, origin: Location, base: ir.Type) ParseStatus { }
fn parsePrimitiveType(ps: ParserStream) ir.Type { }
fn parseNewFunction(ps: ParserStream, func: ir.Function, templateName: string) ParseStatus { }
fn parseBraceCountedTokenList(ps: ParserStream, tokens: ir.Token[], owner: ir.Node) ParseStatus { }
fn parseFunction(ps: ParserStream, func: ir.Function, base: ir.Type) ParseStatus { }
//! This parses a function block, different from BlockStatement.
fn parseBlock(ps: ParserStream, bs: ir.BlockStatement) ParseStatus { }
fn parseEnumDeclaration(ps: ParserStream, edecl: ir.EnumDeclaration, standalone: bool) ParseStatus { }

volta.util.copy

module volta.util.copy;


fn copy(old: ir.AccessExp) ir.AccessExp { }
fn copy(cnst: ir.Constant) ir.Constant { }
fn copy(bs: ir.BlockStatement) ir.BlockStatement { }
fn copy(rs: ir.ReturnStatement) ir.ReturnStatement { }
fn copy(bo: ir.BinOp) ir.BinOp { }
fn copy(ie: ir.IdentifierExp) ir.IdentifierExp { }
fn copy(te: ir.TokenExp) ir.TokenExp { }
fn copy(te: ir.TypeExp) ir.TypeExp { }
fn copy(se: ir.StoreExp) ir.StoreExp { }
fn copy(ar: ir.ArrayLiteral) ir.ArrayLiteral { }
fn copy(er: ir.ExpReference) ir.ExpReference { }
fn copy(ident: ir.Identifier) ir.Identifier { }
fn copy(pfix: ir.Postfix) ir.Postfix { }
fn copy(unary: ir.Unary) ir.Unary { }
fn copy(old: ir.PropertyExp) ir.PropertyExp { }
fn copy(old: ir.PrimitiveType) ir.PrimitiveType { }
fn copy(old: ir.PointerType) ir.PointerType { }
fn copy(old: ir.ArrayType) ir.ArrayType { }
fn copy(old: ir.StaticArrayType) ir.StaticArrayType { }
fn copy(old: ir.AAType) ir.AAType { }
fn copy(old: ir.FunctionType) ir.FunctionType { }
fn copy(old: ir.DelegateType) ir.DelegateType { }
fn copy(old: ir.StorageType) ir.StorageType { }
fn copy(old: ir.TypeReference) ir.TypeReference { }
fn copy(old: ir.NullType) ir.NullType { }
fn copy(old: ir.Typeid) ir.Typeid { }
fn copy(old: ir.AutoType) ir.AutoType { }
fn copy(old: ir.BuiltinExp) ir.BuiltinExp { }
fn copy(old: ir.RunExp) ir.RunExp { }
fn copy(old: ir.ComposableString) ir.ComposableString { }
fn copy(old: ir.StatementExp) ir.StatementExp { }
fn copy(old: ir.Ternary) ir.Ternary { }
fn copy(old: ir.QualifiedName) ir.QualifiedName { }
//! Helper function that takes care of up casting the return from copyDeep.
fn copyType(t: ir.Type) ir.Type { }
//! Helper function that takes care of up casting the return from copyDeep.
fn copyExp(exp: ir.Exp) ir.Exp { }
fn copyExp(loc: const(Location), exp: ir.Exp) ir.Exp { }
//! Copies a node and all its children nodes.
fn copyNode(n: ir.Node) ir.Node { }

volta.util.util

module volta.util.util;


//! Builds an identifier exp from a string.
fn buildIdentifierExp(loc: const(Location), value: string, isGlobal: bool) ir.IdentifierExp { }
//! Builds a QualifiedName from an array.
fn buildQualifiedName(loc: const(Location), value: scope (scope (string)[])) ir.QualifiedName { }
//! Builds a QualifiedName from a Identifier.
fn buildQualifiedNameSmart(i: ir.Identifier) ir.QualifiedName { }
//! Return the scope from the given type if it is, a aggregate or a
//! derivative from one.
fn getScopeFromType(type: ir.Type) ir.Scope { }
//! For the given store get the scope that it introduces.
fn getScopeFromStore(store: ir.Store) ir.Scope { }
//! Does a smart copy of a type.
fn copyTypeSmart(loc: const(Location), type: ir.Type) ir.Type { }
fn buildTypeReference(loc: const(Location), type: ir.Type, names: scope (scope (string)[])) ir.TypeReference { }
fn buildTypeReference(loc: const(Location), type: ir.Type, id: ir.QualifiedName) ir.TypeReference { }
fn buildStorageType(loc: const(Location), kind: ir.StorageType.Kind, base: ir.Type) ir.StorageType { }
//! Build a PrimitiveType.
fn buildPrimitiveType(loc: const(Location), kind: ir.PrimitiveType.Kind) ir.PrimitiveType { }
fn buildArrayType(loc: const(Location), base: ir.Type) ir.ArrayType { }
fn buildArrayTypeSmart(loc: const(Location), base: ir.Type) ir.ArrayType { }
fn buildVoid(loc: const(Location)) ir.PrimitiveType { }
fn buildBool(loc: const(Location)) ir.PrimitiveType { }
fn buildChar(loc: const(Location)) ir.PrimitiveType { }
fn buildDchar(loc: const(Location)) ir.PrimitiveType { }
fn buildWchar(loc: const(Location)) ir.PrimitiveType { }
fn buildByte(loc: const(Location)) ir.PrimitiveType { }
fn buildUbyte(loc: const(Location)) ir.PrimitiveType { }
fn buildShort(loc: const(Location)) ir.PrimitiveType { }
fn buildUshort(loc: const(Location)) ir.PrimitiveType { }
fn buildInt(loc: const(Location)) ir.PrimitiveType { }
fn buildUint(loc: const(Location)) ir.PrimitiveType { }
fn buildLong(loc: const(Location)) ir.PrimitiveType { }
fn buildUlong(loc: const(Location)) ir.PrimitiveType { }
fn buildFloat(loc: const(Location)) ir.PrimitiveType { }
fn buildDouble(loc: const(Location)) ir.PrimitiveType { }
fn buildReal(loc: const(Location)) ir.PrimitiveType { }
fn buildSizeT(loc: const(Location), target: TargetInfo) ir.PrimitiveType { }
//! Build a string (immutable(char)[]) type.
fn buildString(loc: const(Location)) ir.ArrayType { }
fn buildStringArray(loc: const(Location)) ir.ArrayType { }
//! Build a void* type.
fn buildVoidPtr(loc: const(Location)) ir.PointerType { }
//! Build a void[] type.
fn buildVoidArray(loc: const(Location)) ir.ArrayType { }
fn buildPtrSmart(loc: const(Location), base: ir.Type) ir.PointerType { }
fn buildPtr(loc: const(Location), base: ir.Type) ir.PointerType { }
fn buildArrayLiteralSmart(loc: const(Location), type: ir.Type, exps: scope (scope (ir.Exp)[])) ir.ArrayLiteral { }
fn buildStructLiteralSmart(loc: const(Location), type: ir.Type, exps: scope (scope (ir.Exp)[])) ir.StructLiteral { }
fn buildUnionLiteralSmart(loc: const(Location), type: ir.Type, exps: scope (scope (ir.Exp)[])) ir.UnionLiteral { }
//! Add a Variable to the BlockStatement scope and either to its statement
//! or if StatementExp given to it instead.
fn addVariable(errSink: ErrorSink, b: ir.BlockStatement, statExp: ir.StatementExp, var: ir.Variable) { }
//! Build a Variable, while not being smart about its type.
fn buildVariable(loc: const(Location), type: ir.Type, st: ir.Variable.Storage, name: string, assign: ir.Exp) ir.Variable { }
//! Build a Variable with an anon. name and insert it into the
//! BlockStatement or StatementExp if given. Note even if you want the
//! Variable to end up in the StatementExp you must give it the
//! BlockStatement that the StatementExp lives in as the variable will be
//! added to its scope and generated a uniqe name from its context.
fn buildVariableAnonSmart(errSink: ErrorSink, loc: const(Location), b: ir.BlockStatement, statExp: ir.StatementExp, type: ir.Type, assign: ir.Exp) ir.Variable { }
//! Build a variable and add it to the top of a block statement.
fn buildVariableAnonSmartAtTop(errSink: ErrorSink, loc: const(Location), b: ir.BlockStatement, type: ir.Type, assign: ir.Exp) ir.Variable { }
//! Create an anonymous variable for a statementexp without a block
//! statement.
fn buildVariableAnonSmart(errSink: ErrorSink, loc: const(Location), current: ir.Scope, statExp: ir.StatementExp, type: ir.Type, assign: ir.Exp) ir.Variable { }
//! Copy a Variable, while being smart about its type, does not copy the
//! the assign exp on the Variable.
fn copyVariableSmart(loc: const(Location), right: ir.Variable) ir.Variable { }
fn copyVariablesSmart(loc: const(Location), vars: ir.Variable[]) ir.Variable[] { }
//! Get ExpReferences from a list of variables.
fn getExpRefs(loc: const(Location), vars: ir.FunctionParam[]) ir.Exp[] { }
//! Build a Variable, while being smart about its type.
fn buildVariableSmart(loc: const(Location), type: ir.Type, st: ir.Variable.Storage, name: string) ir.Variable { }
//! Builds a usable ExpReference.
fn buildExpReference(loc: const(Location), decl: ir.Declaration, names: scope (scope (string)[])) ir.ExpReference { }
fn buildExpReference(loc: const(Location), func: ir.Function) ir.ExpReference { }
//! Builds a constant double.
fn buildConstantDouble(loc: const(Location), value: f64) ir.Constant { }
//! Builds a constant float.
fn buildConstantFloat(loc: const(Location), value: f32) ir.Constant { }
//! Builds a constant int.
fn buildConstantInt(loc: const(Location), value: i32) ir.Constant { }
fn buildConstantUint(loc: const(Location), value: u32) ir.Constant { }
fn buildConstantLong(loc: const(Location), value: i64) ir.Constant { }
fn buildConstantUlong(loc: const(Location), value: u64) ir.Constant { }
fn buildConstantByte(loc: const(Location), value: i8) ir.Constant { }
fn buildConstantUbyte(loc: const(Location), value: u8) ir.Constant { }
fn buildConstantShort(loc: const(Location), value: i16) ir.Constant { }
fn buildConstantUshort(loc: const(Location), value: u16) ir.Constant { }
//! Builds a constant bool.
fn buildConstantBool(loc: const(Location), val: bool) ir.Constant { }
fn buildConstantNull(loc: const(Location), base: ir.Type) ir.Constant { }
//! Gets a size_t Constant and fills it with a value.
fn buildConstantSizeT(loc: const(Location), target: TargetInfo, val: size_t) ir.Constant { }
//! Builds a constant string.
fn buildConstantString(errSink: ErrorSink, loc: const(Location), val: string, escape: bool) ir.Constant { }
fn buildConstantStringNoEscape(loc: const(Location), val: string) ir.Constant { }
//! Builds a constant 'c' string.
fn buildConstantCString(errSink: ErrorSink, loc: const(Location), val: string, escape: bool) ir.Exp { }
//! Build a constant to insert to the IR from a resolved EnumDeclaration.
fn buildConstantEnum(loc: const(Location), ed: ir.EnumDeclaration) ir.Constant { }
fn buildEnumDeclaration(loc: const(Location), type: ir.Type, assign: ir.Exp, name: string) ir.EnumDeclaration { }
fn buildConstantTrue(loc: const(Location)) ir.Constant { }
fn buildConstantFalse(loc: const(Location)) ir.Constant { }
//! Build a cast and sets the loc, does not call copyTypeSmart.
fn buildCast(loc: const(Location), type: ir.Type, exp: ir.Exp) ir.Unary { }
//! Build a cast, sets the loc and calling copyTypeSmart on the type, to
//! avoid duplicate nodes.
fn buildCastSmart(loc: const(Location), type: ir.Type, exp: ir.Exp) ir.Unary { }
fn buildCastToBool(loc: const(Location), exp: ir.Exp) ir.Unary { }
fn buildCastToVoidPtr(loc: const(Location), exp: ir.Exp) ir.Unary { }
//! Builds a not expression.
fn buildNot(loc: const(Location), exp: ir.Exp) ir.Unary { }
//! Builds an AddrOf expression.
fn buildAddrOf(loc: const(Location), exp: ir.Exp) ir.Unary { }
//! Builds a ExpReference and a AddrOf from a Variable.
fn buildAddrOf(loc: const(Location), var: ir.Variable, names: scope (scope (string)[])) ir.Unary { }
//! Builds a dereference expression.
fn buildDeref(loc: const(Location), exp: ir.Exp) ir.Unary { }
//! Builds an expression that dereferences a variable.
fn buildDeref(loc: const(Location), var: ir.Variable) ir.Unary { }
//! Builds a New expression.
fn buildNew(loc: const(Location), type: ir.Type, name: string, arguments: scope (scope (ir.Exp)[])) ir.Unary { }
fn buildNewSmart(loc: const(Location), type: ir.Type, arguments: scope (scope (ir.Exp)[])) ir.Unary { }
//! Builds a typeid with type smartly.
fn buildTypeidSmart(loc: const(Location), type: ir.Type) ir.Typeid { }
//! Build a typeid casting if needed.
fn buildTypeidSmart(loc: const(Location), typeInfoClass: ir.Class, type: ir.Type) ir.Exp { }
//! Builds a BuiltinExp of ArrayPtr type. Make sure the type you pass in is
//! the base of the array and that the child exp is not a pointer to an
//! array.
fn buildArrayPtr(loc: const(Location), base: ir.Type, child: ir.Exp) ir.BuiltinExp { }
//! Builds a BuiltinExp of BuildVtable type.
fn buildBuildVtable(loc: const(Location), type: ir.Type, _class: ir.Class, functionSink: FunctionSink) ir.BuiltinExp { }
//! Builds a BuiltinExp of EnumMembers type.
fn buildEnumMembers(loc: const(Location), _enum: ir.Enum, enumRef: ir.Exp, sinkRef: ir.Exp) ir.BuiltinExp { }
//! Builds a BuiltinExp of ArrayLength type. Make sure the child exp is not
//! a pointer to an array.
fn buildArrayLength(loc: const(Location), target: TargetInfo, child: ir.Exp) ir.BuiltinExp { }
//! Builds an ArrayDup BuiltinExp.
fn buildArrayDup(loc: const(Location), t: ir.Type, children: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AALength type.
fn buildAALength(loc: const(Location), target: TargetInfo, child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AAKeys type.
fn buildAAKeys(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AAValues type.
fn buildAAValues(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AARehash type.
fn buildAARehash(loc: const(Location), child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AAGet type.
fn buildAAGet(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AARemove type.
fn buildAARemove(loc: const(Location), child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AARemove type.
fn buildUFCS(loc: const(Location), type: ir.Type, child: ir.Exp, funcs: ir.Function[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of Classinfo type.
fn buildClassinfo(loc: const(Location), type: ir.Type, child: ir.Exp) ir.BuiltinExp { }
//! Builds a BuiltinExp of AARemove type.
fn buildAAIn(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of AADup type.
fn buildAADup(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp { }
//! Builds a BuiltinExp of PODCtor type.
fn buildPODCtor(loc: const(Location), pod: ir.PODAggregate, postfix: ir.Postfix, ctor: ir.Function) ir.BuiltinExp { }
//! Build a postfix Identifier expression.
fn buildPostfixIdentifier(loc: const(Location), exp: ir.Exp, name: string) ir.Postfix { }
fn buildAccessExp(loc: const(Location), child: ir.Exp, field: ir.Variable) ir.AccessExp { }
//! Builds a chain of postfix lookups from a QualifiedName. These are only
//! useful before the extyper runs.
fn buildPostfixIdentifier(loc: const(Location), qname: ir.QualifiedName, name: string) ir.Postfix { }
//! Builds a postfix slice.
fn buildSlice(loc: const(Location), child: ir.Exp, args: scope (scope (ir.Exp)[])) ir.Postfix { }
//! Builds a postfix increment.
fn buildIncrement(loc: const(Location), child: ir.Exp) ir.Postfix { }
//! Builds a postfix decrement.
fn buildDecrement(loc: const(Location), child: ir.Exp) ir.Postfix { }
//! Builds a postfix index.
fn buildIndex(loc: const(Location), child: ir.Exp, arg: ir.Exp) ir.Postfix { }
//! Builds a postfix call.
fn buildCall(loc: const(Location), child: ir.Exp, args: ir.Exp[]) ir.Postfix { }
//! Builds a call to a function.
fn buildCall(loc: const(Location), func: ir.Function, args: ir.Exp[]) ir.Postfix { }
fn buildMemberCall(loc: const(Location), child: ir.Exp, func: ir.ExpReference, name: string, args: ir.Exp[]) ir.Postfix { }
fn buildCreateDelegate(loc: const(Location), child: ir.Exp, func: ir.ExpReference) ir.Postfix { }
fn buildProperty(loc: const(Location), name: string, child: ir.Exp, getFn: ir.Function, setFns: ir.Function[]) ir.PropertyExp { }
//! Builds a postfix call.
fn buildCall(loc: const(Location), decl: ir.Declaration, args: ir.Exp[], names: scope (scope (string)[])) ir.Postfix { }
//! Builds an add BinOp.
fn buildAdd(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a subtraction BinOp.
fn buildSub(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a multiplication BinOp.
fn buildMul(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a division BinOp.
fn buildDiv(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a modulo BinOp.
fn buildMod(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a bitwise and Binop
fn buildAnd(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a bitwise or Binop
fn buildOr(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a bitwise xor binop.
fn buildXor(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a concatenate BinOp.
fn buildCat(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a LS BinOp.
fn buildLS(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a SRS BinOp.
fn buildSRS(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds an RS BinOp.
fn buildRS(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a Pow BinOp.
fn buildPow(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds an assign BinOp.
fn buildAssign(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds an assign BinOp to a given variable.
fn buildAssign(loc: const(Location), left: ir.Variable, right: ir.Exp) ir.BinOp { }
//! Builds an assign BinOp to a given variable from a given variable.
fn buildAssign(loc: const(Location), left: ir.Variable, right: ir.Variable) ir.BinOp { }
//! Builds an add-assign BinOp.
fn buildAddAssign(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds a cat-assign BinOp.
fn buildCatAssign(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp { }
//! Builds an BinOp.
fn buildBinOp(loc: const(Location), op: ir.BinOp.Op, left: ir.Exp, right: ir.Exp) ir.BinOp { }
fn buildStatementExp(loc: const(Location)) ir.StatementExp { }
fn buildStatementExp(loc: const(Location), stats: ir.Node[], exp: ir.Exp) ir.StatementExp { }
fn buildFunctionParam(loc: const(Location), index: size_t, name: string, func: ir.Function) ir.FunctionParam { }
//! Adds a variable argument to a function, also adds it to the scope.
fn addParam(errSink: ErrorSink, loc: const(Location), func: ir.Function, type: ir.Type, name: string) ir.FunctionParam { }
//! Adds a variable argument to a function, also adds it to the scope.
fn addParamSmart(errSink: ErrorSink, loc: const(Location), func: ir.Function, type: ir.Type, name: string) ir.FunctionParam { }
//! Builds a variable statement smartly, inserting at the end of the block
//! statements and inserting it in the scope.
fn buildVarStatSmart(errSink: ErrorSink, loc: const(Location), block: ir.BlockStatement, _scope: ir.Scope, type: ir.Type, name: string) ir.Variable { }
//! Add an Exp to a StatementExp.
fn buildExpStat(loc: const(Location), stat: ir.StatementExp, exp: ir.Exp) ir.ExpStatement { }
fn buildThrowStatement(loc: const(Location), exp: ir.Exp) ir.ThrowStatement { }
fn buildVaArgStart(loc: const(Location), vlexp: ir.Exp, argexp: ir.Exp) ir.BuiltinExp { }
fn buildVaArgEnd(loc: const(Location), vlexp: ir.Exp) ir.BuiltinExp { }
fn buildVaArg(loc: const(Location), vaexp: ir.VaArgExp) ir.BuiltinExp { }
//! Build a Ternary expression.
fn buildTernary(loc: const(Location), condition: ir.Exp, l: ir.Exp, r: ir.Exp) ir.Ternary { }
fn buildInternalArrayLiteralSmart(errSink: ErrorSink, loc: const(Location), atype: ir.Type, exps: ir.Exp[]) ir.StatementExp { }
fn buildInternalStaticArrayLiteralSmart(errSink: ErrorSink, loc: const(Location), atype: ir.Type, exps: ir.Exp[]) ir.StatementExp { }
//! Build an exp statement and add it to a block.
fn buildExpStat(loc: const(Location), block: ir.BlockStatement, exp: ir.Exp) ir.ExpStatement { }
//! Build an exp statement without inserting it anywhere.
fn buildExpStat(loc: const(Location), exp: ir.Exp) ir.ExpStatement { }
//! Build a switch statement.
fn buildSwitchStat(loc: const(Location), condition: ir.Exp) ir.SwitchStatement { }
//! Build a simple switch case.
fn buildSwitchCase(loc: const(Location), caseExp: ir.Exp) ir.SwitchCase { }
//! Build an assert(false) statement.
fn buildAssertFalse(loc: const(Location)) ir.AssertStatement { }
//! Build a simple default switch case.
fn buildSwitchDefault(loc: const(Location)) ir.SwitchCase { }
//! Build an if statement.
fn buildIfStat(loc: const(Location), exp: ir.Exp, thenState: ir.BlockStatement, elseState: ir.BlockStatement, autoName: string) ir.IfStatement { }
//! Build an if statement using an if statement as the else statement.
fn buildIfElseIfStat(loc: const(Location), exp: ir.Exp, thenState: ir.BlockStatement, elseState: ir.IfStatement) ir.IfStatement { }
//! Build an if statement.
fn buildIfStat(loc: const(Location), block: ir.BlockStatement, exp: ir.Exp, thenState: ir.BlockStatement, elseState: ir.BlockStatement, autoName: string) ir.IfStatement { }
//! Build an if statement.
fn buildIfStat(loc: const(Location), statExp: ir.StatementExp, exp: ir.Exp, thenState: ir.BlockStatement, elseState: ir.BlockStatement, autoName: string) ir.IfStatement { }
//! Build a block statement.
fn buildBlockStat(loc: const(Location), introducingNode: ir.Node, _scope: ir.Scope, statements: scope (scope (ir.Node)[])) ir.BlockStatement { }
//! Build a return statement.
fn buildReturnStat(loc: const(Location), block: ir.BlockStatement, exp: ir.Exp) ir.ReturnStatement { }
fn buildFunctionTypeSmart(loc: const(Location), ret: ir.Type, args: scope (scope (ir.Type)[])) ir.FunctionType { }
//! Builds a function without inserting it anywhere.
fn buildFunction(loc: const(Location), _scope: ir.Scope, name: string, buildBody: bool) ir.Function { }
//! Builds a function with a given type.
fn buildFunction(loc: const(Location), _scope: ir.Scope, name: string, ftype: ir.FunctionType) ir.Function { }
//! Builds a completely useable Function and insert it into the various
//! places it needs to be inserted.
fn buildFunction(errSink: ErrorSink, loc: const(Location), tlb: ir.TopLevelBlock, _scope: ir.Scope, name: string, buildBody: bool) ir.Function { }
fn buildGlobalConstructor(errSink: ErrorSink, loc: const(Location), tlb: ir.TopLevelBlock, _scope: ir.Scope, name: string, buildBody: bool) ir.Function { }
//! Builds a alias from a string and a Identifier.
fn buildAliasSmart(loc: const(Location), name: string, i: ir.Identifier) ir.Alias { }
//! Builds a alias from two strings.
fn buildAlias(loc: const(Location), name: string, from: string) ir.Alias { }
//! Builds a completely useable struct and insert it into the various
//! places it needs to be inserted.
fn buildStruct(errSink: ErrorSink, loc: const(Location), tlb: ir.TopLevelBlock, _scope: ir.Scope, name: string, members: scope (scope (ir.Variable)[])) ir.Struct { }
//! Builds an IR complete, but semantically unfinished struct. i.e. it has
//! no scope and isn't inserted anywhere. The members list is used directly
//! in the new struct; be wary not to duplicate IR nodes.
fn buildStruct(loc: const(Location), name: string, members: scope (scope (ir.Variable)[])) ir.Struct { }
//! Add a variable to a pre-built struct.
fn addVarToStructSmart(errSink: ErrorSink, _struct: ir.Struct, var: ir.Variable) ir.Variable { }
//! If t is a class, or a typereference to a class, returns the class.
//! Otherwise, returns null.
fn getClass(t: ir.Type) ir.Class { }
fn buildStaticArrayTypeSmart(loc: const(Location), length: size_t, base: ir.Type) ir.Type { }
fn buildAATypeSmart(loc: const(Location), key: ir.Type, value: ir.Type) ir.Type { }
fn buildCastSmart(type: ir.Type, exp: ir.Exp) ir.Unary { }
fn buildAddrOf(exp: ir.Exp) ir.Unary { }
fn buildCastToBool(exp: ir.Exp) ir.Unary { }
fn buildSetType(loc: const(Location), functions: ir.Function[]) ir.Type { }
fn buildSet(loc: const(Location), functions: ir.Function[], eref: ir.ExpReference) ir.Declaration { }
fn stripStorage(type: ir.Type) ir.Type { }
fn deepStripStorage(type: ir.Type) ir.Type { }
//! Returns the base of consecutive pointers. e.g. 'int***' returns 'int'.
fn realBase(ptr: ir.PointerType) ir.Type { }
//! Build a with statement that has no block.
fn buildWithStatement(loc: const(Location), exp: ir.Exp) ir.WithStatement { }
fn buildTokenExp(loc: const(Location), type: ir.TokenExp.Type) ir.TokenExp { }
//! Build a simple index for loop. for (i = 0; i < length; ++i)
fn buildForStatement(loc: const(Location), target: TargetInfo, parent: ir.Scope, length: ir.Exp, forStatement: ir.ForStatement, ivar: ir.Variable) { }
fn addStorageIgnoreNamed(dest: ir.Type, src: ir.Type) { }
fn addStorage(dest: ir.Type, src: ir.Type) { }
fn insertInPlace(list: ir.Node[], index: size_t, node: ir.Node) { }
fn buildStoreExp(loc: const(Location), store: ir.Store, idents: scope (scope (string)[])) ir.StoreExp { }
fn buildAutoType(loc: const(Location)) ir.AutoType { }
fn buildNoType(loc: const(Location)) ir.NoType { }
fn buildNullType(loc: const(Location)) ir.NullType { }
//! Build a cast to a TypeInfo.
fn buildTypeInfoCast(typeInfoClass: ir.Class, e: ir.Exp) ir.Exp { }
fn buildBreakStatement(loc: const(Location)) ir.BreakStatement { }
fn buildGotoDefault(loc: const(Location)) ir.GotoStatement { }
fn buildGotoCase(loc: const(Location)) ir.GotoStatement { }

volt.visitor.nodereplace

//! Home of ExpReferenceReplacer.
module volt.visitor.nodereplace;


class ExpReferenceReplacer : NullVisitor
{
public:
	fromDecl: ir.Declaration;
	toExp: ir.Exp;


public:
	this(decl: ir.Declaration, exp: ir.Exp) { }
	fn visit(exp: ir.Exp, eref: ir.ExpReference) Status { }
}

volt.lowerer.array

module volt.lowerer.array;


fn getLlvmMemMove(loc: const(Location), lp: LanguagePass) ir.Function { }
fn getLlvmMemCopy(loc: const(Location), lp: LanguagePass) ir.Function { }
fn getArrayAppendFunction(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, ltype: ir.ArrayType, rtype: ir.Type, isAssignment: bool) ir.Function { }
fn getArrayPrependFunction(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, ltype: ir.ArrayType, rtype: ir.Type) ir.Function { }
fn getArrayCopyFunction(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, type: ir.ArrayType) ir.Function { }
fn getArrayConcatFunction(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, type: ir.ArrayType, isAssignment: bool) ir.Function { }
fn getArrayCmpFunction(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, type: ir.ArrayType) ir.Function { }

volt.semantic.util

module volt.semantic.util;


//! Turn a [|w|d]char into [ubyte|ushort|uint] type.
fn charToInteger(pt: ir.PrimitiveType) ir.PrimitiveType { }
//! Remove the given types storage modifiers. Only the given type is
//! modified, any sub types are left unchanged. If no modification is made
//! returns the given type. Will do a deep copy if modification is needed.
fn removeStorageFields(t: ir.Type) ir.Type { }
//! Resolves AutoType to the given type.
fn flattenAuto(atype: ir.AutoType, type: ir.Type) ir.Type { }
//! Turn stype into a flag, and attach it to type.
fn flattenOneStorage(stype: ir.StorageType, type: ir.Type, ct: ir.CallableType, ctIndex: size_t) { }
//! Implicitly convert types to bools in conditional statements, or error.
fn implicitlyCastToBool(ctx: Context, exp: ir.Exp) { }
//! Return a array of postfixes from a tree of postfixes, starting with the
//! innermost child.
fn collectPostfixes(postfix: ir.Postfix) ir.Postfix[] { }
//! Get a Store or Type from the child of a pre-proceassed postfix chain.
fn getIfStoreOrTypeExp(exp: ir.Exp, store: ir.Store, type: ir.Type) bool { }
fn propagateStorage(type: ir.Type) { }
//! Given a type, return a type that will have every storage flag that are
//! nested within it, by going into array and pointer bases, etc.
fn accumulateStorage(toType: ir.Type, seed: ir.Type) ir.Type { }
//! This handles implicitly typing null. Generic function used by assign
//! and other functions.
fn handleIfNull(ctx: Context, left: ir.Type, right: ir.Exp) bool { }
fn handleNull(ctx: Context, left: ir.Type, right: ir.Exp, rightType: ir.Type) { }
//! Get the this variable for this function.
fn getThisVarNotNull(n: ir.Node, ctx: Context) ir.Variable { }
fn getThisVarNotNull(n: ir.Node, ctx: Context, func: ir.Function) ir.Variable { }
//! Returns a expression that is the this variable, safely handles nested
//! functions as well.
fn getThisReferenceNotNull(n: ir.Node, ctx: Context, thisVar: ir.Variable) ir.Exp { }
fn addVarArgsVarsIfNeeded(lp: LanguagePass, func: ir.Function) { }
fn expsToTypes(exps: ir.Exp[]) ir.Type[] { }
//! Gets a default value (The .default -- 0, or null, usually) for a given
//! type.
fn getDefaultInit(loc: const(Location), lp: LanguagePass, t: ir.Type) ir.Exp { }
//! Handles ., like 'int.min' and the like.
fn typeLookup(ctx: Context, exp: ir.Exp, type: ir.Type) bool { }
fn ifTypeRefDeRef(t: ir.Type) ir.Type { }
fn getSizeOf(loc: const(Location), lp: LanguagePass, type: ir.Type) ir.AccessExp { }
fn getCommonSubtype(loc: const(Location), types: ir.Type[]) ir.Type { }
//! Given a Node, if it's a Struct or a Union, resolve it.
fn resolveChildStructsAndUnions(lp: LanguagePass, rt: ir.Type) { }
fn stripEnumIfEnum(e: ir.Exp, wasEnum: bool) ir.Exp { }

volt.semantic.typer

//! Routines to retrieve the types of expressions.
module volt.semantic.typer;


//! Get the type of a given expression.
fn getExpType(exp: ir.Exp) ir.Type { }
//! Retrieve the type of the given expression.
fn getExpTypeImpl(exp: ir.Exp) ir.Type { }
fn getVaArgType(vaexp: ir.VaArgExp) ir.Type { }
fn getTokenExpType(texp: ir.TokenExp) ir.Type { }
fn getStatementExpType(se: ir.StatementExp) ir.Type { }
fn getTypeExpType(te: ir.TypeExp) ir.Type { }
fn getStoreExpType(se: ir.StoreExp) ir.Type { }
fn getStructLiteralType(slit: ir.StructLiteral) ir.Type { }
fn getUnionLiteralType(ulit: ir.UnionLiteral) ir.Type { }
fn getClassLiteralType(classlit: ir.ClassLiteral) ir.Type { }
fn getExpReferenceType(expref: ir.ExpReference) ir.Type { }
fn getBinOpType(bin: ir.BinOp) ir.Type { }
fn getTypeidType(_typeid: ir.Typeid) ir.Type { }
fn getConstantType(constant: ir.Constant) ir.Type { }
fn getArrayLiteralType(al: ir.ArrayLiteral) ir.Type { }
fn getAssocArrayType(aa: ir.AssocArray) ir.Type { }
fn getPostfixType(postfix: ir.Postfix) ir.Type { }
fn getPostfixSliceType(postfix: ir.Postfix) ir.Type { }
fn getPropertyExpType(prop: ir.PropertyExp) ir.Type { }
fn getPostfixCreateDelegateType(postfix: ir.Postfix) ir.Type { }
fn retrieveScope(tt: ir.Node, postfix: ir.Postfix, _scope: ir.Scope, _class: ir.Class, emsg: string) { }
fn getPostfixIncDecType(postfix: ir.Postfix) ir.Type { }
fn getPostfixIndexType(postfix: ir.Postfix) ir.Type { }
fn getPostfixCallType(postfix: ir.Postfix) ir.Type { }
fn getTernaryType(ternary: ir.Ternary) ir.Type { }
fn getUnaryType(unary: ir.Unary) ir.Type { }
fn getUnaryIncDecType(unary: ir.Unary) ir.Type { }
fn getUnaryComplementType(unary: ir.Unary) ir.Type { }
fn getUnaryNotType(unary: ir.Unary) ir.Type { }
fn getUnaryCastType(unary: ir.Unary) ir.Type { }
fn getUnaryDerefType(unary: ir.Unary) ir.Type { }
fn getUnaryAddrOfType(unary: ir.Unary) ir.Type { }
fn getUnaryNewType(unary: ir.Unary) ir.Type { }
fn getUnarySubAddType(unary: ir.Unary) ir.Type { }

volt.semantic.mangle

module volt.semantic.mangle;


//! Mangle the name of type if not set mangled.
fn ensureMangled(t: ir.Type) { }
//! Mangle a type.
fn mangle(t: ir.Type) string { }
//! Mangle a Variable.
fn mangle(names: string[], v: ir.Variable) string { }
//! Mangle a function.
fn mangle(names: string[], func: ir.Function) string { }

volt.semantic.lookup

//! Functions that encode the semantic code for looking up symbols.
module volt.semantic.lookup;


//! Look up an identifier in a scope and its parent scopes. Returns the
//! store or null if no match was found.
fn lookup(lp: LanguagePass, _scope: ir.Scope, loc: const(Location), name: string) ir.Store { }
//! Look up a QualifiedName chain, the first identifier is looked up
//! globaly, and the result is treated as a scope to lookup the next one
//! should there be more identifiers.
fn lookup(lp: LanguagePass, _scope: ir.Scope, qn: ir.QualifiedName) ir.Store { }
//! Look up an identifier in the given scope only. Doesn't check parent
//! scopes, parent classes, imports, or anywhere else but the given scope.
fn lookupInGivenScopeOnly(lp: LanguagePass, _scope: ir.Scope, loc: const(Location), name: string) ir.Store { }
//! Look up an identifier in this scope, in parent scopes (in the case of
//! classes), and in any imports for this scope.
fn lookupAsThisScope(lp: LanguagePass, _scope: ir.Scope, loc: const(Location), name: string, current: ir.Scope) ir.Store { }
//! Lookup in this scope and parent class scopes, if any.
fn lookupOnlyThisScopeAndClassParents(lp: LanguagePass, _scope: ir.Scope, loc: const(Location), name: string) ir.Store { }
//! Lookup up as identifier in this scope, and any public imports.
fn lookupAsImportScope(lp: LanguagePass, _scope: ir.Scope, loc: const(Location), name: string) ir.Store { }
//! Lookup an identifier in multiple scopes, as import scopes.
fn lookupAsImportScopes(lp: LanguagePass, scopes: ir.Scope[], loc: const(Location), name: string) ir.Store { }
//! This function is used to retrive cached versions of helper functions.
fn lookupFunction(lp: LanguagePass, _scope: ir.Scope, loc: const(Location), name: string) ir.Function { }
//! Helper functions that looksup a type and throws compiler errors if it
//! is not found or the found identifier is not a type.
fn lookupType(lp: LanguagePass, _scope: ir.Scope, id: ir.QualifiedName) ir.Type { }
fn lookupType(lp: LanguagePass, _scope: ir.Scope, id: ir.QualifiedName, store: ir.Store) ir.Type { }
//! Resolves a store making sure the node it points to is resolved, the
//! function returns the store that a alias is pointing to. Not the alias
//! itself.
fn ensureResolved(lp: LanguagePass, s: ir.Store) ir.Store { }
//! Get the module in the bottom of the given _scope chain.
fn getModuleFromScope(loc: const(Location), _scope: ir.Scope) ir.Module { }
//! Return the first class scope and the class going down the chain of
//! containing scopes (_scope.parent field).
fn getFirstClass(_scope: ir.Scope, outScope: ir.Scope, outClass: ir.Class) bool { }

volt.semantic.nested

module volt.semantic.nested;


//! This module contains utility functions for dealing with nested
//! functions; 'functions within functions'.
fn nestExtyperTagVariable(loc: const(Location), ctx: Context, var: ir.Variable, store: ir.Store) { }
//! Add a child function to the list of nested functions in a parent
//! function.
fn nestExtyperFunction(parent: ir.Function, func: ir.Function) { }
//! Add the context struct to a nested function.
fn nestLowererFunction(lp: LanguagePass, parent: ir.Function, func: ir.Function) { }
//! Replace nested Variable declarations with assign expressions.
fn insertBinOpAssignsForNestedVariableAssigns(lp: LanguagePass, bs: ir.BlockStatement) { }
//! If the current function is a nested one, replace a given ExpReference
//! with an expression that will retrieve the correct value from the nested
//! struct.
fn replaceNested(lp: LanguagePass, exp: ir.Exp, eref: ir.ExpReference, currentFunction: ir.Function) bool { }

volt.semantic.classify

module volt.semantic.classify;


//! Making the code more readable.
enum IgnoreStorage;

//! Returns the size of a given ir.PrimitiveType in bytes.
fn size(kind: ir.PrimitiveType.Kind) size_t { }
//! Returns the size of a given ir.Type in bytes.
fn size(target: TargetInfo, node: ir.Node) size_t { }
//! Returns the size of a given ir.Struct in bytes.
//! https://en.wikipedia.org/wiki/Data_structure_alignment#Typical_alignment_of_C_structs_on_x86
fn structSize(target: TargetInfo, s: ir.Struct) size_t { }
//! Returns the size of a given ir.Union in bytes.
fn unionSize(target: TargetInfo, u: ir.Union) size_t { }
//! Returns the offset adjusted to alignment.
fn calcAlignment(a: size_t, offset: size_t) size_t { }
//! Returns the offset adjusted to alignment of type.
fn calcAlignment(target: TargetInfo, t: ir.Type, offset: size_t) size_t { }
fn alignment(target: TargetInfo, kind: ir.PrimitiveType.Kind) size_t { }
fn alignment(target: TargetInfo, node: ir.Type) size_t { }
//! Returns the size of a given ir.Struct in bytes.
fn structAlignment(target: TargetInfo, s: ir.Struct) size_t { }
//! Returns the size of a given ir.Union in bytes.
fn unionAlignment(target: TargetInfo, u: ir.Union) size_t { }
fn isValidWithExp(exp: ir.Exp) bool { }
//! Remove types masking a type (e.g. enum).
fn realType(t: ir.Type, stripEnum: bool) ir.Type { }
//! struct Struct { ... } a := Struct(12); // isValueExp() == false b :=
//! a(12); // isValueExp() == true, despite the same type.
fn isValueExp(exp: ir.Exp) bool { }
//! A type without mutable indirection is a pure value type -- it cannot
//! mutate any other memory than its own, or is composed of the above. This
//! is useful for making const and friends more user friendly.
fn mutableIndirection(t: ir.Type) bool { }
fn isAuto(t: ir.Type) bool { }
fn isBool(t: ir.Type) bool { }
//! Is this an array of characters?
fn isString(t: ir.Type) bool { }
//! Is this type a character type?
fn isChar(t: ir.Type) bool { }
fn isArray(t: ir.Type) bool { }
fn isStaticArray(t: ir.Type) bool { }
fn effectivelyConst(type: ir.Type) bool { }
fn isPointer(t: ir.Type) bool { }
fn isDelegate(t: ir.Type) bool { }
fn isIntegral(t: ir.Type) bool { }
fn isIntegralOrBool(t: ir.Type) bool { }
fn isIntegral(kind: ir.PrimitiveType.Kind) bool { }
fn isIntegralOrBool(kind: ir.PrimitiveType.Kind) bool { }
fn isFloatingPoint(t: ir.Type) bool { }
fn isF32(t: ir.Type) bool { }
fn isFloatingPoint(kind: ir.PrimitiveType.Kind) bool { }
fn isUnsigned(kind: ir.PrimitiveType.Kind) bool { }
fn isOkayForPointerArithmetic(kind: ir.PrimitiveType.Kind) bool { }
fn isBitsType(type: ir.Type) bool { }
fn isAggregate(type: ir.Type) bool { }
fn isInt(type: ir.Type) bool { }
fn isVoid(type: ir.Type) bool { }
//! Determines whether the two given types are the same.
fn typesEqual(a: ir.Type, b: ir.Type, ignoreStorage: bool) bool { }
fn typeToRuntimeConstant(lp: LanguagePass, current: ir.Scope, type: ir.Type) i32 { }
//! Does the given property need to have child set?
fn isMember(prop: ir.PropertyExp) bool { }
//! Is the given exp a backend constant, this is the minimum that a backend
//! needs to implement in order to fully support Volt.
fn isBackendConstant(exp: ir.Exp) bool { }
fn isAssign(exp: ir.Exp) bool { }
fn isAssign(op: ir.BinOp.Op) bool { }
fn isAssignable(exp: ir.Exp) bool { }
fn isLValue(exp: ir.Exp) bool { }
fn isLValueOrAssignable(exp: ir.Exp, assign: bool) bool { }
fn isRefVar(exp: ir.Exp) bool { }
fn isComparison(t: ir.BinOp.Op) bool { }
fn isConstant(e: ir.Exp) bool { }
fn isValidPointerArithmeticOperation(t: ir.BinOp.Op) bool { }
fn isImplicitlyConvertable(from: ir.Type, to: ir.Type) bool { }
fn fitsInPrimitive(target: TargetInfo, t: ir.PrimitiveType, e: ir.Exp) bool { }
//! If the given scope is in a function, return it. Otherwise, return
//! null.
fn getParentFunction(current: ir.Scope) ir.Function { }
fn isInFunction(ctx: Context) bool { }
fn isFunctionMemberOrConstructor(func: ir.Function) bool { }
fn isFunctionStatic(func: ir.Function) bool { }
fn isVariableStatic(var: ir.Variable) bool { }
fn isNull(e: ir.Exp) bool { }
fn isNested(s: ir.Variable.Storage) bool { }
//! Returns true if one of fns's types match fnToMatch. False
//! otherwise.(If fns is empty, this function returns false).
fn containsMatchingFunction(fns: ir.Function[], fnToMatch: ir.Function) bool { }
fn isNested(func: ir.Function) bool { }
//! Used to determine whether a store is local to a function and therefore
//! can not be shadowed by a with statement.
fn isStoreLocal(lp: LanguagePass, current: ir.Scope, store: ir.Store) bool { }
//! Retrieves the types of Variables in _struct, in the order they appear.
fn getStructFieldTypes(_struct: ir.Struct) ir.Type[] { }
//! Retrieves the Variables in _struct, in the order they appear.
fn getAggregateFieldVars(_struct: ir.Aggregate) ir.Variable[] { }
fn getStructFunctions(_struct: ir.Struct) ir.Function[] { }
fn getClassFunctions(_class: ir.Class) ir.Function[] { }
//! If the given scope is a function, and that function has a this
//! reference that is a class, or is a static function in a class, return
//! true and set theClass to that class. Otherwise, return false.
fn getMethodParent(_scope: ir.Scope, theClass: ir.Class) bool { }
//! Returns: true if child is a child of parent.
fn inheritsFrom(child: ir.Class, parent: ir.Class) bool { }
fn isOrInheritsFrom(a: ir.Class, b: ir.Class) bool { }
fn isPointerToClass(t: ir.Type) bool { }
//! How far removed from Object is this class?
fn distanceFromObject(_class: ir.Class) size_t { }
//! Given two classes, return their closest relative.
fn commonParent(a: ir.Class, b: ir.Class) ir.Class { }
fn opOverloadableOrNull(t: ir.Type) ir.Aggregate { }
fn overloadName(op: ir.BinOp.Op) string { }
fn overloadPostfixName(op: ir.Postfix.Op) string { }
fn overloadPostfixAssignName(oldname: string) string { }
fn overloadUnaryMinusName() string { }
fn overloadDollarName() string { }

volt.semantic.classresolver

module volt.semantic.classresolver;


fn actualizeInterface(lp: LanguagePass, i: ir._Interface) { }
fn actualizeClass(lp: LanguagePass, c: ir.Class) { }
fn rewriteThis(ctx: Context, e: ir.Exp, ident: ir.IdentifierExp, isCall: bool) ir.Type { }
fn rewriteThisCall(ctx: Context, e: ir.Exp, ident: ir.IdentifierExp, thisVar: ir.Variable, thisRef: ir.Exp) ir.Type { }
fn rewriteSuper(ctx: Context, e: ir.Exp, ident: ir.IdentifierExp, isCall: bool, isIdentifier: bool) ir.Type { }
fn rewriteSuperIdentifier(e: ir.Exp, _class: ir.Class) ir.Type { }
fn rewriteSuperCall(ctx: Context, e: ir.Exp, _class: ir.Class) ir.Type { }
//! Fills in _Interface.layoutStruct.
fn fillInInterfaceLayoutIfNeeded(lp: LanguagePass, i: ir._Interface) { }
//! Fills in Class.layoutStruct and Class.vtableStruct.
fn fillInClassLayoutIfNeeded(lp: LanguagePass, c: ir.Class) { }
fn fillInParentIfNeeded(lp: LanguagePass, c: ir.Class) { }
fn fillInInterfacesIfNeeded(lp: LanguagePass, c: ir.Class) { }
fn getClassFields(lp: LanguagePass, _class: ir.Class, offset: size_t) ir.Variable[] { }
fn generateDefaultConstructor(lp: LanguagePass, current: ir.Scope, _class: ir.Class) ir.Function { }
//! Get all the functions in an inheritance chain -- ignore overloading.
fn getClassMethods(lp: LanguagePass, current: ir.Scope, _class: ir.Class) ir.Function[][] { }
fn appendClassMethods(lp: LanguagePass, current: ir.Scope, _class: ir.Class, methods: FunctionArraySink) { }
fn appendInterfaceMethods(lp: LanguagePass, iface: ir._Interface, functions: FunctionSink) { }
fn appendClassMethodFunctions(lp: LanguagePass, _class: ir.Class, outMethods: FunctionSink) { }
//! Returns all functions in functions that have the same name as
//! considerFunction.
fn appendPotentialOverrideFunctions(functions: ir.Function[], considerFunction: ir.Function, _out: FunctionSink) { }
fn appendPotentialOverrideFunctions(functions: FunctionSink, considerFunction: ir.Function, _out: FunctionSink) { }
fn appendPotentialOverrideFunctions(func: ir.Function, considerFunction: ir.Function, _out: FunctionSink) { }
//! Replace an overriden function in parentSet with childFunction if
//! appropriate. Returns true if a function is replaced, false otherwise.
fn overrideFunctionsIfNeeded(lp: LanguagePass, childFunction: ir.Function, parentSet: FunctionSink) bool { }
fn getClassMethodTypeVariables(lp: LanguagePass, _class: ir.Class) ir.Variable[] { }
fn getInterfaceLayoutStruct(iface: ir._Interface, lp: LanguagePass) ir.Struct { }
fn getClassLayoutStruct(_class: ir.Class, lp: LanguagePass) ir.Struct { }
//! Given a class, return a family list of classes, with the given class as
//! the last member, and Object as the first.
fn getInheritanceChain(_class: ir.Class) ir.Class[] { }
fn getTypeInfos(classes: ir.Class[]) ir.Exp[] { }
//! For a given interface, return every function that needs to be
//! implemented by an implementor.
fn appendInterfaceFunctions(lp: LanguagePass, iface: ir._Interface, _out: FunctionSink) { }
//! Get a struct literal with an implementation of an interface from a
//! given class.
fn getInterfaceStructAssign(lp: LanguagePass, _class: ir.Class, _scope: ir.Scope, iface: ir._Interface, ifaceIndex: size_t) ir.Exp { }
fn buildInstanceVariable(lp: LanguagePass, _class: ir.Class) { }
fn emitVtableVariable(lp: LanguagePass, _class: ir.Class) { }

volt.semantic.evaluate

module volt.semantic.evaluate;


fn fold(exp: ir.Exp, target: TargetInfo) ir.Constant { }
//! Given two expressions, returns true if they are two constant array
//! literals that are equal.
fn areEqualConstantArrays(l: ir.Exp, r: ir.Exp, target: TargetInfo) bool { }
fn fold(exp: ir.Exp, needCopy: bool, target: TargetInfo) ir.Constant { }
//! Fold a composable string.
fn getConstantComposableString(target: TargetInfo, cs: ir.ComposableString) string { }
//! Add a components value to a composable string being folded.
fn addConstantComposableStringComponent(target: TargetInfo, sink: scope (Sink), e: ir.Exp) { }
//! Add a string component to an in progress composable string parse.
fn addConstantComposableStringComponent(sink: scope (Sink), c: ir.Constant) { }
//! Add a primitive type component to a composable string.
fn addConstantComposableStringComponent(sink: scope (Sink), c: ir.Constant, pt: ir.PrimitiveType) { }
fn foldTernary(exp: ir.Exp, ternary: ir.Ternary, target: TargetInfo) ir.Constant { }
fn foldAccessExp(exp: ir.Exp, accessExp: ir.AccessExp, target: TargetInfo) ir.Constant { }
fn foldTypeIdSize(exp: ir.Exp, tid: ir.Typeid, target: TargetInfo) ir.Constant { }
fn foldTypeIdMutableIndirection(exp: ir.Exp, tid: ir.Typeid, target: TargetInfo) ir.Constant { }
fn foldBinOp(exp: ir.Exp, binop: ir.BinOp, target: TargetInfo) ir.Constant { }
fn foldUnary(exp: ir.Exp, unary: ir.Unary, target: TargetInfo) ir.Constant { }
fn foldBinOp(exp: ir.Exp, op: ir.BinOp.Op, cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldUnary(exp: ir.Exp, u: ir.Unary, c: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpOrOr(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpAndAnd(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpOr(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpXor(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpAnd(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpEqual(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpNotEqual(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpLess(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpLessEqual(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpGreaterEqual(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpGreater(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpLS(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpSRS(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpRS(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpAdd(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpSub(cl: ir.Constant, cr: ir.Constant, targert: TargetInfo) ir.Constant { }
fn foldBinOpMul(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpDiv(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpMod(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldBinOpPow(cl: ir.Constant, cr: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldUnaryCast(c: ir.Constant, t: ir.Type, target: TargetInfo) ir.Constant { }
fn foldUnaryMinus(c: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldUnaryPlus(c: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldUnaryNot(c: ir.Constant, target: TargetInfo) ir.Constant { }
fn foldUnaryComplement(c: ir.Constant, target: TargetInfo) ir.Constant { }
fn evaluateOrNull(target: TargetInfo, exp: ir.Exp) ir.Constant { }
fn evaluateOrNull(lp: LanguagePass, current: ir.Scope, exp: ir.Exp) ir.Constant { }
fn evaluate(lp: LanguagePass, current: ir.Scope, exp: ir.Exp) ir.Constant { }
fn needsEvaluation(exp: ir.Exp) bool { }

volt.semantic.overload

module volt.semantic.overload;


//! Okay, so here's a rough description of how function overload
//! resolution is supposed to work. No doubt there will be discrepancies
//! between this description and the implementation proper. We in the
//! business call those 'bugs'.
enum ThrowOnError;
enum DoNotThrow;

fn selectFunction(target: TargetInfo, functions: ir.Function[], arguments: ir.Exp[], loc: const(Location), throwOnError: bool) ir.Function { }
fn selectFunction(target: TargetInfo, fset: ir.FunctionSet, arguments: ir.Exp[], loc: const(Location), throwOnError: bool) ir.Function { }
fn selectFunction(target: TargetInfo, fset: ir.FunctionSet, arguments: ir.Variable[], loc: const(Location), throwOnError: bool) ir.Function { }
fn selectFunction(target: TargetInfo, functions: ir.Function[], arguments: ir.Variable[], loc: const(Location), throwOnError: bool) ir.Function { }
fn matchLevel(target: TargetInfo, homogenous: bool, argument: ir.Type, parameter: ir.Type, exp: ir.Exp) i32 { }
fn specialisationComparison(ao: Object, bo: Object) bool { }
fn selectFunction(target: TargetInfo, fset: ir.FunctionSet, arguments: ir.Type[], loc: const(Location), throwOnError: bool) ir.Function { }
fn selectFunction(target: TargetInfo, fset: ir.FunctionSet, arguments: ir.Type[], exps: ir.Exp[], loc: const(Location), throwOnError: bool) ir.Function { }
fn selectFunction(target: TargetInfo, functions: ir.Function[], arguments: ir.Type[], loc: const(Location), throwOnError: bool) ir.Function { }
fn selectFunction(target: TargetInfo, functions: FunctionSink, arguments: ir.Type[], loc: const(Location), throwOnError: bool) ir.Function { }
fn selectFunction(target: TargetInfo, functions: scope (scope (ir.Function)[]), arguments: ir.Type[], exps: ir.Exp[], loc: const(Location), throwOnError: bool) ir.Function { }

volta.postparse.pass

module volta.postparse.pass;


class PostParseImpl : vi.NullVisitor, PostParsePass
{
public:
	missing: MissingDeps;


public:
	this(err: ErrorSink, vs: VersionSet, target: TargetInfo, warningsEnabled: bool, removalOnly: bool, doMissing: bool, getMod: GetMod) { }
	fn transform(mod: ir.Module) { }
	fn transformChildBlocks(func: ir.Function) { }
	fn close() { }
	fn transform(mod: ir.Module, func: ir.Function, bs: ir.BlockStatement) { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn enter(bs: ir.BlockStatement) Status { }
	fn enter(a: ir.Attribute) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn manip(nodes: ir.Node[]) ir.Node[] { }
	fn handle(ns: NodeSink, nodes: ir.Node[]) { }
	fn handle(ns: NodeSink, n: ir.Node, ret: ir.Node[]) bool { }


protected:
	mErr: ErrorSink;
	mCond: ConditionalRemoval;
	mPasses: Pass[];
	mScope: ScopeReplacer;
	mAttrib: AttribRemoval;
	mGatherer: Gatherer;
}

volta.util.dup

module volta.util.dup;


fn dup(arr: bool[]) bool[] { }
fn dup(arr: string[]) string[] { }
fn dup(arr: size_t[]) size_t[] { }
fn dup(arr: ir.Exp[]) ir.Exp[] { }
fn dup(arr: ir.Node[]) ir.Node[] { }
fn dup(arr: ir.Type[]) ir.Type[] { }
fn dup(arr: ir.Token[]) ir.Token[] { }
fn dup(arr: ir.AAPair[]) ir.AAPair[] { }
fn dup(arr: ir.Module[]) ir.Module[] { }
fn dup(arr: ir.Variable[]) ir.Variable[] { }
fn dup(arr: ir.Function[]) ir.Function[] { }
fn dup(arr: ir.Attribute[]) ir.Attribute[] { }
fn dup(arr: ir.Function[][]) ir.Function[][] { }
fn dup(arr: ir.SwitchCase[]) ir.SwitchCase[] { }
fn dup(arr: ir._Interface[]) ir._Interface[] { }
fn dup(arr: ir.Identifier[]) ir.Identifier[] { }
fn dup(arr: ir.Identifier[][]) ir.Identifier[][] { }
fn dup(arr: ir.FunctionParam[]) ir.FunctionParam[] { }
fn dup(arr: ir.TypeReference[]) ir.TypeReference[] { }
fn dup(arr: ir.QualifiedName[]) ir.QualifiedName[] { }
fn dup(arr: ir.BlockStatement[]) ir.BlockStatement[] { }
fn dup(arr: ir.Postfix.TagKind[]) ir.Postfix.TagKind[] { }
fn dup(arr: ir.EnumDeclaration[]) ir.EnumDeclaration[] { }
fn dup(arr: ir.FunctionParameter[]) ir.FunctionParameter[] { }
fn dup(arr: ir.TemplateDefinition.Parameter[]) ir.TemplateDefinition.Parameter[] { }
fn idup(arr: const(void)[]) immutable(void)[] { }

volt.util.worktracker

module volt.util.worktracker;


class Work
{
public:
	enum Action
	{
		Resolve,
		Actualize,
	}


public:
	node: ir.Node;
	action: Action;


public:
	this(wt: WorkTracker, n: ir.Node, action: Action) { }
	fn done() { }
	fn description() string { }


protected:
	fn key() u64 { }
}

class WorkTracker
{
public:
	this() { }
	fn add(n: ir.Node, action: Work.Action) Work { }
	fn remove(w: Work) { }
}

volt.lowerer.llvmlowerer

module volt.lowerer.llvmlowerer;


//! Used by the composable string lowering code.
alias NodeConsumer = void delegate(ir.Node);

//! Calls the correct functions where they need to be called to lower a
//! module.
class LlvmLowerer : ScopeManager, Pass
{
public:
	lp: LanguagePass;
	thisModule: ir.Module;
	V_P64: bool;


public:
	this(lp: LanguagePass) { }
	//! Perform all lower operations on a given module.
	fn transform(m: ir.Module) { }
	fn close() { }
	fn enter(bs: ir.BlockStatement) Status { }
	fn enter(func: ir.Function) Status { }
	fn leave(t: ir.ThrowStatement) Status { }
	fn enter(exp: ir.Exp, binOp: ir.BinOp) Status { }
	fn enter(var: ir.Variable) Status { }
	fn leave(exp: ir.Exp, binOp: ir.BinOp) Status { }
	fn enter(exp: ir.Exp, builtin: ir.BuiltinExp) Status { }
	fn leave(exp: ir.Exp, al: ir.ArrayLiteral) Status { }
	fn leave(exp: ir.Exp, assocArray: ir.AssocArray) Status { }
	fn leave(exp: ir.Exp, uexp: ir.Unary) Status { }
	fn leave(exp: ir.Exp, postfix: ir.Postfix) Status { }
	fn leave(exp: ir.Exp, prop: ir.PropertyExp) Status { }
	fn leave(exp: ir.Exp, cs: ir.ComposableString) Status { }
	fn enter(exp: ir.Exp, literal: ir.StructLiteral) Status { }
	fn leave(exp: ir.Exp, ae: ir.AccessExp) Status { }
	fn visit(exp: ir.Exp, eref: ir.ExpReference) Status { }
	fn enter(exp: ir.Exp, simport: ir.StringImport) Status { }
}

//! Next stop, backend! The LlvmLowerer visitor (and supporting functions)
//! have a fairly simple job to describe -- change any structure that the
//! backend doesn't handle into something composed of things the backend
//! DOES know how to deal with. This can involve turning keywords into
//! function calls into the runtime, changing foreach statements to for
//! statements, and so on.
fn lowerAAInsert(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, current: ir.Scope, statExp: ir.StatementExp, aa: ir.AAType, var: ir.Variable, key: ir.Exp, value: ir.Exp, lowerer: LlvmLowerer, buildif: bool, aaIsPointer: bool) { }
//! Build code to lookup a key in an AA and add it to a StatementExp.
fn lowerAALookup(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, current: ir.Scope, statExp: ir.StatementExp, aa: ir.AAType, var: ir.Variable, key: ir.Exp, store: ir.Exp, lowerer: LlvmLowerer) { }
//! Given an AA key, cast in such a way that it could be given to a
//! runtime AA function.
fn lowerAAKeyCast(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, current: ir.Scope, key: ir.Exp, aa: ir.AAType, lowerer: LlvmLowerer) ir.Exp { }
fn lowerAAValueCast(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, current: ir.Scope, key: ir.Exp, aa: ir.AAType, lowerer: LlvmLowerer) ir.Exp { }
fn lowerAACast(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, current: ir.Scope, key: ir.Exp, t: ir.Type, lowerer: LlvmLowerer) ir.Exp { }
fn lowerAggregateAACast(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, current: ir.Scope, key: ir.Exp, st: ir.Aggregate) ir.Exp { }
//! Given an AA key that is a struct or an array, cast it in such a way
//! that it could be given to a runtime AA function.
fn lowerStructOrArrayAACast(loc: const(Location), lp: LanguagePass, thisModule: ir.Module, current: ir.Scope, key: ir.Exp, t: ir.Type, lowerer: LlvmLowerer) ir.Exp { }
//! Turn a PropertyExp into a call or member call as appropriate.
fn lowerProperty(lp: LanguagePass, exp: ir.Exp, prop: ir.PropertyExp) { }
//! Lower a composable string, either at compile time, or calling
//! formatting functions with a sink.
fn lowerComposableString(lp: LanguagePass, current: ir.Scope, func: ir.Function, exp: ir.Exp, cs: ir.ComposableString, lowerer: LlvmLowerer) { }
//! Dispatch a composable string component to the right function.
fn lowerComposableStringComponent(lp: LanguagePass, current: ir.Scope, e: ir.Exp, sexp: ir.StatementExp, sinkVar: ir.Variable, dgt: NodeConsumer, lowerer: LlvmLowerer) { }
//! Lower a primitive type component of a composable string.
fn lowerComposableStringPrimitiveComponent(lp: LanguagePass, current: ir.Scope, e: ir.Exp, pt: ir.PrimitiveType, sexp: ir.StatementExp, sinkVar: ir.Variable, dgt: NodeConsumer) { }
//! Lower an associative array component of a composable string.
fn lowerComposableStringAAComponent(lp: LanguagePass, current: ir.Scope, e: ir.Exp, aatype: ir.AAType, sexp: ir.StatementExp, sinkVar: ir.Variable, dgt: NodeConsumer, lowerer: LlvmLowerer) { }
//! Lower an array component of a composable string.
fn lowerComposableStringArrayComponent(lp: LanguagePass, current: ir.Scope, e: ir.Exp, sexp: ir.StatementExp, sinkVar: ir.Variable, dgt: NodeConsumer, lowerer: LlvmLowerer) { }
//! Lower a pointer component of a composable string.
fn lowerComposableStringPointerComponent(lp: LanguagePass, e: ir.Exp, sexp: ir.StatementExp, sinkVar: ir.Variable, dgt: NodeConsumer) { }
//! Lower an enum component of a composable string.
fn lowerComposableStringEnumComponent(lp: LanguagePass, current: ir.Scope, _enum: ir.Enum, e: ir.Exp, sexp: ir.StatementExp, sinkVar: ir.Variable, dgt: NodeConsumer) { }
//! Generate the function that fills in the toSink field on an Enum.
fn generateToSink(loc: const(Location), lp: LanguagePass, current: ir.Scope, _enum: ir.Enum) ir.Function { }
//! Lower a string component of a composable string.
fn lowerComposableStringStringComponent(e: ir.Exp, sexp: ir.StatementExp, sinkVar: ir.Variable) { }
//! Lower a string component of a composable string.
fn lowerComposableStringStringComponent(e: ir.Exp, sexp: ir.StatementExp, sinkVar: ir.Variable, dgt: NodeConsumer) { }
//! Build an if statement based on a runtime assert.
fn lowerAssertIf(lp: LanguagePass, current: ir.Scope, as: ir.AssertStatement) ir.IfStatement { }
//! Given a throw statement, turn its expression into a call into the RT.
fn lowerThrow(lp: LanguagePass, t: ir.ThrowStatement) { }
//! Replace a StringImport with the string in the file it points at, or
//! error.
fn lowerStringImport(driver: Driver, exp: ir.Exp, simport: ir.StringImport) { }
//! Turn Struct a = {1, "banana"}; into Struct a; a.firstField = 1;
//! b.secondField = "banana";.
fn lowerStructLiteral(lp: LanguagePass, current: ir.Scope, exp: ir.Exp, literal: ir.StructLiteral) { }
//! Lower a postfix index expression.
fn lowerIndex(lp: LanguagePass, current: ir.Scope, thisModule: ir.Module, exp: ir.Exp, postfix: ir.Postfix, lowerer: LlvmLowerer) { }
//! Lower a postfix index expression that operates on an AA.
fn lowerIndexAA(lp: LanguagePass, current: ir.Scope, thisModule: ir.Module, exp: ir.Exp, postfix: ir.Postfix, aa: ir.AAType, lowerer: LlvmLowerer) { }
//! Lower an assign if it needs it.
fn lowerAssign(lp: LanguagePass, thisModule: ir.Module, exp: ir.Exp, binOp: ir.BinOp) { }
//! Lower an assign to an array if it's being modified by a postfix.
fn lowerAssignArray(lp: LanguagePass, thisModule: ir.Module, exp: ir.Exp, binOp: ir.BinOp, asPostfix: ir.Postfix, leftType: ir.ArrayType) { }
//! Lower an assign to an AA.
fn lowerAssignAA(lp: LanguagePass, current: ir.Scope, thisModule: ir.Module, exp: ir.Exp, binOp: ir.BinOp, asPostfix: ir.Postfix, aa: ir.AAType, lowerer: LlvmLowerer) { }
//! Lower a +=, *=, etc assign to an AA.
fn lowerOpAssignAA(lp: LanguagePass, current: ir.Scope, thisModule: ir.Module, exp: ir.Exp, binOp: ir.BinOp, asPostfix: ir.Postfix, aa: ir.AAType, lowerer: LlvmLowerer) { }
//! Lower a concatenation operation. (A ~ B)
fn lowerCat(lp: LanguagePass, thisModule: ir.Module, exp: ir.Exp, binOp: ir.BinOp) { }
//! Lower a concatenation assign operation. (A ~= B)
fn lowerCatAssign(lp: LanguagePass, thisModule: ir.Module, exp: ir.Exp, binOp: ir.BinOp) { }
//! Lower a comparison operation, if it needs it.
fn lowerCmp(lp: LanguagePass, thisModule: ir.Module, exp: ir.Exp, binOp: ir.BinOp) { }
//! Lower an expression that casts to an interface.
fn lowerInterfaceCast(loc: const(Location), lp: LanguagePass, current: ir.Scope, uexp: ir.Unary, exp: ir.Exp) { }
//! Lower an expression that casts to an array.
fn lowerArrayCast(loc: const(Location), lp: LanguagePass, current: ir.Scope, uexp: ir.Unary, exp: ir.Exp) { }
//! Is a given postfix an interface pointer? If so, which one?
fn isInterfacePointer(lp: LanguagePass, pfix: ir.Postfix, current: ir.Scope, iface: ir._Interface) bool { }
//! If a postfix operates directly on a struct via a function call, put it
//! in a variable first.
fn lowerStructLookupViaFunctionCall(lp: LanguagePass, current: ir.Scope, exp: ir.Exp, ae: ir.AccessExp, type: ir.Type) { }
//! Rewrites a given foreach statement (fes) into a for statement.
fn lowerForeach(fes: ir.ForeachStatement, lp: LanguagePass, current: ir.Scope) ir.ForStatement { }
//! Lower an array literal to an internal array literal.
fn lowerArrayLiteral(lp: LanguagePass, current: ir.Scope, exp: ir.Exp, al: ir.ArrayLiteral) { }
//! Lower a builtin expression.
fn lowerBuiltin(lp: LanguagePass, current: ir.Scope, exp: ir.Exp, builtin: ir.BuiltinExp, lowerer: LlvmLowerer) { }
fn lowerVaArg(loc: const(Location), lp: LanguagePass, vaexp: ir.VaArgExp) ir.StatementExp { }
//! Lower an ExpReference, if needed.
fn lowerExpReference(functionStack: ir.Function[], exp: ir.Exp, eref: ir.ExpReference, func: ir.Function) { }
//! Lower a Postfix, if needed.
fn lowerPostfix(lp: LanguagePass, current: ir.Scope, thisModule: ir.Module, exp: ir.Exp, parentFunc: ir.Function, postfix: ir.Postfix, lowerer: LlvmLowerer) { }
//! Lower a call to a varargs function.
fn lowerVarargCall(lp: LanguagePass, current: ir.Scope, postfix: ir.Postfix, func: ir.Function, exp: ir.Exp) { }
fn lowerGlobalAALiteral(lp: LanguagePass, current: ir.Scope, mod: ir.Module, var: ir.Variable) { }
//! If postfix is slicing a static array from a non-lvalue expression,
//! lower it into a statement exp.
fn lowerStaticArraySliceNonLValue(lp: LanguagePass, current: ir.Scope, postfix: ir.Postfix, exp: ir.Exp) { }
//! Lower an AA literal.
fn lowerAA(lp: LanguagePass, current: ir.Scope, thisModule: ir.Module, exp: ir.Exp, assocArray: ir.AssocArray, lowerer: LlvmLowerer) { }
//! Rewrite Struct(args) to call their constructors.
fn lowerStructUnionConstructor(lp: LanguagePass, current: ir.Scope, exp: ir.Exp, builtin: ir.BuiltinExp) { }
fn zeroVariableIfNeeded(lp: LanguagePass, var: ir.Variable) ir.Exp { }
fn zeroVariablesIfNeeded(lp: LanguagePass, bs: ir.BlockStatement) { }

volt.lowerer.newreplacer

module volt.lowerer.newreplacer;


class NewReplacer : ScopeManager, Pass
{
public:
	lp: LanguagePass;
	thisModule: ir.Module;


public:
	this(lp: LanguagePass) { }
	fn transform(m: ir.Module) { }
	fn close() { }
	fn enter(exp: ir.Exp, unary: ir.Unary) Status { }


protected:
	fn handleArrayNew(exp: ir.Exp, unary: ir.Unary, array: ir.ArrayType) Status { }
	fn handleArrayCopy(exp: ir.Exp, unary: ir.Unary, array: ir.ArrayType) Status { }
	fn handleClass(exp: ir.Exp, unary: ir.Unary, clazz: ir.Class) Status { }
	fn handleOther(exp: ir.Exp, unary: ir.Unary) Status { }
}

fn createArrayAlloc(loc: const(Location), lp: LanguagePass, baseScope: ir.Scope, atype: ir.ArrayType, sizeArg: ir.Exp) ir.Exp { }
fn buildClassConstructionWrapper(loc: const(Location), lp: LanguagePass, current: ir.Scope, _class: ir.Class, constructor: ir.Function, exps: ir.Exp[]) ir.StatementExp { }

volt.lowerer.manglewriter

module volt.lowerer.manglewriter;


//! Apply mangle symbols to Types and Functions.
class MangleWriter : NullVisitor, Pass
{
public:
	parentNames: StringStack;
	functionDepth: i32;
	aggregateDepth: i32;


public:
	this() { }
	fn transform(m: ir.Module) { }
	fn close() { }
	fn push(name: string) { }
	fn pop(name: string) { }
	fn enter(s: ir.Struct) Status { }
	fn leave(s: ir.Struct) Status { }
	fn enter(u: ir.Union) Status { }
	fn leave(u: ir.Union) Status { }
	fn enter(c: ir.Class) Status { }
	fn leave(c: ir.Class) Status { }
	fn visit(pt: ir.PrimitiveType) Status { }
	fn enter(at: ir.ArrayType) Status { }
	fn enter(sat: ir.StaticArrayType) Status { }
	fn enter(pt: ir.PointerType) Status { }
	fn enter(e: ir.Enum) Status { }
	fn enter(i: ir._Interface) Status { }
	fn enter(ft: ir.FunctionType) Status { }
	fn enter(dt: ir.DelegateType) Status { }
	fn visit(tr: ir.TypeReference) Status { }
	fn enter(aat: ir.AAType) Status { }
	fn visit(nt: ir.NullType) Status { }
	fn enter(array: ir.AmbiguousArrayType) Status { }
	fn enter(attr: ir.Attribute) Status { }
	fn enter(typeOf: ir.TypeOf) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn visit(at: ir.AutoType) Status { }
	fn visit(at: ir.NoType) Status { }
	fn enter(func: ir.Function) Status { }
	fn enter(fp: ir.FunctionParam) Status { }
	fn leave(func: ir.Function) Status { }
	fn enter(a: ir.Alias) Status { }
	fn enter(v: ir.Variable) Status { }
	fn mangleType(n: ir.Node) { }
}

volt.lowerer.typeidreplacer

module volt.lowerer.typeidreplacer;


//! Replaces typeid(...) expressions with a call to the TypeInfo's
//! constructor.
class TypeidReplacer : NullVisitor, Pass
{
public:
	lp: LanguagePass;
	typeinfoVtable: ir.Struct;
	thisModule: ir.Module;


public:
	this(lp: LanguagePass) { }
	fn transform(m: ir.Module) { }
	fn close() { }
	fn enter(exp: ir.Exp, _typeid: ir.Typeid) Status { }
}

volt.semantic.cfg

module volt.semantic.cfg;


//! A single node in the execution graph.
class Block
{
public:
	//! Where execution could come from.
	parents: Block[];
	children: Block[];
	//! For handling super calls in ctors.
	superCall: bool;
	//! Running this block ends execution of its function (e.g. return).
	terminates: bool;
	//! For handling switches, did this case have a goto or break?
	_goto: bool;
	_break: bool;
	//! For loop bodies; did a break block occur while this was the top of the
	//! breakBlock stack?
	broken: bool;


public:
	this() { }
	this(parent: Block) { }
	this(parents: Block[]) { }
	fn addParent(parent: Block) { }
	fn addChild(child: Block) { }
	fn addParents(parents: Block[]) { }
	fn canReachEntry() bool { }
	fn canReachWithoutBreakGoto() bool { }
	fn canReachWithoutSuper() bool { }
	fn hitsBreakBeforeTarget(target: Block) bool { }
}

//! Builds and checks CFGs on Functions.
class CFGBuilder : ScopeManager, Pass
{
public:
	lp: LanguagePass;
	blocks: BlockStack;
	breakBlocks: BlockStack;
	currentSwitchStatement: ir.SwitchStatement;
	currentSwitchBlocks: Block[];
	currentCaseIndex: i32;
	classStack: ClassStack;


public:
	this(lp: LanguagePass) { }
	fn block(b: Block) Block { }
	//! Returns the last block added.
	fn block() Block { }
	fn transform(m: ir.Module) { }
	fn close() { }
	fn enter(func: ir.Function) Status { }
	fn leave(func: ir.Function) Status { }
	fn enter(rs: ir.ReturnStatement) Status { }
	fn enter(exp: ir.Exp, se: ir.StatementExp) Status { }
	fn enter(es: ir.ExpStatement) Status { }
	fn visit(exp: ir.Exp, eref: ir.ExpReference) Status { }
	//! Generate blocks from an if statement.
	fn enter(ifs: ir.IfStatement) Status { }
	fn enter(fs: ir.ForStatement) Status { }
	fn enter(fes: ir.ForeachStatement) Status { }
	fn enter(ws: ir.WhileStatement) Status { }
	fn enter(ds: ir.DoStatement) Status { }
	fn enter(ls: ir.LabelStatement) Status { }
	fn enter(ss: ir.SwitchStatement) Status { }
	fn visit(cs: ir.ContinueStatement) Status { }
	fn enter(c: ir.Class) Status { }
	fn leave(c: ir.Class) Status { }
	fn enter(gs: ir.GotoStatement) Status { }
	//! Generate blocks from a try statement.
	fn enter(ts: ir.TryStatement) Status { }
	fn enter(ts: ir.ThrowStatement) Status { }
	fn enter(as: ir.AssertStatement) Status { }
	fn visit(bs: ir.BreakStatement) Status { }
	fn leave(ws: ir.WhileStatement) Status { }
	fn leave(ds: ir.DoStatement) Status { }
	fn leave(fs: ir.ForStatement) Status { }
	fn leave(fs: ir.ForeachStatement) Status { }
}

struct BlockStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

//! Returns true if the given block can reach the entry without dgt
//! returning true.
fn canReachWithout(block: Block, dgt: bool delegate(Block)) bool { }
fn canReachChildBefore(block: Block, dgt: bool delegate(Block), target: Block) bool { }

volt.semantic.folder

module volt.semantic.folder;


//! Folds any expressions into Constants.
class ExpFolder : NullVisitor, Pass
{
public:
	target: TargetInfo;


public:
	this(target: TargetInfo) { }
	fn transform(mod: ir.Module) { }
	fn close() { }
	fn enter(exp: ir.Exp, binop: ir.BinOp) Status { }
	fn enter(exp: ir.Exp, unary: ir.Unary) Status { }
}

volt.semantic.lifter

module volt.semantic.lifter;


//! IR Lifter, aka Liftertron3000, copies and does transformations on IR.
class SemanticLifter : Lifter
{
public:
	lp: LanguagePass;


public:
	this(lp: LanguagePass) { }
	//! Resets the lifter and clears all cached functions and modules.
	fn reset() { }
	//! Completes the module and returns it for consumption.
	fn completeModule() ir.Module { }
	//! Lift or returns a cached copy of the given function.
	fn lift(func: ir.Function) ir.Function { }
	//! Lift or returns a cached copy of the given variable.
	fn lift(var: ir.Variable) ir.Variable { }
	//! Lift or returns a cached copy of the given function.
	fn lift(fp: ir.FunctionParam) ir.FunctionParam { }
	//! Get a lifted node or panic.
	fn liftedOrPanic(node: ir.Node, msg: string) ir.Node { }
	fn lift(old: ir.Class) ir.Class { }
	fn lift(old: ir.Union) ir.Union { }
	fn lift(old: ir.Enum) ir.Enum { }
	fn lift(old: ir.Struct) ir.Struct { }
	fn lift(old: ir._Interface) ir._Interface { }
	fn lift(old: ir.TopLevelBlock) ir.TopLevelBlock { }
	fn lift(old: ir.Alias) ir.Alias { }


protected:
	//! Create a new module to store functions in.
	fn newModule(loc: Location) { }
	//! Implemented by child classes, copies the function or variable into the
	//! current module mMod and applies error checking and transformation
	//! needed for that specific lifter.
	fn doLift(n: ir.Function) ir.Function { }
	fn doLift(n: ir.Variable) ir.Variable { }
	fn doLift(n: ir.FunctionParam) ir.FunctionParam { }
}

class CTFELifter : SemanticLifter
{
public:
	this(lp: LanguagePass) { }


protected:
	fn doLift(old: ir.Function) ir.Function { }
	fn doLift(old: ir.Variable) ir.Variable { }
}

volt.semantic.extyper

module volt.semantic.extyper;


enum Parent
{
	NA,
	Call,
	Identifier,
	AssignTarget,
	AssignSource,
}

enum StoreSource
{
	Instance,
	Identifier,
	StaticPostfix,
}

class GotoReplacer : NullVisitor
{
public:
	exp: ir.Exp;
	originalExp: ir.Exp;
	ctx: Context;
	ss: ir.SwitchStatement;
	isArraySwitch: bool;


public:
	this(ctx: Context, ss: ir.SwitchStatement, isArraySwitch: bool) { }
	fn enter(gs: ir.GotoStatement) Status { }
	fn enter(bs: ir.BlockStatement) Status { }
}

//! If type casting were to be strict, type T could only go to type T
//! without an explicit cast. Implicit casts are places where the language
//! deems automatic conversion safe enough to insert casts for the user.
class ExTyper : NullVisitor, Pass
{
public:
	ctx: Context;


public:
	this(lp: LanguagePass) { }
	fn transform(m: ir.Module) { }
	fn close() { }
	//! For out of band checking of Variables.
	fn resolve(current: ir.Scope, v: ir.Variable) { }
	//! For out of band checking of Functions.
	fn resolve(current: ir.Scope, func: ir.Function) { }
	fn transform(current: ir.Scope, ti: ir.TemplateInstance) { }
	fn transform(current: ir.Scope, a: ir.Attribute) { }
	fn transform(current: ir.Scope, ed: ir.EnumDeclaration) { }
	fn resolve(ed: ir.EnumDeclaration, prevExp: ir.Exp) { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn enter(m: ir.Module) Status { }
	fn leave(m: ir.Module) Status { }
	fn enter(a: ir.Alias) Status { }
	fn enter(s: ir.Struct) Status { }
	fn leave(s: ir.Struct) Status { }
	fn enter(i: ir._Interface) Status { }
	fn leave(i: ir._Interface) Status { }
	fn enter(u: ir.Union) Status { }
	fn leave(u: ir.Union) Status { }
	fn enter(c: ir.Class) Status { }
	fn leave(c: ir.Class) Status { }
	fn enter(e: ir.Enum) Status { }
	fn leave(e: ir.Enum) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn enter(v: ir.Variable) Status { }
	fn enter(func: ir.Function) Status { }
	fn enter(n: ir.AssertStatement) Status { }
	fn enter(ti: ir.TemplateInstance) Status { }
	fn leave(ti: ir.TemplateInstance) Status { }
	fn leave(n: ir.Function) Status { }
	fn enter(n: ir.FunctionParam) Status { }
	fn leave(n: ir.FunctionParam) Status { }
	fn enter(n: ir.TypeOf) Status { }
	fn leave(n: ir.TypeOf) Status { }
	fn enter(n: ir.IfStatement) Status { }
	fn leave(n: ir.IfStatement) Status { }
	fn enter(n: ir.DoStatement) Status { }
	fn leave(n: ir.DoStatement) Status { }
	fn enter(n: ir.ForStatement) Status { }
	fn leave(n: ir.ForStatement) Status { }
	fn enter(n: ir.TryStatement) Status { }
	fn leave(n: ir.TryStatement) Status { }
	fn enter(n: ir.ExpStatement) Status { }
	fn leave(n: ir.ExpStatement) Status { }
	fn enter(n: ir.WithStatement) Status { }
	fn leave(n: ir.WithStatement) Status { }
	fn enter(n: ir.GotoStatement) Status { }
	fn leave(n: ir.GotoStatement) Status { }
	fn enter(n: ir.ThrowStatement) Status { }
	fn leave(n: ir.ThrowStatement) Status { }
	fn enter(n: ir.BlockStatement) Status { }
	fn leave(n: ir.BlockStatement) Status { }
	fn enter(n: ir.WhileStatement) Status { }
	fn leave(n: ir.WhileStatement) Status { }
	fn enter(n: ir.SwitchStatement) Status { }
	fn leave(n: ir.SwitchStatement) Status { }
	fn leave(n: ir.AssertStatement) Status { }
	fn enter(n: ir.ReturnStatement) Status { }
	fn leave(n: ir.ReturnStatement) Status { }
	fn enter(n: ir.ForeachStatement) Status { }
	fn leave(n: ir.ForeachStatement) Status { }
	fn visit(n: ir.BreakStatement) Status { }
	fn visit(n: ir.ContinueStatement) Status { }
	fn enter(exp: ir.Exp, ir.IsExp) Status { }
	fn leave(exp: ir.Exp, ir.IsExp) Status { }
	fn enter(exp: ir.Exp, ir.BinOp) Status { }
	fn leave(exp: ir.Exp, ir.BinOp) Status { }
	fn enter(exp: ir.Exp, ir.Unary) Status { }
	fn leave(exp: ir.Exp, ir.Unary) Status { }
	fn enter(exp: ir.Exp, ir.Typeid) Status { }
	fn leave(exp: ir.Exp, ir.Typeid) Status { }
	fn enter(exp: ir.Exp, ir.Postfix) Status { }
	fn leave(exp: ir.Exp, ir.Postfix) Status { }
	fn enter(exp: ir.Exp, ir.Ternary) Status { }
	fn leave(exp: ir.Exp, ir.Ternary) Status { }
	fn enter(exp: ir.Exp, ir.TypeExp) Status { }
	fn leave(exp: ir.Exp, ir.TypeExp) Status { }
	fn enter(exp: ir.Exp, ir.VaArgExp) Status { }
	fn leave(exp: ir.Exp, ir.VaArgExp) Status { }
	fn enter(exp: ir.Exp, ir.Constant) Status { }
	fn leave(exp: ir.Exp, ir.Constant) Status { }
	fn enter(exp: ir.Exp, ir.AssocArray) Status { }
	fn leave(exp: ir.Exp, ir.AssocArray) Status { }
	fn enter(exp: ir.Exp, ir.ArrayLiteral) Status { }
	fn leave(exp: ir.Exp, ir.ArrayLiteral) Status { }
	fn enter(exp: ir.Exp, ir.StructLiteral) Status { }
	fn leave(exp: ir.Exp, ir.StructLiteral) Status { }
	fn visit(exp: ir.Exp, ir.TokenExp) Status { }
	fn visit(exp: ir.Exp, ir.ExpReference) Status { }
	fn visit(exp: ir.Exp, ir.IdentifierExp) Status { }
}

struct ArrayCase
{
public:
	originalExps: ir.Exp[];
	_case: ir.SwitchCase;
	lastIf: ir.IfStatement;
	lastI: size_t;
}

//! Does what the name implies.
fn appendDefaultArguments(ctx: Context, loc: ir.Location, arguments: ir.Exp[], func: ir.Function) { }
fn classifyRelationship(child: ir.Exp, parent: ir.Exp) Parent { }
fn handleStore(ctx: Context, ident: string, exp: ir.Exp, store: ir.Store, child: ir.Exp, parent: Parent, via: StoreSource) ir.Type { }
fn handleFunctionStore(ctx: Context, ident: string, exp: ir.Exp, store: ir.Store, child: ir.Exp, parent: Parent, via: StoreSource) ir.Type { }
fn handleValueStore(ctx: Context, ident: string, exp: ir.Exp, store: ir.Store, child: ir.Exp, via: StoreSource) ir.Type { }
fn handleFunctionParamStore(ctx: Context, ident: string, exp: ir.Exp, store: ir.Store, child: ir.Exp, parent: Parent, via: StoreSource) ir.Type { }
fn handleEnumDeclarationStore(ctx: Context, ident: string, exp: ir.Exp, store: ir.Store, child: ir.Exp, parent: Parent, via: StoreSource) ir.Type { }
fn handleTypeStore(ctx: Context, ident: string, exp: ir.Exp, store: ir.Store, child: ir.Exp, parent: Parent, via: StoreSource) ir.Type { }
fn handleScopeStore(ctx: Context, ident: string, exp: ir.Exp, store: ir.Store, child: ir.Exp, parent: Parent, via: StoreSource) ir.Type { }
//! If qname has a child of name leaf, returns an expression looking it
//! up. Otherwise, null is returned.
fn withLookup(ctx: Context, withExp: ir.Exp, leaf: string) ir.Exp { }
//! Replace IdentifierExps with another exp, often ExpReference.
fn extypeIdentifierExp(ctx: Context, e: ir.Exp, parent: Parent) ir.Type { }
fn replaceAAPostfixesIfNeeded(ctx: Context, exp: ir.Exp, postfix: ir.Postfix) ir.Type { }
fn handleArgumentLabelsIfNeeded(ctx: Context, arguments: ir.Exp[], argumentLabels: string[], argumentTags: ir.Postfix.TagKind[], func: ir.Function, exp: ir.Exp) { }
//! Turns identifier postfixes into CreateDelegates, and resolves property
//! function calls in postfixes, type safe varargs, and explicit
//! constructor calls.
fn extypePostfixLeave(ctx: Context, exp: ir.Exp, postfix: ir.Postfix, parent: Parent) ir.Type { }
fn extypePostfixCall(ctx: Context, exp: ir.Exp, postfix: ir.Postfix) { }
fn checkCallRefOutTags(ctx: Context, ftype: ir.CallableType, arguments: ir.Exp[], argumentTags: ir.Postfix.TagKind[]) { }
//! This function acts as a extyperExpReference function would do, but it
//! also takes a extra type context which is used for the cases when
//! looking up Member variables via Types.
fn replaceExpReferenceIfNeeded(ctx: Context, exp: ir.Exp, eRef: ir.ExpReference) { }
//! Turn identifier postfixes into .ident.
fn consumeIdentsIfScopesOrTypes(ctx: Context, postfixes: ir.Postfix[], exp: ir.Exp, parent: Parent) ir.Type { }
fn extypePostfixIndex(ctx: Context, exp: ir.Exp, postfix: ir.Postfix) { }
//! This function will check for ufcs functions on a Identifier postfix, it
//! assumes we have already looked for a field and not found anything.
fn postfixIdentifierUFCS(ctx: Context, exp: ir.Exp, postfix: ir.Postfix, parent: Parent) { }
fn builtInField(ctx: Context, exp: ir.Exp, child: ir.Exp, type: ir.Type, field: string) ir.Type { }
//! Rewrite exp if the store contains any property functions, works for
//! both PostfixExp and IdentifierExp.
fn rewriteIfPropertyStore(exp: ir.Exp, child: ir.Exp, name: string, parent: Parent, funcs: ir.Function[]) bool { }
//! Handling cases:
fn extypePostfixIdentifier(ctx: Context, exp: ir.Exp, postfix: ir.Postfix, parent: Parent) ir.Type { }
fn extypePostfix(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
//! Stops casting to an overloaded function name, casting from null, and
//! wires up some runtime magic needed for classes.
fn extypeUnaryCastTo(ctx: Context, exp: ir.Exp, unary: ir.Unary) { }
//! Type new expressions.
fn extypeUnaryNew(ctx: Context, exp: ir.Exp, _unary: ir.Unary) { }
//! Lower 'new foo[0 .. $]' expressions to BuiltinExps.
fn extypeUnaryDup(ctx: Context, exp: ir.Exp, _unary: ir.Unary) { }
fn extypeUnary(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
//! Everyone's favourite: integer promotion! :D! In general, converts to
//! the largest type needed in a binary expression.
fn extypeBinOp(ctx: Context, bin: ir.BinOp, lprim: ir.PrimitiveType, rprim: ir.PrimitiveType) ir.Type { }
fn rewriteCall(ctx: Context, exp: ir.Exp, func: ir.Function, args: ir.Exp[], left: ir.Exp) { }
//! Given the name of an overloaded operator, rewrite it to a function
//! call.. extypePostfixCall is called on the rewritten expression. 'left'
//! is an expression of which the function will be a member. Returns the
//! function that was called, or null if nothing was rewritten.
fn rewriteOperator(ctx: Context, exp: ir.Exp, overloadName: string, left: ir.Exp, args: ir.Exp[]) ir.Function { }
fn maybeInvertCmp(op: ir.BinOp.Op, invert: bool) ir.BinOp.Op { }
//! If the given binop is working on an aggregate that overloads that
//! operator, rewrite a call to that overload.
fn opOverloadRewrite(ctx: Context, binop: ir.BinOp, exp: ir.Exp) ir.Type { }
//! If this postfix operates on an aggregate with a postfix operator
//! overload, rewrite it.
fn opOverloadRewritePostfix(ctx: Context, pfix: ir.Postfix, exp: ir.Exp) ir.Type { }
//! If this unary is a Minus, and it's operating on an aggregate that has
//! opNeg, rewrite it.
fn opOverloadRewriteUnary(ctx: Context, unary: ir.Unary, exp: ir.Exp) ir.Type { }
fn extypeBinOpPropertyAssign(ctx: Context, binop: ir.BinOp, exp: ir.Exp) ir.Type { }
//! Ensure concatentation is sound.
fn extypeCat(ctx: Context, lexp: ir.Exp, rexp: ir.Exp, left: ir.ArrayType, right: ir.Type) { }
fn rewriteOpIndexAssign(ctx: Context, binop: ir.BinOp, exp: ir.Exp) bool { }
//! If exp is an AccessExp that is effectively const, or an AccessExp with
//! an effectively const AccessExp ancestor, return true. Otherwise, return
//! false.
fn effectiveConstAccessExp(exp: ir.Exp) bool { }
//! Handles logical operators (making a && b result in a bool), binary of
//! storage types, otherwise forwards to assign or primitive specific
//! functions.
fn extypeBinOp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn evaluateIsExp(ctx: Context, isExp: ir.IsExp) ir.Constant { }
fn evaluateTraitsWord(ctx: Context, isExp: ir.IsExp, type: ir.Type) ir.Constant { }
fn extypeIsExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeTernary(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeStructLiteral(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeConstant(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeTypeExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeAssocArray(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeVaArgExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeExpReference(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeArrayLiteral(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeTypeid(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeTokenExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeStringImport(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeStoreExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeRunExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
//! Check the types of a composable string, error if bad.
fn extypeComposableString(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypePropertyExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeBuiltinExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeAccessExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeAssert(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeStatementExp(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeFunctionLiteral(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeUnionLiteral(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeClassLiteral(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extype(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeUnchecked(ctx: Context, exp: ir.Exp, parent: Parent) ir.Type { }
fn extypeBlockStatement(ctx: Context, bs: ir.BlockStatement) { }
//! Ensure that a thrown type inherits from Throwable.
fn extypeThrowStatement(ctx: Context, n: ir.Node) { }
fn extypeTemplateInstance(ctx: Context, ti: ir.TemplateInstance) { }
//! Some extypeSwitchStatment utility functions.
fn addExp(ctx: Context, ss: ir.SwitchStatement, element: ir.Exp, exp: ir.Exp, sz: size_t, intArrayData: u32[], longArrayData: u64[]) { }
//! Some extypeSwitchStatment utility functions.
fn getExpHash(ctx: Context, ss: ir.SwitchStatement, exp: ir.Exp) u32 { }
//! Some extypeSwitchStatment utility functions.
fn replaceWithHashIfNeeded(ctx: Context, ss: ir.SwitchStatement, _case: ir.SwitchCase, arrayCases: ArrayCase[u32], i: size_t, condVar: ir.Variable, toRemove: size_t[], exp: ir.Exp) { }
//! Same as the above function, but handle the multi-case case.
fn replaceExpsWithHashIfNeeded(ctx: Context, ss: ir.SwitchStatement, _case: ir.SwitchCase, arrayCases: ArrayCase[u32], i: size_t, condVar: ir.Variable, exps: ir.Exp[]) { }
//! Ensure that a given switch statement is semantically sound. Errors on
//! bad final switches (doesn't cover all enum members, not on an enum at
//! all), and checks for doubled up cases.
fn extypeSwitchStatement(ctx: Context, n: ir.Node) { }
fn extypeConditionStatement(ctx: Context, n: ir.Node) { }
//! Merge with below function.
fn extypeForeachStatement(ctx: Context, n: ir.Node) { }
//! Process the types and expressions on a foreach. Foreaches become for
//! loops before the backend sees them, but they still need to be made
//! valid by the extyper.
fn processForeach(ctx: Context, fes: ir.ForeachStatement) { }
fn extypeWithStatement(ctx: Context, n: ir.Node) { }
fn extypeReturnStatement(ctx: Context, n: ir.Node) { }
fn extypeIfStatement(ctx: Context, n: ir.Node) { }
fn extypeForStatement(ctx: Context, n: ir.Node) { }
fn extypeWhileStatement(ctx: Context, n: ir.Node) { }
fn extypeDoStatement(ctx: Context, n: ir.Node) { }
fn extypeAssertStatement(ctx: Context, n: ir.Node) { }
fn extypeTryStatement(ctx: Context, n: ir.Node) { }
fn extypeGotoStatement(ctx: Context, n: ir.Node) { }
fn actualizeFunction(ctx: Context, func: ir.Function) { }
//! Helper function to call into the ExTyper version.
fn resolveType(lp: LanguagePass, current: ir.Scope, type: ir.Type) ir.Type { }
//! Flattens storage types, ensure that there are no unresolved
//! TypeRefences in the given type and in general ensures that the type is
//! ready to be consumed.
fn resolveType(ctx: Context, type: ir.Type) ir.Type { }
fn doResolveType(ctx: Context, type: ir.Type, ct: ir.CallableType, ctIndex: size_t) { }
fn doResolveAmbiguousArrayType(ctx: Context, type: ir.Type) { }
fn doResolveAA(ctx: Context, type: ir.Type) { }
//! Resolves an alias, either setting the myalias field or turning it into
//! a type.
fn resolveAlias(lp: LanguagePass, a: ir.Alias) { }
//! Will make sure that the Enum's type is set, and as such will resolve
//! the first member since it decides the type of the rest of the enum.
fn resolveEnum(lp: LanguagePass, e: ir.Enum) { }
//! Check that a non integral enum is valid.
fn checkNonIntegralEnum(lp: LanguagePass, e: ir.Enum) { }
//! Resolves a Variable.
fn resolveVariable(ctx: Context, v: ir.Variable) { }
fn lazyParseBlock(ctx: Context, current: ir.Scope, tokens: ir.Token[], blockStatement: ir.BlockStatement) { }
fn resolveFunction(ctx: Context, func: ir.Function) { }
fn resolveStruct(lp: LanguagePass, s: ir.Struct) { }
fn resolveUnion(lp: LanguagePass, u: ir.Union) { }
//! Check a if a given aggregate contains an erroneous default constructor
//! or destructor.
fn checkDefaultFootors(ctx: Context, agg: ir.Aggregate) { }
//! Check a given Aggregate's anonymous structs/unions (if any) for name
//! collisions.
fn checkAnonymousVariables(ctx: Context, agg: ir.Aggregate) { }
fn isInternalVariable(c: ir.Class, v: ir.Variable) bool { }
fn writeVariableAssignsIntoCtors(ctx: Context, _class: ir.Class) { }
//! Given a expression and a type, if the expression is a literal, tag it
//! (and its subexpressions) with the type.
fn tagLiteralType(exp: ir.Exp, type: ir.Type) { }
//! Given a switch statement, replace 'goto case' with an explicit jump to
//! the next case, or hash the expression if needed.
fn replaceGotoCase(ctx: Context, ss: ir.SwitchStatement, arraySwitch: bool) { }

volt.semantic.typeinfo

module volt.semantic.typeinfo;


//! Makes the mangledName for the Variable holding the TypeInfo instance.
fn getTypeInfoVarName(type: ir.Type) string { }
//! Returns the type info for type, builds a complete TypeInfo if needed.
fn getTypeInfo(lp: LanguagePass, mod: ir.Module, type: ir.Type) ir.Variable { }
//! Fills in the TypeInfo Variable on a Aggregate.
fn createAggregateVar(lp: LanguagePass, aggr: ir.Aggregate) { }
//! Fills in the TypeInfo Variable assign, completing it.
fn fillInAggregateVar(lp: LanguagePass, aggr: ir.Aggregate) { }

volt.semantic.irverifier

module volt.semantic.irverifier;


//! This verifier is design to catch faulty IR (from the view of the
//! backends) that the LanguagePass generate.
class IrVerifier : ScopeManager, Pass
{
public:
	this(errSink: ErrorSink) { }
	fn transform(m: ir.Module) { }
	fn close() { }
	fn enter(v: ir.Variable) Status { }
	fn enter(st: ir.StorageType) Status { }
	fn visit(tr: ir.TypeReference) Status { }
	fn enter(ct: ir.FunctionType) Status { }
	fn enter(ct: ir.DelegateType) Status { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn enter(bs: ir.BlockStatement) Status { }
	fn visit(exp: ir.Exp, ie: ir.IdentifierExp) Status { }
	fn leave(tlb: ir.TopLevelBlock) Status { }
	fn leave(bs: ir.BlockStatement) Status { }
	fn enter(n: ir.Class) Status { }
	fn enter(n: ir.Struct) Status { }
	fn enter(n: ir.Union) Status { }
	fn enter(n: ir.Enum) Status { }
	fn enter(n: ir._Interface) Status { }
	fn check(a: ir.Aggregate) { }
	fn checkStorage(t: ir.Type) { }
	fn checkDepth(_scope: ir.Scope) { }
	fn checkNode(n: ir.Node) Status { }
	fn enter(m: ir.Module) Status { }
	fn enter(i: ir.Import) Status { }
	fn enter(u: ir.Unittest) Status { }
	fn enter(fp: ir.FunctionParam) Status { }
	fn enter(c: ir.Condition) Status { }
	fn enter(ctl: ir.ConditionTopLevel) Status { }
	fn enter(mf: ir.MixinFunction) Status { }
	fn enter(mt: ir.MixinTemplate) Status { }
	fn visit(qname: ir.QualifiedName) Status { }
	fn visit(name: ir.Identifier) Status { }
	fn enter(e: ir.ExpStatement) Status { }
	fn enter(ret: ir.ReturnStatement) Status { }
	fn enter(a: ir.AsmStatement) Status { }
	fn enter(i: ir.IfStatement) Status { }
	fn enter(w: ir.WhileStatement) Status { }
	fn enter(d: ir.DoStatement) Status { }
	fn enter(f: ir.ForStatement) Status { }
	fn enter(fes: ir.ForeachStatement) Status { }
	fn enter(ls: ir.LabelStatement) Status { }
	fn enter(ss: ir.SwitchStatement) Status { }
	fn enter(c: ir.SwitchCase) Status { }
	fn enter(gs: ir.GotoStatement) Status { }
	fn enter(ws: ir.WithStatement) Status { }
	fn enter(ss: ir.SynchronizedStatement) Status { }
	fn enter(ts: ir.TryStatement) Status { }
	fn enter(ts: ir.ThrowStatement) Status { }
	fn enter(ss: ir.ScopeStatement) Status { }
	fn enter(ps: ir.PragmaStatement) Status { }
	fn enter(cs: ir.ConditionStatement) Status { }
	fn enter(ms: ir.MixinStatement) Status { }
	fn enter(as: ir.AssertStatement) Status { }
	fn visit(bs: ir.BreakStatement) Status { }
	fn visit(cs: ir.ContinueStatement) Status { }
	fn enter(pointer: ir.PointerType) Status { }
	fn enter(array: ir.ArrayType) Status { }
	fn enter(array: ir.StaticArrayType) Status { }
	fn enter(array: ir.AmbiguousArrayType) Status { }
	fn enter(func: ir.Function) Status { }
	fn enter(attr: ir.Attribute) Status { }
	fn enter(a: ir.Alias) Status { }
	fn enter(typeOf: ir.TypeOf) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn visit(it: ir.PrimitiveType) Status { }
	fn visit(nt: ir.NullType) Status { }
	fn visit(at: ir.AutoType) Status { }
	fn visit(at: ir.NoType) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn enter(e: ir.Exp, ir.Postfix) Visitor.Status { }
	fn enter(e: ir.Exp, ir.Unary) Visitor.Status { }
	fn enter(e: ir.Exp, ir.BinOp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.Ternary) Visitor.Status { }
	fn enter(e: ir.Exp, ir.ArrayLiteral) Visitor.Status { }
	fn enter(e: ir.Exp, ir.AssocArray) Visitor.Status { }
	fn enter(e: ir.Exp, ir.Assert) Visitor.Status { }
	fn enter(e: ir.Exp, ir.StringImport) Visitor.Status { }
	fn enter(e: ir.Exp, ir.Typeid) Visitor.Status { }
	fn enter(e: ir.Exp, ir.IsExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.FunctionLiteral) Visitor.Status { }
	fn enter(e: ir.Exp, ir.StructLiteral) Visitor.Status { }
	fn enter(e: ir.Exp, ir.UnionLiteral) Visitor.Status { }
	fn enter(e: ir.Exp, ir.ClassLiteral) Visitor.Status { }
	fn enter(e: ir.Exp, ir.Constant) Visitor.Status { }
	fn enter(e: ir.Exp, ir.TypeExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.StatementExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.VaArgExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.PropertyExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.BuiltinExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.AccessExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.RunExp) Visitor.Status { }
	fn enter(e: ir.Exp, ir.ComposableString) Visitor.Status { }
	fn visit(e: ir.Exp, ir.ExpReference) Visitor.Status { }
	fn visit(e: ir.Exp, ir.TokenExp) Visitor.Status { }
	fn visit(e: ir.Exp, ir.StoreExp) Visitor.Status { }
}

volta.postparse.gatherer

//! Module that deals with gatherering symbols into scopes.
module volta.postparse.gatherer;


//! Used to keep track of which level a symbol was found.
enum Where
{
	Module,
	TopLevel,
	Function,
}

//! Populate the scopes with Variables, Aliases, Functions, and Types. Adds
//! Scopes where needed as well.
class Gatherer : NullVisitor, Pass
{
public:
	this(warningsEnabled: bool, errSink: ErrorSink) { }
	fn transform(m: ir.Module) { }
	fn close() { }
	fn transform(m: ir.Module, func: ir.Function, bs: ir.BlockStatement) { }
	fn push(s: ir.Scope, thisType: ir.Type) { }
	fn pop(thisType: ir.Type) { }
	fn push(func: ir.Function) { }
	fn pop(func: ir.Function) { }
	fn push(ti: ir.TemplateInstance) { }
	fn pop(ti: ir.TemplateInstance) { }
	fn pushScopesWithParents(current: ir.Scope) { }
	fn popScopesWithParents(current: ir.Scope) { }
	fn where() Where { }
	fn current() ir.Scope { }
	fn thisType() ir.Type { }
	fn enter(m: ir.Module) Status { }
	fn enter(a: ir.Alias) Status { }
	fn enter(v: ir.Variable) Status { }
	fn enter(c: ir.Class) Status { }
	fn enter(i: ir._Interface) Status { }
	fn enter(s: ir.Struct) Status { }
	fn enter(u: ir.Union) Status { }
	fn enter(e: ir.Enum) Status { }
	fn enter(func: ir.Function) Status { }
	fn enter(ti: ir.TemplateInstance) Status { }
	fn enter(fes: ir.ForeachStatement) Status { }
	fn enter(fs: ir.ForStatement) Status { }
	fn enter(bs: ir.BlockStatement) Status { }
	fn enter(mf: ir.MixinFunction) Status { }
	fn enter(mt: ir.MixinTemplate) Status { }
	fn enter(e: ir.EnumDeclaration) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn leave(m: ir.Module) Status { }
	fn leave(c: ir.Class) Status { }
	fn leave(i: ir._Interface) Status { }
	fn leave(s: ir.Struct) Status { }
	fn leave(u: ir.Union) Status { }
	fn leave(e: ir.Enum) Status { }
	fn leave(func: ir.Function) Status { }
	fn leave(ti: ir.TemplateInstance) Status { }
	fn leave(bs: ir.BlockStatement) Status { }


protected:
	mWhere: Where[];
	mWhereStack: WhereSink;
	mScopeStack: ScopeSink;
	mTypeStack: TypeSink;
	mFunctionStack: FunctionSink;
	mModule: ir.Module;
	mWarningsEnabled: bool;
	mErrSink: ErrorSink;
}

struct WhereSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

fn findShadowed(_scope: ir.Scope, loc: const(Location), name: string, warningsEnabled: bool) ir.Store { }
fn isValidAccess(access: ir.Access) bool { }
fn gather(current: ir.Scope, e: ir.EnumDeclaration, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, a: ir.Alias, where: Where, errSink: ErrorSink) { }
//! If name is reserved in current, generate an error pointing at n's
//! location.
fn checkInvalid(current: ir.Scope, n: ir.Node, name: string, errSink: ErrorSink) { }
fn checkTemplateRedefinition(current: ir.Scope, name: string, errSink: ErrorSink) { }
fn gather(current: ir.Scope, v: ir.Variable, where: Where, warningsEnabled: bool, errSink: ErrorSink) { }
fn gather(current: ir.Scope, func: ir.Function, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, s: ir.Struct, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, u: ir.Union, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, c: ir.Class, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, e: ir.Enum, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, i: ir._Interface, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, mf: ir.MixinFunction, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, mt: ir.MixinTemplate, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, td: ir.TemplateDefinition, where: Where, errSink: ErrorSink) { }
fn gather(current: ir.Scope, ti: ir.TemplateInstance, where: Where, errSink: ErrorSink) { }
fn addScope(m: ir.Module) { }
fn addScope(current: ir.Scope, func: ir.Function, thisType: ir.Type, errSink: ErrorSink) { }
fn addScope(current: ir.Scope, bs: ir.BlockStatement) { }
fn addScope(current: ir.Scope, td: ir.TemplateDefinition, errSink: ErrorSink) { }
fn addScope(current: ir.Scope, s: ir.Struct, errSink: ErrorSink) { }
fn addScope(current: ir.Scope, u: ir.Union, errSink: ErrorSink) { }
fn addScope(current: ir.Scope, e: ir.Enum, errSink: ErrorSink) { }
fn addScope(current: ir.Scope, c: ir.Class, where: Where, errSink: ErrorSink) { }
fn addScope(current: ir.Scope, i: ir._Interface, errSink: ErrorSink) { }
fn addScope(current: ir.Scope, ti: ir.TemplateInstance, errSink: ErrorSink) { }

volta.util.string

module volta.util.string;


//! Convert a CRuntime to lower case string.
fn cRuntimeToString(cRuntime: CRuntime) string { }
//! Convert Platform to lower case string.
fn platformToString(platform: Platform) string { }
//! Convert Arch to lower case string.
fn archToString(arch: Arch) string { }
fn isHex(d: dchar) bool { }
fn unescapeString(errSink: ErrorSink, loc: const(Location), s: const(char)[]) immutable(void)[] { }
//! Generate a hash. djb2 algorithm stolen from
//! http://www.cse.yorku.ca/~oz/hash.html
fn hash(array: u8[]) u32 { }
//! Returns a string that is s, with all '' removed. "134_hello" =>
//! "134hello" "" => ""
fn removeUnderscores(s: string) string { }

volta.visitor.scopemanager

module volta.visitor.scopemanager;


class ScopeManager : NullVisitor
{
public:
	current: ir.Scope;
	functionStack: FunctionStack;


public:
	this(errSink: ErrorSink) { }
	fn enter(m: ir.Module) Status { }
	fn leave(m: ir.Module) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn enter(s: ir.Struct) Status { }
	fn leave(s: ir.Struct) Status { }
	fn enter(u: ir.Union) Status { }
	fn leave(u: ir.Union) Status { }
	fn enter(c: ir.Class) Status { }
	fn leave(c: ir.Class) Status { }
	fn enter(i: ir._Interface) Status { }
	fn leave(i: ir._Interface) Status { }
	fn enter(func: ir.Function) Status { }
	fn leave(func: ir.Function) Status { }
	fn enter(bs: ir.BlockStatement) Status { }
	fn leave(bs: ir.BlockStatement) Status { }
	fn enter(e: ir.Enum) Status { }
	fn leave(e: ir.Enum) Status { }
	fn enter(ti: ir.TemplateInstance) Status { }
	fn leave(ti: ir.TemplateInstance) Status { }


protected:
	mThisModule: ir.Module;
	mErr: ErrorSink;
}

volta.util.moduleFromScope

//! Code for getting a module from a scope.
module volta.util.moduleFromScope;


fn getModuleFromScope(loc: const(Location), _scope: ir.Scope, errSink: ErrorSink) ir.Module { }

volta.util.errormessages

//! Code for generating error message strings.
module volta.util.errormessages;


fn badAbstractMsg() string { }
fn badFinalMsg() string { }
fn shadowsDeclarationMsg(node: ir.Node) string { }
fn abstractHasToBeMemberMsg(func: ir.Function) string { }
fn anonymousAggregateAtTopLevelMsg() string { }
fn abstractBodyNotEmptyMsg(func: ir.Function) string { }
fn nonTopLevelImportMsg() string { }
fn cannotImportMsg(name: string) string { }
fn cannotImportAnonymousMsg(name: string) string { }
fn redefinesSymbolMsg(name: string, loc: const(Location)) string { }
fn overloadFunctionAccessMismatchMsg(importAccess: ir.Access, a: ir.Alias, b: ir.Function) string { }
fn scopeOutsideFunctionMsg() string { }
fn returnInsideScopeMsg() string { }
fn scopeInsideScopeMsg() string { }

lib.llvm.core

//! This file imports the regular C api of LLVM but also extends it with
//! simple wrappers that works on native arrays instead of C pointer plus
//! length arrays as well as string wrappers.
module lib.llvm.core;

public import lib.llvm.c.Core;


enum llvmLicense;

alias LLVMSetTarget = lib.llvm.c.Core.LLVMSetTarget;
alias LLVMSetDataLayout = lib.llvm.c.Core.LLVMSetDataLayout;
alias LLVMModuleCreateWithNameInContext = lib.llvm.c.Core.LLVMModuleCreateWithNameInContext;
alias LLVMFunctionType = lib.llvm.c.Core.LLVMFunctionType;
alias LLVMStructCreateNamed = lib.llvm.c.Core.LLVMStructCreateNamed;
alias LLVMGetStructNamez = lib.llvm.c.Core.LLVMGetStructName;
alias LLVMStructSetBody = lib.llvm.c.Core.LLVMStructSetBody;
alias LLVMConstNamedStruct = lib.llvm.c.Core.LLVMConstNamedStruct;
alias LLVMConstStringInContext = lib.llvm.c.Core.LLVMConstStringInContext;
alias LLVMConstArray = lib.llvm.c.Core.LLVMConstArray;
alias LLVMConstInBoundsGEP = lib.llvm.c.Core.LLVMConstInBoundsGEP;
alias LLVMAddFunction = lib.llvm.c.Core.LLVMAddFunction;
alias LLVMBuildCall = lib.llvm.c.Core.LLVMBuildCall;
alias LLVMBuildInvoke = lib.llvm.c.Core.LLVMBuildInvoke;
alias LLVMBuildAlloca = lib.llvm.c.Core.LLVMBuildAlloca;
alias LLVMAddGlobal = lib.llvm.c.Core.LLVMAddGlobal;
alias LLVMBuildGEP = lib.llvm.c.Core.LLVMBuildGEP;
alias LLVMBuildInBoundsGEP = lib.llvm.c.Core.LLVMBuildInBoundsGEP;
alias LLVMStructTypeInContext = lib.llvm.c.Core.LLVMStructTypeInContext;
alias LLVMAddIncoming = lib.llvm.c.Core.LLVMAddIncoming;

fn LLVMSetTarget(mod: LLVMModuleRef, str: string) { }
fn LLVMSetDataLayout(mod: LLVMModuleRef, str: string) { }
fn LLVMModuleCreateWithNameInContext(name: string, c: LLVMContextRef) LLVMModuleRef { }
fn LLVMFunctionType(ret: LLVMTypeRef, args: LLVMTypeRef[], vararg: bool) LLVMTypeRef { }
fn LLVMStructTypeInContext(c: LLVMContextRef, types: LLVMTypeRef[], packed: LLVMBool) LLVMTypeRef { }
fn LLVMStructCreateNamed(c: LLVMContextRef, name: string) LLVMTypeRef { }
fn LLVMConstNamedStruct(structType: LLVMTypeRef, constantVals: LLVMValueRef[]) LLVMValueRef { }
fn LLVMGetStructName(t: LLVMTypeRef) string { }
fn LLVMStructSetBody(t: LLVMTypeRef, types: LLVMTypeRef[], packed: LLVMBool) { }
fn LLVMConstStringInContext(c: LLVMContextRef, str: const(char)[], nullTerminate: bool) LLVMValueRef { }
fn LLVMConstArray(type: LLVMTypeRef, vals: LLVMValueRef[]) LLVMValueRef { }
fn LLVMConstInBoundsGEP(val: LLVMValueRef, indices: LLVMValueRef[]) LLVMValueRef { }
fn LLVMAddFunction(mod: LLVMModuleRef, name: string, type: LLVMTypeRef) LLVMValueRef { }
fn LLVMBuildCall(b: LLVMBuilderRef, func: LLVMValueRef, args: LLVMValueRef[]) LLVMValueRef { }
fn LLVMBuildInvoke(b: LLVMBuilderRef, func: LLVMValueRef, args: LLVMValueRef[], then: LLVMBasicBlockRef, pad: LLVMBasicBlockRef) LLVMValueRef { }
fn LLVMBuildAlloca(b: LLVMBuilderRef, type: LLVMTypeRef, name: string) LLVMValueRef { }
fn LLVMAddGlobal(mod: LLVMModuleRef, type: LLVMTypeRef, name: string) LLVMValueRef { }
fn LLVMBuildGEP(b: LLVMBuilderRef, ptr: LLVMValueRef, i: LLVMValueRef[], name: string) LLVMValueRef { }
fn LLVMBuildInBoundsGEP(b: LLVMBuilderRef, ptr: LLVMValueRef, i: LLVMValueRef[], name: string) LLVMValueRef { }
fn LLVMAddIncoming(phi: LLVMValueRef, iv: LLVMValueRef[], ib: LLVMBasicBlockRef[]) { }
fn nullTerminate(stack: char[], str: string) const(char)* { }
fn handleAndDisposeMessage(msg: const(char)**) string { }
fn __ctor() { }

lib.llvm.analysis

module lib.llvm.analysis;

public import lib.llvm.c.Analysis;


alias LLVMVerifyModule = lib.llvm.c.Analysis.LLVMVerifyModule;

fn LLVMVerifyModule(mod: LLVMModuleRef) bool { }
fn LLVMVerifyModule(mod: LLVMModuleRef, ret: string) bool { }

lib.llvm.bitreader

module lib.llvm.bitreader;

public import lib.llvm.c.BitReader;


fn LLVMModuleFromFileInContext(ctx: LLVMContextRef, filename: string, outMsg: string) LLVMModuleRef { }

lib.llvm.bitwriter

module lib.llvm.bitwriter;

public import lib.llvm.c.BitWriter;


fn LLVMWriteBitcodeToFile(mod: LLVMModuleRef, filename: string) bool { }

lib.llvm.targetmachine

module lib.llvm.targetmachine;

public import lib.llvm.c.TargetMachine;


alias LLVMGetTargetFromName = lib.llvm.c.TargetMachine.LLVMGetTargetFromName;
alias LLVMGetTargetFromTriple = lib.llvm.c.TargetMachine.LLVMGetTargetFromTriple;
alias LLVMCreateTargetMachine = lib.llvm.c.TargetMachine.LLVMCreateTargetMachine;
alias LLVMTargetMachineEmitToFile = lib.llvm.c.TargetMachine.LLVMTargetMachineEmitToFile;
alias LLVMTargetMachineEmitToMemoryBuffer = lib.llvm.c.TargetMachine.LLVMTargetMachineEmitToMemoryBuffer;

fn LLVMGetTargetFromName(name: string) LLVMTargetRef { }
fn LLVMGetTargetFromTriple(triple: string, outTarget: LLVMTargetRef*, errorMessage: string) bool { }
fn LLVMGetTargetName(target: LLVMTargetRef) string { }
fn LLVMGetTargetDescription(target: LLVMTargetRef) string { }
fn LLVMGetTargetMachineTriple(machine: LLVMTargetMachineRef) string { }
fn LLVMGetTargetMachineCPU(machine: LLVMTargetMachineRef) string { }
fn LLVMGetTargetMachineFeatureString(machine: LLVMTargetMachineRef) string { }
fn LLVMCreateTargetMachine(target: LLVMTargetRef, triple: string, cpu: string, feature: string, level: LLVMCodeGenOptLevel, reloc: LLVMRelocMode, codeModel: LLVMCodeModel) LLVMTargetMachineRef { }
fn LLVMTargetMachineEmitToFile(machine: LLVMTargetMachineRef, mod: LLVMModuleRef, filename: string, codegen: LLVMCodeGenFileType, errorMessage: string) bool { }
fn LLVMTargetMachineEmitToMemoryBuffer(machine: LLVMTargetMachineRef, mod: LLVMModuleRef, codegen: LLVMCodeGenFileType, errorMessage: string, outMemBuf: LLVMMemoryBufferRef*) bool { }

lib.llvm.executionengine

module lib.llvm.executionengine;

public import lib.llvm.c.ExecutionEngine;


alias LLVMCreateExecutionEngineForModule = lib.llvm.c.ExecutionEngine.LLVMCreateExecutionEngineForModule;
alias LLVMCreateMCJITCompilerForModule = lib.llvm.c.ExecutionEngine.LLVMCreateMCJITCompilerForModule;
alias LLVMRemoveModule = lib.llvm.c.ExecutionEngine.LLVMRemoveModule;
alias LLVMRunFunction = lib.llvm.c.ExecutionEngine.LLVMRunFunction;

fn LLVMCreateExecutionEngineForModule(outEE: LLVMExecutionEngineRef*, mod: LLVMModuleRef, error: string) LLVMBool { }
fn LLVMCreateMCJITCompilerForModule(outJIT: LLVMExecutionEngineRef*, mod: LLVMModuleRef, options: LLVMMCJITCompilerOptions, error: string) LLVMBool { }
fn LLVMCreateMCJITCompilerForModule(outJIT: LLVMExecutionEngineRef*, mod: LLVMModuleRef, options: LLVMMCJITCompilerOptions*, optionsSize: size_t, error: string) LLVMBool { }
fn LLVMRemoveModule(ee: LLVMExecutionEngineRef, mod: LLVMModuleRef, outMod: LLVMModuleRef*, error: string) LLVMBool { }
fn LLVMRunFunction(ee: LLVMExecutionEngineRef, name: string, args: LLVMGenericValueRef[]) LLVMGenericValueRef { }

lib.llvm.c.Target

module lib.llvm.c.Target;


enum LLVMByteOrdering
{
	BigEndian,
	LittleEndian,
}

alias LLVMTargetDataRef = LLVMTargetData*;
alias LLVMTargetLibraryInfoRef = LLVMTargetLibraryInfo*;

struct LLVMTargetData
{
}

struct LLVMTargetLibraryInfo
{
}

fn LLVMInitializeX86TargetInfo();
fn LLVMInitializeX86Target();
fn LLVMInitializeX86TargetMC();
fn LLVMInitializeX86AsmPrinter();
fn LLVMInitializeX86AsmParser();
fn LLVMInitializeX86Disassembler();
fn LLVMInitializeARMTargetInfo();
fn LLVMInitializeARMTarget();
fn LLVMInitializeARMTargetMC();
fn LLVMInitializeARMAsmPrinter();
fn LLVMInitializeARMAsmParser();
fn LLVMInitializeARMDisassembler();
fn LLVMInitializeAArch64TargetInfo();
fn LLVMInitializeAArch64Target();
fn LLVMInitializeAArch64TargetMC();
fn LLVMInitializeAArch64AsmPrinter();
fn LLVMInitializeAArch64AsmParser();
fn LLVMInitializeAArch64Disassembler();
fn LLVMCreateTargetData(StringRep: const(char)*) LLVMTargetDataRef;
fn LLVMAddTargetData(TD: LLVMTargetDataRef, PM: LLVMPassManagerRef);
fn LLVMAddTargetLibraryInfo(TLI: LLVMTargetLibraryInfoRef, PM: LLVMPassManagerRef);
fn LLVMCopyStringRepOfTargetData(TD: LLVMTargetDataRef) const(char)*;
fn LLVMByteOrder(TD: LLVMTargetDataRef) LLVMByteOrdering;
fn LLVMPointerSize(TD: LLVMTargetDataRef) u32;
fn LLVMPointerSizeForAS(TD: LLVMTargetDataRef, AS: u32) u32;
fn LLVMIntPtrType(TD: LLVMTargetDataRef) LLVMTypeRef;
fn LLVMIntPtrTypeForAS(TD: LLVMTargetDataRef, AS: u32) LLVMTypeRef;
fn LLVMIntPtrTypeInContext(C: LLVMContextRef, TD: LLVMTargetDataRef) LLVMTypeRef;
fn LLVMIntPtrTypeForASInContext(C: LLVMContextRef, TD: LLVMTargetDataRef, AS: u32) LLVMTypeRef;
fn LLVMSizeOfTypeInBits(TD: LLVMTargetDataRef, Ty: LLVMTypeRef) u64;
fn LLVMStoreSizeOfType(TD: LLVMTargetDataRef, Ty: LLVMTypeRef) u64;
fn LLVMABISizeOfType(TD: LLVMTargetDataRef, Ty: LLVMTypeRef) u64;
fn LLVMABIAlignmentOfType(TD: LLVMTargetDataRef, Ty: LLVMTypeRef) u32;
fn LLVMCallFrameAlignmentOfType(TD: LLVMTargetDataRef, Ty: LLVMTypeRef) u32;
fn LLVMPreferredAlignmentOfType(TD: LLVMTargetDataRef, Ty: LLVMTypeRef) u32;
fn LLVMPreferredAlignmentOfGlobal(TD: LLVMTargetDataRef, GlobalVar: LLVMValueRef) u32;
fn LLVMElementAtOffset(TD: LLVMTargetDataRef, StructTy: LLVMTypeRef, Offset: u64) u32;
fn LLVMOffsetOfElement(TD: LLVMTargetDataRef, StructTy: LLVMTypeRef, Element: u32) u64;
fn LLVMDisposeTargetData(TD: LLVMTargetDataRef);

lib.llvm.c.Linker

module lib.llvm.c.Linker;


enum LLVMLinkerMode
{
	DestroySource,
	PreserveSource,
}

fn LLVMLinkModules(Dest: LLVMModuleRef, Src: LLVMModuleRef, Unused: LLVMLinkerMode, OutMessage: const(char)**) LLVMBool;
fn LLVMLinkModules2(Dest: LLVMModuleRef, Src: LLVMModuleRef) LLVMBool;

lib.llvm.c.Initialization

module lib.llvm.c.Initialization;


fn LLVMInitializeTransformUtils(R: LLVMPassRegistryRef);
fn LLVMInitializeScalarOpts(R: LLVMPassRegistryRef);
fn LLVMInitializeVectorization(R: LLVMPassRegistryRef);
fn LLVMInitializeInstCombine(R: LLVMPassRegistryRef);
fn LLVMInitializeIPO(R: LLVMPassRegistryRef);
fn LLVMInitializeInstrumentation(R: LLVMPassRegistryRef);
fn LLVMInitializeAnalysis(R: LLVMPassRegistryRef);
fn LLVMInitializeIPA(R: LLVMPassRegistryRef);
fn LLVMInitializeCodeGen(R: LLVMPassRegistryRef);
fn LLVMInitializeTarget(R: LLVMPassRegistryRef);

volt.llvm.host

//! Host or JIT compilation code.
module volt.llvm.host;


class HostResult : BackendHostResult
{
public:
	this(state: VoltState) { }
	fn getFunction(func: ir.Function) BackendHostResult.CompiledDg { }
	fn close() { }


protected:
	state: VoltState;
	ee: LLVMExecutionEngineRef;
	mCompiledFunctions: BackendHostResult.CompiledDg[u64];
	mModules: LLVMModuleRef[];


protected:
	fn createAndTrackModule(name: string) LLVMModuleRef { }
}

class SpringBoard
{
public:
	loc: Location;
	dgt: BackendHostResult.CompiledDg;


public:
	this(host: HostResult, func: ir.Function) { }
	fn buildSpringBoard(host: HostResult, name: string, type: ir.FunctionType) { }
	fn callFvZi(ir.Constant[]) ir.Constant { }
	fn callFviZi(a: ir.Constant[]) ir.Constant { }
	fn callSpring(a: ir.Constant[]) ir.Constant { }


protected:
	alias FvZi = fn () (i32);
	alias FviZi = fn (i32) (i32);
	alias Call = fn (void*) (void);


protected:
	mPtr: void*;
	mSpring: Call;
	mArgs: void*;
	mPos: size_t[];
	mRetType: ir.Type;
}

fn writeConstantToPtr(constant: ir.Constant, ptr: void*) { }
fn getConstantFromPtr(loc: Location, type: ir.Type, ptr: void*) ir.Constant { }

volt.llvm.state

//! 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 { }

volt.llvm.toplevel

//! Code handling control flow and toplevel contstructs.
module volt.llvm.toplevel;


//! Visits a module and turn it into code.
class LlvmVisitor : NullVisitor
{
public:
	struct Block
	{
	public:
		_case: ir.SwitchCase;
		block: LLVMBasicBlockRef;
	}


public:
	state: State;
	mod: LLVMModuleRef;
	b: LLVMBuilderRef;


public:
	this(lv: State) { }
	fn compile(m: ir.Module) { }
	fn enter(func: ir.Function) Status { }
	fn enter(var: ir.Variable) Status { }
	fn enter(ret: ir.ReturnStatement) Status { }
	fn enter(exps: ir.ExpStatement) Status { }
	fn enter(ss: ir.SwitchStatement) Status { }
	fn enter(t: ir.TryStatement) Status { }
	fn handleTryNoEH(t: ir.TryStatement) { }
	fn handleTryPosixEH(t: ir.TryStatement) { }
	fn enter(ifs: ir.IfStatement) Status { }
	fn enter(w: ir.WhileStatement) Status { }
	fn enter(d: ir.DoStatement) Status { }
	fn enter(f: ir.ForStatement) Status { }
	fn enter(bs: ir.BlockStatement) Status { }
	fn visit(cs: ir.ContinueStatement) Status { }
	fn visit(bs: ir.BreakStatement) Status { }
	fn leave(gs: ir.GotoStatement) Status { }
	fn leave(t: ir.ThrowStatement) Status { }
	fn leave(m: ir.Module) Status { }
	fn doNewBlock(b: LLVMBasicBlockRef, bs: ir.BlockStatement, fall: LLVMBasicBlockRef) { }
	fn handleScopeSuccessTo(loc: Location, to: State.PathState) { }
	fn handleScopedFunction(func: ir.Function, llvmFunc: LLVMValueRef) { }
	fn handleScopedFunctionPosixAndNone(func: ir.Function, llvmFunc: LLVMValueRef) { }
	fn fillInLandingPad(landingPad: LLVMBasicBlockRef, setCleanup: bool, catchPath: State.PathState) { }
	fn enter(m: ir.Module) Status { }
	fn leave(v: ir.Variable) Status { }
	fn leave(f: ir.Function) Status { }
	fn leave(i: ir.IfStatement) Status { }
	fn leave(e: ir.ExpStatement) Status { }
	fn leave(b: ir.BlockStatement) Status { }
	fn leave(r: ir.ReturnStatement) Status { }
}

volta.util.sinks

module volta.util.sinks;


struct IntSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct BoolSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct NodeSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct TypeSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct ScopeSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct VariableSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct FunctionSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct AttributeSink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

struct FunctionArraySink
{
public:
	enum MaxSize;


public:
	alias Sink = void delegate(scope (SinkArg));
	alias SinkArg = scope (scope (T)[]);


public:
	fn length() size_t { }
	fn sink(type: T) { }
	fn append(arr: scope (scope (T)[])) { }
	fn append(s: SinkStruct) { }
	fn popLast() T { }
	fn getLast() T { }
	fn get(i: size_t) T { }
	fn set(i: size_t, n: T) { }
	fn setLast(i: T) { }
	fn toSink(sink: Sink) { }
	fn toArray() T[] { }
	fn borrowUnsafe() T[] { }
	fn reset() { }
}

volt.lowerer.alloc

module volt.lowerer.alloc;


//! Creates a call to the allocDg delegate.
fn buildAllocVoidPtr(loc: const(Location), lp: LanguagePass, type: ir.Type, countArg: ir.Exp) ir.Exp { }
//! Creates a call to the allocDg delegate.
fn buildAllocTypePtr(loc: const(Location), lp: LanguagePass, type: ir.Type, countArg: ir.Exp) ir.Exp { }

volt.lowerer.callBuilder

//! Build calls to intrinsic functions and the like.
module volt.lowerer.callBuilder;


//! Call buildAndAddMemfoo, wrapping dst in an ExpReference.
fn buildAndAddMemfoo(loc: const(token.Location), bexp: ir.BlockStatement, memcpyFunction: ir.Function, dst: ir.Variable, src: ir.Exp, len: ir.Exp, base: ir.Type, target: TargetInfo) { }
//! Build a call with buildIntrinsicMemfoo and add it to a BlockStatement.
fn buildAndAddMemfoo(loc: const(token.Location), bexp: ir.BlockStatement, memcpyFunction: ir.Function, dst: ir.Exp, src: ir.Exp, len: ir.Exp, base: ir.Type, target: TargetInfo) { }
//! Build a call with buildIntrinsicMemfoo and add it to a StatementExp.
fn buildAndAddMemfoo(loc: const(token.Location), sexp: ir.StatementExp, memcpyFunction: ir.Function, dst: ir.Exp, src: ir.Exp, len: ir.Exp, base: ir.Type, target: TargetInfo) { }
//! Build a call to a memcpy/memmove function, or a function that takes
//! the same arguments.
fn buildIntrinsicMemfoo(loc: const(token.Location), memcpyFunction: ir.Function, dst: ir.Exp, src: ir.Exp, len: ir.Exp, target: TargetInfo) ir.Exp { }
//! Build a call to a memset function.
fn buildIntrinsicMemset(loc: const(token.Location), memsetFunction: ir.Function, dst: ir.Exp, val: ir.Exp, len: ir.Exp, target: TargetInfo) ir.Exp { }

volt.semantic.context

module volt.semantic.context;


class Context
{
public:
	lp: LanguagePass;
	extyper: Visitor;
	isVarAssign: bool;
	overrideType: ir.Type;


public:
	this(lp: LanguagePass, extyper: Visitor) { }
	//! Setup the context from a empty state.
	fn setupFromScope(_scope: ir.Scope) { }
	//! Reset the context allowing it to be resued.
	fn reset() { }
	fn current() ir.Scope { }
	fn parentFunction() ir.Function { }
	fn currentFunction() ir.Function { }
	//! Returns how many functions deep this context currently is.
	fn functionDepth() u32 { }
	fn withExps() ir.Exp[] { }
	fn isNested() bool { }
	fn isFunction() bool { }
	fn lastIndexChild() ir.Exp { }
	fn enter(m: ir.Module) { }
	fn enter(s: ir.Struct) { }
	fn enter(u: ir.Union) { }
	fn enter(c: ir.Class) { }
	fn enter(i: ir._Interface) { }
	fn enter(e: ir.Enum) { }
	fn enter(func: ir.Function) { }
	fn enter(ti: ir.TemplateInstance) { }
	fn enter(bs: ir.BlockStatement) { }
	fn leave(m: ir.Module) { }
	fn leave(s: ir.Struct) { }
	fn leave(u: ir.Union) { }
	fn leave(c: ir.Class) { }
	fn leave(i: ir._Interface) { }
	fn leave(e: ir.Enum) { }
	fn leave(func: ir.Function) { }
	fn leave(ti: ir.TemplateInstance) { }
	fn leave(bs: ir.BlockStatement) { }
	//! Keep track of with statements and switch withs.
	fn pushWith(exp: ir.Exp) { }
	//! Keep track of with statements and switch withs.
	fn popWith(exp: ir.Exp) { }
	fn enter(postfix: ir.Postfix) { }
	fn leave(postfix: ir.Postfix) { }
	fn enter(unary: ir.Unary) { }
	fn leave(unary: ir.Unary) { }
	fn enter(bin: ir.BuiltinExp) { }
	fn leave(bin: ir.BuiltinExp) { }
}

volt.semantic.implicit

module volt.semantic.implicit;


enum IgnoreConst;

//! Call checkAndDoConvert, but convert string literals into pointers, if
//! needed.
fn checkAndConvertStringLiterals(ctx: Context, type: ir.Type, exp: ir.Exp) { }
//! If exp will convert into type, call doConvert to do it, otherwise throw
//! an error, with the loc set to exp.loc.
fn checkAndDoConvert(ctx: Context, type: ir.Type, exp: ir.Exp) { }
//! Returns true if the given expression's type converts into type.
fn willConvert(ctx: Context, type: ir.Type, exp: ir.Exp, ignoreConst: bool) bool { }
//! Returns true if arg converts into param.
fn willConvert(ltype: ir.Type, rtype: ir.Type, ignoreConst: bool) bool { }
fn willConvertCallable(l: ir.Type, r: ir.Type, ignoreConst: bool) bool { }
fn willConvertInterface(l: ir.Type, rInterface: ir._Interface, ignoreConst: bool) bool { }
fn willConvertClassToInterface(lInterface: ir._Interface, rClass: ir.Class, ignoreConst: bool) bool { }
//! Change exp so its type is type. This function assumes that willConvert
//! returns true on the given expression.
fn doConvert(ctx: Context, type: ir.Type, exp: ir.Exp) { }

volt.ir.lifter

module volt.ir.lifter;


//! Base lifting class, only implements copying not lifting.
class Lifter
{
public:
	this() { }
	fn lift(old: ir.Function) ir.Function;
	fn lift(old: ir.Variable) ir.Variable;
	fn lift(old: ir.Class) ir.Class;
	fn lift(old: ir.Union) ir.Union;
	fn lift(old: ir.Struct) ir.Struct;
	fn lift(old: ir._Interface) ir._Interface;
	fn lift(old: ir.Alias) ir.Alias;
	fn lift(old: ir.FunctionParam) ir.FunctionParam;
	fn lift(old: ir.TopLevelBlock) ir.TopLevelBlock;
	fn lift(old: ir.Enum) ir.Enum;
	fn liftedOrPanic(n: ir.Node, msg: string) ir.Node;
	fn copyExp(n: ir.Exp) ir.Exp { }
	fn copyType(n: ir.Type) ir.Type { }
	fn copyStatement(parent: ir.Scope, n: ir.Node) ir.Node { }
	fn copy(old: ir.QualifiedName) ir.QualifiedName { }
	fn copyQualifiedName(old: ir.QualifiedName) ir.QualifiedName { }
	fn copy(old: ir.Identifier) ir.Identifier { }
	fn copy(old: ir.FunctionParam) ir.FunctionParam { }
	fn copy(old: ir.IsExp) ir.IsExp { }
	fn copy(old: ir.VaArgExp) ir.VaArgExp { }
	fn copy(old: ir.StructLiteral) ir.StructLiteral { }
	fn copy(old: ir.StringImport) ir.StringImport { }
	fn copy(old: ir.AssocArray) ir.AssocArray { }
	fn copy(old: ir.AAPair) ir.AAPair { }
	fn copy(old: ir.Ternary) ir.Ternary { }
	fn copy(old: ir.AccessExp) ir.AccessExp { }
	fn copy(old: ir.Constant) ir.Constant { }
	fn copy(old: ir.BinOp) ir.BinOp { }
	fn copy(old: ir.IdentifierExp) ir.IdentifierExp { }
	fn copy(old: ir.TypeExp) ir.TypeExp { }
	fn copy(old: ir.ArrayLiteral) ir.ArrayLiteral { }
	fn copy(old: ir.TokenExp) ir.TokenExp { }
	fn copy(old: ir.ExpReference) ir.ExpReference { }
	fn copy(old: ir.Postfix) ir.Postfix { }
	fn copy(old: ir.PropertyExp) ir.PropertyExp { }
	fn copy(old: ir.Unary) ir.Unary { }
	fn copy(old: ir.Typeid) ir.Typeid { }
	fn copy(old: ir.BuiltinExp) ir.BuiltinExp { }
	fn copy(old: ir.RunExp) ir.RunExp { }
	fn copy(parent: ir.Scope, old: ir.ReturnStatement) ir.ReturnStatement { }
	fn copy(parent: ir.Scope, old: ir.BlockStatement) ir.BlockStatement { }
	fn copy(old: ir.BreakStatement) ir.BreakStatement { }
	fn copy(old: ir.ContinueStatement) ir.ContinueStatement { }
	fn copy(old: ir.ExpStatement) ir.ExpStatement { }
	fn copy(old: ir.AssertStatement) ir.AssertStatement { }
	fn copy(old: ir.GotoStatement) ir.GotoStatement { }
	fn copy(old: ir.ThrowStatement) ir.ThrowStatement { }
	fn copy(old: ir.StorageType) ir.StorageType { }
	fn copy(parent: ir.Scope, old: ir.TryStatement) ir.TryStatement { }
	fn copy(parent: ir.Scope, old: ir.WithStatement) ir.WithStatement { }
	fn copy(parent: ir.Scope, old: ir.IfStatement) ir.IfStatement { }
	fn copy(parent: ir.Scope, old: ir.WhileStatement) ir.WhileStatement { }
	fn copy(parent: ir.Scope, old: ir.DoStatement) ir.DoStatement { }
	fn copy(parent: ir.Scope, old: ir.SwitchStatement) ir.SwitchStatement { }
	fn copy(parent: ir.Scope, old: ir.ForeachStatement) ir.ForeachStatement { }
	fn copy(parent: ir.Scope, old: ir.ForStatement) ir.ForStatement { }
	fn copyAliasStaticIf(old: ir.AliasStaticIf) ir.AliasStaticIf { }
	fn copy(old: ir.FunctionType) ir.FunctionType { }
	fn copy(old: ir.PrimitiveType) ir.PrimitiveType { }
	fn copy(old: ir.TypeReference) ir.TypeReference { }
	fn copy(old: ir.AutoType) ir.AutoType { }
	fn copy(old: ir.StaticArrayType) ir.StaticArrayType { }
	fn copy(old: ir.AmbiguousArrayType) ir.AmbiguousArrayType { }
	fn copy(old: ir.ArrayType) ir.ArrayType { }
	fn copy(old: ir.DelegateType) ir.DelegateType { }
	fn copy(ct: ir.CallableType, old: ir.CallableType) ir.CallableType { }
	fn copy(old: ir.PointerType) ir.PointerType { }
	fn copy(old: ir.TypeOf) ir.TypeOf { }
	fn copy(old: ir.NullType) ir.NullType { }
	//! Copies a Scope but not its stores.
	fn copyScope(parent: ir.Scope, owner: ir.Node, old: ir.Scope) ir.Scope { }
	fn copyStores(n: ir.Scope, old: ir.Scope) { }
	fn copyStore(parent: ir.Scope, old: ir.Store) ir.Store { }
}

volta.util.stack

module volta.util.stack;


struct FunctionStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

struct ExpStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

struct ClassStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

struct AggregateStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

struct BinOpOpStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

struct BoolStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

struct StringStack
{
public:
	enum MaxSize;


public:
	fn length() size_t { }
	fn push(val: T) { }
	fn pop() T { }
	fn peek() T { }
	fn clear() { }
	fn borrowUnsafe() T[] { }
}

volta.token.writer

module volta.token.writer;


//! Small container class for tokens, used by the lexer to write tokens
//! to.
class TokenWriter
{
public:
	errors: LexerError[];
	noDoc: bool;
	magicFlagD: bool;


public:
	//! Create a new TokenWriter and initialize the first token to
	//! TokenType.Begin.
	this(source: Source) { }
	//! Create a new TokenWriter that doesn't have a Source reference.
	this() { }
	//! Return the current source.
	fn source() Source { }
	//! Add the Return the last added token.
	fn addToken(token: Token) { }
	fn addEnd() { }
	//! Remove the last token from the token list. No checking is performed,
	//! assumes you know that you can remove a token.
	fn pop() { }
	//! Return the last added token.
	fn lastAdded() Token { }
	//! Returns this writer's tokens.
	fn getTokens() Token[] { }
}

volta.token.error

module volta.token.error;


enum LexStatus
{
	NotPresent,
	Succeeded,
	Failed,
}

alias NotPresent = LexStatus.NotPresent;
alias Succeeded = LexStatus.Succeeded;
alias Failed = LexStatus.Failed;

//! Describes a lexer failure.
class LexerError
{
public:
	enum Kind
	{
		//! No error.
		Ok,
		//! Tried to lex something, but it failed.
		LexFailed,
		//! Expected something that wasn't there.
		Expected,
		//! Didn't expect something that we got.
		Unexpected,
		//! Tried to use an unsupported feature.
		Unsupported,
		//! Display the given string.
		String,
		//! Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah! (Compiler Error)
		Panic,
	}


public:
	kind: Kind;
	loc: Location;
	currentChar: dchar;


public:
	this(kind: Kind, loc: Location, currentChar: dchar) { }
	fn errorMessage() string;
}

//! An error with a string.
class LexerStringError : LexerError
{
public:
	str: string;


public:
	this(kind: Kind, loc: Location, currentChar: dchar, str: string) { }
	fn errorMessage() string { }
}

volta.ir.tokenstream

module volta.ir.tokenstream;

public import volta.ir.token;


//! Class used by the parser to read lexed tokens.
class TokenStream
{
public:
	errSink: ErrorSink;


public:
	//! Takes the token array, initializes mTokens and sets the current token
	//! to the first token.
	this(tokens: Token[], errSink: ErrorSink) { }
	//! Reset the stream.
	fn reset() { }
	//! Compares the current token's type against the given type.
	fn opEquals(type: TokenType) bool { }
	//! Compares from the current token and onwards type against the list of
	//! types.
	fn opEquals(types: scope (const(scope (TokenType)[])) i32 { }
	//! Returns the current token.
	fn peek() Token { }
	//! Returns the current token. Thorws: CompilerPanic on mIndex == 0.
	fn previous() Token { }
	//! Returns the token @n steps ahead. Will clamp @n to stream length.
	fn lookahead(n: size_t, eof: bool) Token { }
	//! Returns the token @n step behind the current token. Will cause a
	//! compiler panic if looking to far back.
	fn lookbehind(n: size_t) Token { }
	//! Returns the current position in the stream.
	fn save() size_t { }
	//! Restore the stream to the current index retrieved from save().
	fn restore(index: size_t) { }


protected:
	mTokens: Token[];
	mIndex: size_t;
}

volta.visitor.setExpLocationVisitor

module volta.visitor.setExpLocationVisitor;


//! Set the loc field for expressions.
class SetExpLocationVisitor : visitor.NullVisitor
{
public:
	newLocation: location.Location;


public:
	this() { }
	fn enter(exp: ir.Exp, postfix: ir.Postfix) Status { }
	fn enter(exp: ir.Exp, unary: ir.Unary) Status { }
	fn enter(exp: ir.Exp, binop: ir.BinOp) Status { }
	fn enter(exp: ir.Exp, ternary: ir.Ternary) Status { }
	fn enter(exp: ir.Exp, literal: ir.ArrayLiteral) Status { }
	fn enter(exp: ir.Exp, aa: ir.AssocArray) Status { }
	fn enter(exp: ir.Exp, _assert: ir.Assert) Status { }
	fn enter(exp: ir.Exp, simport: ir.StringImport) Status { }
	fn enter(exp: ir.Exp, tid: ir.Typeid) Status { }
	fn enter(exp: ir.Exp, iexp: ir.IsExp) Status { }
	fn enter(exp: ir.Exp, fliteral: ir.FunctionLiteral) Status { }
	fn enter(exp: ir.Exp, sliteral: ir.StructLiteral) Status { }
	fn enter(exp: ir.Exp, uliteral: ir.UnionLiteral) Status { }
	fn enter(exp: ir.Exp, cliteral: ir.ClassLiteral) Status { }
	fn enter(exp: ir.Exp, _constant: ir.Constant) Status { }
	fn enter(exp: ir.Exp, texp: ir.TypeExp) Status { }
	fn enter(exp: ir.Exp, sexp: ir.StatementExp) Status { }
	fn enter(exp: ir.Exp, vexp: ir.VaArgExp) Status { }
	fn enter(exp: ir.Exp, pexp: ir.PropertyExp) Status { }
	fn enter(exp: ir.Exp, bexp: ir.BuiltinExp) Status { }
	fn enter(exp: ir.Exp, aexp: ir.AccessExp) Status { }
	fn enter(exp: ir.Exp, rexp: ir.RunExp) Status { }
	fn enter(exp: ir.Exp, cstring: ir.ComposableString) Status { }
	fn visit(exp: ir.Exp, iexp: ir.IdentifierExp) Status { }
	fn visit(exp: ir.Exp, eref: ir.ExpReference) Status { }
	fn visit(exp: ir.Exp, texp: ir.TokenExp) Status { }
	fn visit(exp: ir.Exp, storeExp: ir.StoreExp) Status { }
}

volt.llvm.type

//! Code and classes for turning Volt Types into LLVM types.
module volt.llvm.type;


//! Base class for a LLVM backend types. Contains a refernce to the irType
//! for this type, the llvmType and the debugging info for this type.
class Type
{
public:
	irType: ir.Type;
	llvmType: LLVMTypeRef;
	diType: LLVMMetadataRef;
	passByValAttr: bool;
	passByValPtr: bool;


public:
	fn from(State, ir.Constant, Value) { }
	fn from(State, ir.ArrayLiteral, Value) { }
	fn from(State, ir.UnionLiteral, Value) { }
	fn from(State, ir.StructLiteral, Value) { }
}

//! Void .
class VoidType : Type
{
public:
	static fn fromIr(state: State, pt: ir.PrimitiveType) VoidType { }
}

//! Integer but not void.
class PrimitiveType : Type
{
public:
	boolean: bool;
	signed: bool;
	floating: bool;
	bits: u32;


public:
	fn from(state: State, cnst: ir.Constant, result: Value) { }
	fn fromNumber(state: State, val: i64) LLVMValueRef { }


public:
	static fn fromIr(state: State, pt: ir.PrimitiveType) PrimitiveType { }
}

//! PointerType represents a standard C pointer.
class PointerType : Type
{
public:
	base: Type;


public:
	fn from(state: State, cnst: ir.Constant, result: Value) { }


public:
	static fn fromIr(state: State, pt: ir.PointerType) PointerType { }
}

//! Array type.
class ArrayType : Type
{
public:
	enum lengthIndex;
	enum ptrIndex;


public:
	base: Type;
	ptrType: PointerType;
	lengthType: PrimitiveType;
	types: Type[2];


public:
	fn from(state: State, cnst: ir.Constant, result: Value) { }
	fn from(state: State, al: ir.ArrayLiteral, result: Value) { }
	fn from(state: State, arr: LLVMValueRef[]) LLVMValueRef { }


public:
	static fn fromIr(state: State, at: ir.ArrayType) ArrayType { }
}

//! Static array type.
class StaticArrayType : Type
{
public:
	base: Type;
	length: u32;
	arrayType: ArrayType;
	ptrType: PointerType;


public:
	fn from(state: State, al: ir.ArrayLiteral, result: Value) { }


public:
	static fn fromIr(state: State, sat: ir.StaticArrayType) StaticArrayType { }
}

//! Base class for callable types FunctionType and DelegateType.
class CallableType : Type
{
public:
	ret: Type;
	ct: ir.CallableType;
	params: Type[];


public:
	this(state: State, ct: ir.CallableType, llvmType: LLVMTypeRef, diType: LLVMMetadataRef) { }
}

//! Function type.
class FunctionType : CallableType
{
public:
	hasStructRet: bool;
	llvmCallType: LLVMTypeRef;
	diCallType: LLVMMetadataRef;


public:
	fn from(state: State, cnst: ir.Constant, result: Value) { }


public:
	static fn fromIr(state: State, ft: ir.FunctionType) FunctionType { }
}

//! Delegates are lowered here into a struct with two members.
class DelegateType : CallableType
{
public:
	enum voidPtrIndex;
	enum funcIndex;


public:
	llvmCallPtrType: LLVMTypeRef;


public:
	fn from(state: State, cnst: ir.Constant, result: Value) { }


public:
	static fn fromIr(state: State, dgt: ir.DelegateType) DelegateType { }
}

//! Backend instance of a ir.Struct.
class StructType : Type
{
public:
	indices: u32[string];
	types: Type[];


public:
	fn from(state: State, sl: ir.StructLiteral, result: Value) { }


public:
	static fn fromIr(state: State, irType: ir.Struct) StructType { }
}

//! Backend instance of a ir.Union.
class UnionType : Type
{
public:
	indices: u32[string];
	types: Type[];
	utype: ir.Union;


public:
	fn from(state: State, ul: ir.UnionLiteral, result: Value) { }


public:
	static fn fromIr(state: State, irType: ir.Union) UnionType { }
}

//! Looks up or creates the corresponding LLVMTypeRef and Type for the
//! given irType.
fn fromIr(state: State, irType: ir.Type) Type { }
//! Dispatcher function to Type constructors.
fn fromIrImpl(state: State, irType: ir.Type) Type { }
//! Populate the common types that hang off the state.
fn buildCommonTypes(state: State, V_P64: bool) { }
//! Does a smart copy of a type.
fn scrubStorage(type: ir.Type) ir.Type { }
//! Helper function for adding mangled name to ir types.
fn addMangledName(irType: ir.Type) string { }
//! Helper function to tell if a type is Void.
fn isVoid(type: Type) bool { }

lib.llvm.c.Analysis

module lib.llvm.c.Analysis;


enum LLVMVerifierFailureAction
{
	AbortProcess,
	PrintMessage,
	ReturnStatus,
}

fn LLVMVerifyModule(M: LLVMModuleRef, Action: LLVMVerifierFailureAction, OutMessage: const(char)**) LLVMBool;
fn LLVMVerifyFunction(Fn: LLVMValueRef, Action: LLVMVerifierFailureAction) LLVMBool;
fn LLVMViewFunctionCFG(Fn: LLVMValueRef);
fn LLVMViewFunctionCFGOnly(Fn: LLVMValueRef);

volt.llvm.constant

//! Code for generating constant expresions.
module volt.llvm.constant;


fn getConstantValue(state: State, exp: ir.Exp, result: Value) { }

volt.llvm.expression

//! Most of the expression to llvmbitcode generation code is in this
//! module.
module volt.llvm.expression;


//! Returns the value, without doing any checking if it is in reference
//! form or not.
fn getValueAnyForm(state: State, exp: ir.Exp, result: Value) { }

volt.llvm.interfaces

//! Interfaces that the rest of the LLVM Backend code uses.
module volt.llvm.interfaces;

public import lib.llvm.core;
public import volta.ir.location;
public import volt.interfaces;
public import volta.ir = volta.ir
public import volt.llvm.debugInfo;
public import volt.llvm.type;


//! Represents a single LLVMValueRef plus the associated high level type.
class Value
{
public:
	type: Type;
	value: LLVMValueRef;
	//! Is this a reference to the real value?
	isPointer: bool;


public:
	this() { }
	this(val: Value) { }
}

//! 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 LLVM and language concepts.
class State
{
public:
	class PathState
	{
	public:
		prev: PathState;
		landingBlock: LLVMBasicBlockRef;
		continueBlock: LLVMBasicBlockRef;
		breakBlock: LLVMBasicBlockRef;
		scopeSuccess: LLVMValueRef[];
		scopeFailure: LLVMValueRef[];
		scopeLanding: LLVMBasicBlockRef[];
		catchBlock: LLVMBasicBlockRef;
		catchTypeInfos: LLVMValueRef[];


	public:
		this() { }
	}

	struct SwitchState
	{
	public:
		def: LLVMBasicBlockRef;
		cases: LLVMBasicBlockRef[i64];
	}

	struct FunctionState
	{
	public:
		func: LLVMValueRef;
		di: LLVMMetadataRef;
		//! Tracking for auto branch generation.
		fall: bool;
		//! Nested value
		nested: LLVMValueRef;
		path: PathState;
		entryBr: LLVMValueRef;
		block: LLVMBasicBlockRef;
		swi: SwitchState;
		indexVar: LLVMValueRef;
		exceptionVar: LLVMValueRef;
		resumeBlock: LLVMBasicBlockRef;
		exitBlock: LLVMBasicBlockRef;
	}


public:
	lp: LanguagePass;
	target: TargetInfo;
	irMod: ir.Module;
	currentWorkingDir: string;
	execDir: string;
	identStr: string;
	ehPersonality: ir.Function;
	llvmTypeidFor: ir.Function;
	context: LLVMContextRef;
	builder: LLVMBuilderRef;
	diBuilder: LLVMDIBuilderRef;
	mod: LLVMModuleRef;
	//! Cached llvm attributes.
	attrSRet: LLVMAttributeRef;
	//! Cached llvm attributes.
	attrByVal: LLVMAttributeRef;
	//! Cached llvm attributes.
	attrUWTable: LLVMAttributeRef;
	fnState: FunctionState;
	//! Global and local constructors and destructors.
	globalConstructors: LLVMValueRef[];
	//! Global and local constructors and destructors.
	globalDestructors: LLVMValueRef[];
	//! Global and local constructors and destructors.
	localConstructors: LLVMValueRef[];
	//! Global and local constructors and destructors.
	localDestructors: LLVMValueRef[];
	//! Debug helper variables.
	diCU: LLVMMetadataRef;
	//! Cached type for convenience.
	voidType: VoidType;
	//! Cached type for convenience.
	boolType: PrimitiveType;
	//! Cached type for convenience.
	byteType: PrimitiveType;
	//! Cached type for convenience.
	ubyteType: PrimitiveType;
	//! Cached type for convenience.
	intType: PrimitiveType;
	//! Cached type for convenience.
	uintType: PrimitiveType;
	//! Cached type for convenience.
	ulongType: PrimitiveType;
	//! Cached type for convenience.
	voidPtrType: PointerType;
	//! Cached type for convenience.
	sizeType: PrimitiveType;
	//! Cached type for convenience.
	voidFunctionType: FunctionType;
	//! Cached type for convenience.
	springType: FunctionType;


public:
	this() { }
	fn func() LLVMValueRef { }
	fn fall() bool { }
	fn block() LLVMBasicBlockRef { }
	fn path() PathState { }
	fn switchDefault() LLVMBasicBlockRef { }
	fn switchSetCase(val: i64, ret: LLVMBasicBlockRef) LLVMBasicBlockRef { }
	fn switchGetCase(val: i64, ret: LLVMBasicBlockRef) bool { }
	fn findLanding() PathState { }
	fn findCatch() PathState { }
	fn findContinue() PathState { }
	fn findBreak() PathState { }
	//! LLVM intrinsic.
	fn llvmTrap() LLVMValueRef;
	//! Exception handling.
	fn ehPersonalityFunc() LLVMValueRef;
	//! Exception handling.
	fn ehTypeIdFunc() LLVMValueRef;
	//! Exception handling.
	fn ehLandingType() LLVMTypeRef;
	//! Exception handling.
	fn ehResumeBlock() LLVMBasicBlockRef;
	//! Exception handling.
	fn ehExitBlock() LLVMBasicBlockRef;
	//! Exception handling.
	fn ehIndexVar() LLVMValueRef;
	//! Exception handling.
	fn ehExceptionVar() LLVMValueRef;
	fn close();
	fn onFunctionClose();
	//! Build a complete module with this state.
	fn compile(m: ir.Module);
	//! Builds the given statement class at the current place, and any
	//! sub-expressions & -statements.
	fn evaluateStatement(node: ir.Node);
	//! Builds a 'alloca' instructions and inserts it at the end of the entry
	//! basic block that is at the top of the function.
	fn buildAlloca(llvmType: LLVMTypeRef, name: string) LLVMValueRef { }
	//! Returns the LLVMValueRef for the given expression, evaluated at the
	//! current state.builder location.
	fn getValue(exp: ir.Exp) LLVMValueRef { }
	//! Returns the value, making sure that the value is not in reference form,
	//! basically inserting load instructions where needed.
	fn getValue(exp: ir.Exp, result: Value) { }
	//! Returns the value in reference form, basically meaning that the return
	//! value is a pointer to where it is held in memory.
	fn getValueRef(exp: ir.Exp, result: Value) { }
	//! Returns the value, without doing any checking if it is in reference
	//! form or not.
	fn getValueAnyForm(exp: ir.Exp, result: Value);
	//! Returns the LLVMValueRef for the given constant expression, does not
	//! require that state.builder is set.
	fn getConstant(exp: ir.Exp) LLVMValueRef;
	//! Returns the value, without doing any checking if it is in reference
	//! form or not.
	fn getConstantValueAnyForm(exp: ir.Exp, result: Value);
	//! Makes a private mergable global constant. Used for strings, array
	//! literal and storage for struct literals.
	fn makeAnonGlobalConstant(t: LLVMTypeRef, val: LLVMValueRef) LLVMValueRef { }
	//! Return the LLVMValueRef for the given Function.
	fn getFunctionValue(func: 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;
	//! Builds a call instruction, and set the location for the call
	//! automatically.
	fn buildCallNeverInvoke(loc: Location, argFunc: LLVMValueRef, args: LLVMValueRef[]) LLVMValueRef;
	//! Builds either a call or a invoke. If invoke automatically sets up a
	//! catch basic block and sets the currentBlock to it.
	fn buildCallOrInvoke(loc: Location, func: LLVMValueRef, args: LLVMValueRef[]) LLVMValueRef;
	//! Builds either a call or a invoke. If invoke automatically sets up a
	//! catch basic block and sets the currentBlock to it.
	fn buildCallOrInvoke(loc: Location, func: LLVMValueRef, args: LLVMValueRef[], landingPad: LLVMBasicBlockRef) LLVMValueRef;
	//! Start using a new basic block, setting currentBlock.
	fn startBlock(b: LLVMBasicBlockRef) { }
	//! Helper function to swap out the currentContineBlock, returns the old
	//! one.
	fn replaceContinueBlock(b: LLVMBasicBlockRef) LLVMBasicBlockRef { }
	//! Helper function to swap out the currentBreakBlock, returns the old
	//! one.
	fn replaceBreakBlock(b: LLVMBasicBlockRef) LLVMBasicBlockRef { }
	//! Push a new Path, setting prev as needed.
	fn pushPath() { }
	//! Pop a PathState.
	fn popPath() { }
}

lib.llvm.c.TargetMachine

module lib.llvm.c.TargetMachine;


enum LLVMCodeGenOptLevel
{
	None,
	Less,
	Default,
	Aggressive,
}

enum LLVMRelocMode
{
	Default,
	Static,
	PIC,
	DynamicNoPic,
}

enum LLVMCodeModel
{
	Default,
	JITDefault,
	Small,
	Kernel,
	Medium,
	Large,
}

enum LLVMCodeGenFileType
{
	Assembly,
	Object,
}

alias LLVMTargetMachineRef = LLVMTargetMachine*;
alias LLVMTargetRef = LLVMTarget*;

struct LLVMTargetMachine
{
}

struct LLVMTarget
{
}

fn LLVMGetFirstTarget() LLVMTargetRef;
fn LLVMGetNextTarget(T: LLVMTargetRef) LLVMTargetRef;
fn LLVMGetTargetFromName(Name: const(char)*) LLVMTargetRef;
fn LLVMGetTargetFromTriple(Triple: const(char)*, T: LLVMTargetRef*, ErrorMessage: const(char)**) LLVMBool;
fn LLVMGetTargetName(T: LLVMTargetRef) const(char)*;
fn LLVMGetTargetDescription(T: LLVMTargetRef) const(char)*;
fn LLVMTargetHasJIT(T: LLVMTargetRef) LLVMBool;
fn LLVMTargetHasTargetMachine(T: LLVMTargetRef) LLVMBool;
fn LLVMTargetHasAsmBackend(T: LLVMTargetRef) LLVMBool;
fn LLVMCreateTargetMachine(T: LLVMTargetRef, Triple: const(char)*, CPU: const(char)*, Features: const(char)*, Level: LLVMCodeGenOptLevel, Reloc: LLVMRelocMode, CodeModel: LLVMCodeModel) LLVMTargetMachineRef;
fn LLVMDisposeTargetMachine(T: LLVMTargetMachineRef);
fn LLVMGetTargetMachineTarget(T: LLVMTargetMachineRef) LLVMTargetRef;
fn LLVMGetTargetMachineTriple(T: LLVMTargetMachineRef) const(char)*;
fn LLVMGetTargetMachineCPU(T: LLVMTargetMachineRef) const(char)*;
fn LLVMGetTargetMachineFeatureString(T: LLVMTargetMachineRef) const(char)*;
fn LLVMGetTargetMachineData(T: LLVMTargetMachineRef) LLVMTargetDataRef;
fn LLVMSetTargetMachineAsmVerbosity(T: LLVMTargetMachineRef, VerboseAsm: LLVMBool);
fn LLVMTargetMachineEmitToFile(T: LLVMTargetMachineRef, M: LLVMModuleRef, Filename: const(char)*, codegen: LLVMCodeGenFileType, ErrorMessage: const(char)**) LLVMBool;
fn LLVMTargetMachineEmitToMemoryBuffer(T: LLVMTargetMachineRef, M: LLVMModuleRef, codegen: LLVMCodeGenFileType, ErrorMessage: const(char)**, OutMemBuf: LLVMMemoryBufferRef*) LLVMBool;
fn LLVMGetDefaultTargetTriple() const(char)*;

volta.visitor

module volta.visitor;

public import volta.visitor.visitor;

volta.postparse.condremoval

//! Code that removes volt version constructs.
module volta.postparse.condremoval;


//! A pass that removes version and debug blocks, not static ifs.
class ConditionalRemoval : vi.NullVisitor
{
public:
	this(es: ErrorSink, ver: VersionSet) { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn enter(bs: ir.BlockStatement) Status { }
	fn enter(a: ir.Attribute) Status { }
	fn enter(c: ir.Condition) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn evaluate(condstat: ir.ConditionStatement, ret: ir.Node[]) bool { }
	fn evaluate(cond: ir.ConditionTopLevel, ret: ir.Node[]) bool { }
}

volta.postparse.attribremoval

//! Code that flattens volt attributes onto ir nodes.
module volta.postparse.attribremoval;


//! A pass that turns Attributes nodes into fields on to Functions, Classes
//! and the like.
class AttribRemoval : NullVisitor, Pass
{
public:
	struct ContextSink
	{
	public:
		enum MaxSize;


	public:
		alias Sink = void delegate(scope (SinkArg));
		alias SinkArg = scope (scope (T)[]);


	public:
		fn length() size_t { }
		fn sink(type: T) { }
		fn append(arr: scope (scope (T)[])) { }
		fn append(s: SinkStruct) { }
		fn popLast() T { }
		fn getLast() T { }
		fn get(i: size_t) T { }
		fn set(i: size_t, n: T) { }
		fn setLast(i: T) { }
		fn toSink(sink: Sink) { }
		fn toArray() T[] { }
		fn borrowUnsafe() T[] { }
		fn reset() { }
	}


public:
	target: TargetInfo;
	errSink: ErrorSink;


public:
	this(target: TargetInfo, errSink: ErrorSink) { }
	fn transform(m: ir.Module) { }
	fn transform(m: ir.Module, func: ir.Function, bs: ir.BlockStatement) { }
	fn close() { }
	fn enter(m: ir.Module) Status { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn enter(i: ir.Import) Status { }
	fn enter(func: ir.Function) Status { }
	fn enter(d: ir.Variable) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn enter(s: ir.Struct) Status { }
	fn enter(u: ir.Union) Status { }
	fn enter(c: ir.Class) Status { }
	fn enter(i: ir._Interface) Status { }
	fn enter(e: ir.Enum) Status { }
	fn enter(a: ir.Alias) Status { }
	fn leave(func: ir.Function) Status { }
	fn leave(s: ir.Struct) Status { }
	fn leave(u: ir.Union) Status { }
	fn leave(c: ir.Class) Status { }
	fn leave(i: ir._Interface) Status { }
	fn leave(m: ir.Module) Status { }
	fn enter(attr: ir.Attribute) Status { }
	fn leave(attr: ir.Attribute) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }


protected:
	//! Helper class.
	class Context
	{
	public:
		node: ir.Node;
		stack: AttributeSink;
		oldStack: AttributeSink;


	public:
		this(node: ir.Node) { }
	}


protected:
	mCtxStack: ContextSink;
	mAttrStack: AttributeSink;


protected:
	fn ctxTop() Context { }
	fn ctxPush(node: ir.Node, inherit: bool) { }
	fn ctxPop(node: ir.Node) { }
	fn attrTop() ir.Attribute { }
	fn attrPush(attr: ir.Attribute) { }
	fn attrPop(attr: ir.Attribute) { }
	fn attrPushDown() { }
	fn manipAttr(ns: NodeSink, attr: ir.Attribute) { }
	fn manip(nodes: ir.Node[]) ir.Node[] { }
	fn manip(ns: NodeSink, nodes: ir.Node[]) { }
	fn manip(ns: NodeSink, n: ir.Node) { }
}

//! Loops over all attributes and applies them.
fn applyAttributes(i: ir.Import, attrs: AttributeSink, errSink: ErrorSink) { }
//! Loops over all attributes and applies them.
fn applyAttributes(func: ir.Function, attrs: AttributeSink, errSink: ErrorSink, target: TargetInfo) { }
//! Loops over all attributes and applies them.
fn applyAttributes(ed: ir.EnumDeclaration, attrs: AttributeSink, errSink: ErrorSink) { }
//! Loops over all attributes and applies them.
fn applyAttributes(d: ir.Variable, attrs: AttributeSink, errSink: ErrorSink, target: TargetInfo) { }
//! Loops over all attributes and applies them.
fn applyAttributes(s: ir.Aggregate, attrs: AttributeSink, errSink: ErrorSink) { }
//! Loops over all attributes and applies them.
fn applyAttributes(i: ir._Interface, attrs: AttributeSink, errSink: ErrorSink) { }
//! Loops over all attributes and applies them.
fn applyAttributes(e: ir.Enum, attrs: AttributeSink, errSink: ErrorSink) { }
//! Loops over all attributes and applies them.
fn applyAttributes(a: ir.Alias, attrs: AttributeSink, errSink: ErrorSink) { }
//! Applies a single attribute.
fn applyAttribute(i: ir.Import, attr: ir.Attribute, errSink: ErrorSink) { }
//! Applies a single attribute.
fn applyAttribute(func: ir.Function, attr: ir.Attribute, errSink: ErrorSink, target: TargetInfo) { }
//! Applies a single attribute.
fn applyAttribute(ed: ir.EnumDeclaration, attr: ir.Attribute, errSink: ErrorSink) { }
//! Applies a single attribute.
fn applyAttribute(d: ir.Variable, attr: ir.Attribute, errSink: ErrorSink, target: TargetInfo) { }
//! Applies a single attribute.
fn applyAttribute(s: ir.Aggregate, attr: ir.Attribute, errSink: ErrorSink) { }
//! Applies a single attribute.
fn applyAttribute(i: ir._Interface, attr: ir.Attribute, errSink: ErrorSink) { }
//! Applies a single attribute.
fn applyAttribute(e: ir.Enum, attr: ir.Attribute, errSink: ErrorSink) { }
//! Applies a single attribute.
fn applyAttribute(a: ir.Alias, attr: ir.Attribute, errSink: ErrorSink) { }

volta.postparse.scopereplacer

//! Module containing the ScopeReplacer class.
module volta.postparse.scopereplacer;


//! Module containing the ScopeReplacer class.
class ScopeReplacer : NullVisitor, Pass
{
public:
	errSink: ErrorSink;


public:
	this(errSink: ErrorSink) { }
	fn transform(m: ir.Module) { }
	fn transform(m: ir.Module, func: ir.Function, bs: ir.BlockStatement) { }
	fn close() { }
	fn enter(ss: ir.ScopeStatement) Status { }
	fn leave(ss: ir.ScopeStatement) Status { }
	fn enter(rs: ir.ReturnStatement) Status { }
	fn enter(func: ir.Function) Status { }
	fn leave(func: ir.Function) Status { }
	fn leave(bs: ir.BlockStatement) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }


protected:
	mFuncStack: FunctionSink;
	mInScopeStatement: bool;


protected:
	fn funcTop() ir.Function { }
	fn funcPush(func: ir.Function) { }
	fn funcPop(func: ir.Function) { }
	fn handleTry(t: ir.TryStatement) ir.Node { }
	fn handleScope(ss: ir.ScopeStatement) ir.Function { }
	fn convertToFunction(kind: ir.ScopeKind, block: ir.BlockStatement, parent: ir.Function) ir.Function { }
}

volta.postparse.importresolver

//! Module containing the ImportResolver class.
module volta.postparse.importresolver;


alias GetMod = ir.Module delegate(ir.QualifiedName);

//! Resolves imports on a single module.
class ImportResolver : ScopeManager, Pass
{
public:
	this(errSink: ErrorSink, getMod: GetMod) { }
	fn transform(m: ir.Module) { }
	fn close() { }
	fn enter(i: ir.Import) Status { }
	//! Takes a import that maps the module to a symbol in the current scope.
	fn handleRebind(i: ir.Import) { }
	//! Handles a import with symbol aliases.
	fn handleAliases(i: ir.Import) { }
	//! Most common imports.
	fn handleRegularAndStatic(i: ir.Import) { }
	//! Used for adding in scopes from static imports
	fn buildOrReturnScope(parent: ir.Scope, node: ir.Node, name: string, lowPriority: bool) ir.Scope { }
}

lib.llvm.c.Core

module lib.llvm.c.Core;


enum LLVMAttribute
{
	ZExt,
	SExt,
	NoReturn,
	InReg,
	StructRet,
	NoUnwind,
	NoAlias,
	ByVal,
	Nest,
	ReadNone,
	ReadOnly,
	NoInline,
	AlwaysInline,
	OptimizeForSize,
	StackProtect,
	StackProtectReq,
	Alignment,
	NoCapture,
	NoRedZone,
	NoImplicitFloat,
	Naked,
	InlineHint,
	StackAlignment,
	ReturnsTwice,
	UWTable,
	NonLazyBind,
}

enum LLVMOpcode
{
	Ret,
	Br,
	Switch,
	IndirectBr,
	Invoke,
	Unreachable,
	Add,
	FAdd,
	Sub,
	FSub,
	Mul,
	FMul,
	UDiv,
	SDiv,
	FDiv,
	URem,
	SRem,
	FRem,
	Shl,
	LShr,
	AShr,
	And,
	Or,
	Xor,
	Alloca,
	Load,
	Store,
	GetElementPtr,
	Trunc,
	ZExt,
	SExt,
	FPToUI,
	FPToSI,
	UIToFP,
	SIToFP,
	FPTrunc,
	FPExt,
	PtrToInt,
	IntToPtr,
	BitCast,
	AddrSpaceCast,
	ICmp,
	FCmp,
	PHI,
	Call,
	Select,
	UserOp1,
	UserOp2,
	VAArg,
	ExtractElement,
	InsertElement,
	ShuffleVector,
	ExtractValue,
	InsertValue,
	Fence,
	AtomicCmpXchg,
	AtomicRMW,
	Resume,
	LandingPad,
	CleanupRet,
	CatchRet,
	CatchPad,
	CleanupPad,
	CatchSwitch,
}

enum LLVMTypeKind
{
	Void,
	Half,
	Float,
	Double,
	X86_FP80,
	FP128,
	PPC_FP128,
	Label,
	Integer,
	Function,
	Struct,
	Array,
	Pointer,
	Vector,
	Metadata,
	X86_MMX,
	Token,
}

enum LLVMLinkage
{
	External,
	AvailableExternally,
	LinkOnceAny,
	LinkOnceODR,
	LinkOnceODRAutoHide,
	WeakAny,
	WeakODR,
	Appending,
	Internal,
	Private,
	DLLImport,
	DLLExport,
	ExternalWeak,
	Ghost,
	Common,
	LinkerPrivate,
	LinkerPrivateWeak,
}

enum LLVMVisibility
{
	Default,
	Hidden,
	Protected,
}

enum LLVMDLLStorageClass
{
	Default,
	DLLImport,
	DLLExport,
}

enum LLVMCallConv
{
	C,
	Fast,
	Cold,
	WebKitJS,
	AnyReg,
	X86Stdcall,
	X86Fastcall,
	X86_64_Win64,
}

enum LLVMValueKind
{
	Argument,
	BasicBlock,
	MemoryUse,
	MemoryDef,
	MemoryPhi,
	Function,
	GlobalAlias,
	GlobalIFunc,
	GlobalVariable,
	BlockAddress,
	ConstantExpr,
	ConstantArray,
	ConstantStruct,
	ConstantVector,
	UndefValue,
	ConstantAggregateZero,
	ConstantDataArray,
	ConstantDataVector,
	ConstantInt,
	ConstantFP,
	ConstantPointerNull,
	ConstantTokenNone,
	MetadataAsValue,
	InlineAsm,
	Instruction,
}

enum LLVMIntPredicate
{
	EQ,
	NE,
	UGT,
	UGE,
	ULT,
	ULE,
	SGT,
	SGE,
	SLT,
	SLE,
}

enum LLVMRealPredicate
{
	PredicateFalse,
	OEQ,
	OGT,
	OGE,
	OLT,
	OLE,
	ONE,
	ORD,
	UNO,
	UEQ,
	UGT,
	UGE,
	ULT,
	ULE,
	UNE,
	PredicateTrue,
}

enum LLVMLandingPadClauseTy
{
	Catch,
	Filter,
}

enum LLVMThreadLocalMode
{
	NotThreadLocal,
	GeneralDynamic,
	LocalDynamic,
	InitialExec,
	LocalExec,
}

enum LLVMAtomicOrdering
{
	NotAtomic,
	Unordered,
	Monotonic,
	Acquire,
	Release,
	AcquireRelease,
	SequentiallyConsistent,
}

enum LLVMAtomicRMWBinOp
{
	RMWBinOpXchg,
	RMWBinOpAdd,
	RMWBinOpSub,
	RMWBinOpAnd,
	RMWBinOpNand,
	RMWBinOpOr,
	RMWBinOpXor,
	RMWBinOpMax,
	RMWBinOpMin,
	RMWBinOpUMax,
	RMWBinOpUMin,
}

enum LLVMDiagnosticSeverity
{
	Error,
	Warning,
	Remark,
	Note,
}

enum LLVMAttributeIndex
{
	Return,
	Function,
}

alias LLVMBool = i32;
alias LLVMContextRef = LLVMContext*;
alias LLVMModuleRef = LLVMModule*;
alias LLVMTypeRef = LLVMType*;
alias LLVMValueRef = LLVMValue*;
alias LLVMMetadataRef = LLVMMetadata*;
alias LLVMAttributeRef = LLVMAttributeImpl*;
alias LLVMBasicBlockRef = LLVMBasicBlock*;
alias LLVMBuilderRef = LLVMBuilder*;
alias LLVMDIBuilderRef = LLVMDIBuilder*;
alias LLVMModuleProviderRef = LLVMModuleProvider*;
alias LLVMMemoryBufferRef = LLVMMemoryBuffer*;
alias LLVMPassManagerRef = LLVMPassManager*;
alias LLVMPassRegistryRef = LLVMPassRegistry*;
alias LLVMUseRef = LLVMUse*;
alias LLVMDiagnosticInfoRef = LLVMDiagnosticInfo*;
alias LLVMDiagnosticHandler = fn (LLVMDiagnosticInfoRef, void*) (void);
alias LLVMYieldCallback = fn (LLVMContextRef, void*) (void);

struct LLVMContext
{
}

struct LLVMModule
{
}

struct LLVMType
{
}

struct LLVMValue
{
}

struct LLVMMetadata
{
}

struct LLVMAttributeImpl
{
}

struct LLVMBasicBlock
{
}

struct LLVMBuilder
{
}

struct LLVMDIBuilder
{
}

struct LLVMModuleProvider
{
}

struct LLVMMemoryBuffer
{
}

struct LLVMPassManager
{
}

struct LLVMPassRegistry
{
}

struct LLVMUse
{
}

struct LLVMDiagnosticInfo
{
}

fn LLVMInitializeCore(R: LLVMPassRegistryRef);
fn LLVMShutdown();
fn LLVMCreateMessage(Message: const(char)*) const(char)*;
fn LLVMDisposeMessage(Message: const(char)*);
fn LLVMContextCreate() LLVMContextRef;
fn LLVMGetGlobalContext() LLVMContextRef;
fn LLVMContextSetDiagnosticHandler(C: LLVMContextRef, Handler: LLVMDiagnosticHandler, DiagnosticContext: void*);
fn LLVMContextGetDiagnosticHandler(C: LLVMContextRef) LLVMDiagnosticHandler;
fn LLVMContextGetDiagnosticContext(C: LLVMContextRef) void*;
fn LLVMContextSetYieldCallback(C: LLVMContextRef, Callback: LLVMYieldCallback, OpaqueHandle: void*);
fn LLVMContextDispose(C: LLVMContextRef);
fn LLVMGetDiagInfoDescription(DI: LLVMDiagnosticInfoRef) char*;
fn LLVMGetDiagInfoSeverity(DI: LLVMDiagnosticInfoRef) LLVMDiagnosticSeverity;
fn LLVMGetMDKindIDInContext(C: LLVMContextRef, Name: const(char)*, SLen: u32) u32;
fn LLVMGetMDKindID(Name: const(char)*, SLen: u32) u32;
fn LLVMGetEnumAttributeKindForName(Name: const(char)*, SLen: size_t) u32;
fn LLVMGetLastEnumAttributeKind() u32;
fn LLVMCreateEnumAttribute(C: LLVMContextRef, KindID: u32, Val: u64) LLVMAttributeRef;
fn LLVMGetEnumAttributeKind(A: LLVMAttributeRef) u32;
fn LLVMGetEnumAttributeValue(A: LLVMAttributeRef) u64;
fn LLVMCreateStringAttribute(C: LLVMContextRef, K: const(char)*, KLength: u32, V: const(char)*, VLength: u32) LLVMAttributeRef;
fn LLVMGetStringAttributeKind(A: LLVMAttributeRef, Length: u32*) const(char)*;
fn LLVMGetStringAttributeValue(A: LLVMAttributeRef, Length: u32*) const(char)*;
fn LLVMIsEnumAttribute(A: LLVMAttributeRef) LLVMBool;
fn LLVMIsStringAttribute(A: LLVMAttributeRef) LLVMBool;
fn LLVMModuleCreateWithName(ModuleID: const(char)*) LLVMModuleRef;
fn LLVMModuleCreateWithNameInContext(ModuleID: const(char)*, C: LLVMContextRef) LLVMModuleRef;
fn LLVMCloneModule(M: LLVMModuleRef) LLVMModuleRef;
fn LLVMDisposeModule(M: LLVMModuleRef);
fn LLVMGetModuleIdentifier(M: LLVMModuleRef, Len: size_t*) const(char)*;
fn LLVMSetModuleIdentifier(M: LLVMModuleRef, Ident: const(char)*, Len: size_t);
fn LLVMGetDataLayoutStr(M: LLVMModuleRef) const(char)*;
fn LLVMGetDataLayout(M: LLVMModuleRef) const(char)*;
fn LLVMSetDataLayout(M: LLVMModuleRef, DataLayoutStr: const(char)*);
fn LLVMGetTarget(M: LLVMModuleRef) const(char)*;
fn LLVMSetTarget(M: LLVMModuleRef, Triple: const(char)*);
fn LLVMDumpModule(M: LLVMModuleRef);
fn LLVMPrintModuleToFile(M: LLVMModuleRef, Filename: const(char)*, ErrorMessage: const(char)**) LLVMBool;
fn LLVMPrintModuleToString(M: LLVMModuleRef) char*;
fn LLVMSetModuleInlineAsm(M: LLVMModuleRef, Asm: const(char)*);
fn LLVMGetModuleContext(M: LLVMModuleRef) LLVMContextRef;
fn LLVMGetTypeByName(M: LLVMModuleRef, Name: const(char)*) LLVMTypeRef;
fn LLVMGetNamedMetadataNumOperands(M: LLVMModuleRef, Name: const(char)*) u32;
fn LLVMGetNamedMetadataOperands(M: LLVMModuleRef, Name: const(char)*, Dest: LLVMValueRef*);
fn LLVMAddNamedMetadataOperand(M: LLVMModuleRef, Name: const(char)*, Val: LLVMValueRef);
fn LLVMAddFunction(M: LLVMModuleRef, Name: const(char)*, FunctionTy: LLVMTypeRef) LLVMValueRef;
fn LLVMGetNamedFunction(M: LLVMModuleRef, Name: const(char)*) LLVMValueRef;
fn LLVMGetFirstFunction(M: LLVMModuleRef) LLVMValueRef;
fn LLVMGetLastFunction(M: LLVMModuleRef) LLVMValueRef;
fn LLVMGetNextFunction(Fn: LLVMValueRef) LLVMValueRef;
fn LLVMGetPreviousFunction(Fn: LLVMValueRef) LLVMValueRef;
fn LLVMGetTypeKind(Ty: LLVMTypeRef) LLVMTypeKind;
fn LLVMTypeIsSized(Ty: LLVMTypeRef) LLVMBool;
fn LLVMGetTypeContext(Ty: LLVMTypeRef) LLVMContextRef;
fn LLVMDumpType(Val: LLVMTypeRef);
fn LLVMPrintTypeToString(Val: LLVMTypeRef) char*;
fn LLVMInt1TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMInt8TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMInt16TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMInt32TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMInt64TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMInt128TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMIntTypeInContext(C: LLVMContextRef, NumBits: u32) LLVMTypeRef;
fn LLVMInt1Type() LLVMTypeRef;
fn LLVMInt8Type() LLVMTypeRef;
fn LLVMInt16Type() LLVMTypeRef;
fn LLVMInt32Type() LLVMTypeRef;
fn LLVMInt64Type() LLVMTypeRef;
fn LLVMInt128Type() LLVMTypeRef;
fn LLVMIntType(NumBits: u32) LLVMTypeRef;
fn LLVMGetIntTypeWidth(IntegerTy: LLVMTypeRef) u32;
fn LLVMHalfTypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMFloatTypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMDoubleTypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMX86FP80TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMTokenTypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMFP128TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMPPCFP128TypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMHalfType() LLVMTypeRef;
fn LLVMFloatType() LLVMTypeRef;
fn LLVMDoubleType() LLVMTypeRef;
fn LLVMX86FP80Type() LLVMTypeRef;
fn LLVMFP128Type() LLVMTypeRef;
fn LLVMPPCFP128Type() LLVMTypeRef;
fn LLVMFunctionType(ReturnType: LLVMTypeRef, ParamTypes: LLVMTypeRef*, ParamCount: u32, IsVarArg: LLVMBool) LLVMTypeRef;
fn LLVMIsFunctionVarArg(FunctionTy: LLVMTypeRef) LLVMBool;
fn LLVMGetReturnType(FunctionTy: LLVMTypeRef) LLVMTypeRef;
fn LLVMCountParamTypes(FunctionTy: LLVMTypeRef) u32;
fn LLVMGetParamTypes(FunctionTy: LLVMTypeRef, Dest: LLVMTypeRef*);
fn LLVMStructTypeInContext(C: LLVMContextRef, ElementTypes: LLVMTypeRef*, ElementCount: u32, Packed: LLVMBool) LLVMTypeRef;
fn LLVMStructType(ElementTypes: LLVMTypeRef*, ElementCount: u32, Packed: LLVMBool) LLVMTypeRef;
fn LLVMStructCreateNamed(C: LLVMContextRef, Name: const(char)*) LLVMTypeRef;
fn LLVMGetStructName(Ty: LLVMTypeRef) const(char)*;
fn LLVMStructSetBody(StructTy: LLVMTypeRef, ElementTypes: LLVMTypeRef*, ElementCount: u32, Packed: LLVMBool);
fn LLVMCountStructElementTypes(StructTy: LLVMTypeRef) u32;
fn LLVMGetStructElementTypes(StructTy: LLVMTypeRef, Dest: LLVMTypeRef*);
fn LLVMStructGetTypeAtIndex(StructTy: LLVMTypeRef, i: u32) LLVMTypeRef;
fn LLVMIsPackedStruct(StructTy: LLVMTypeRef) LLVMBool;
fn LLVMIsOpaqueStruct(StructTy: LLVMTypeRef) LLVMBool;
fn LLVMGetElementType(Ty: LLVMTypeRef) LLVMTypeRef;
fn LLVMArrayType(ElementType: LLVMTypeRef, ElementCount: u32) LLVMTypeRef;
fn LLVMGetArrayLength(ArrayTy: LLVMTypeRef) u32;
fn LLVMPointerType(ElementType: LLVMTypeRef, AddressSpace: u32) LLVMTypeRef;
fn LLVMGetPointerAddressSpace(PointerTy: LLVMTypeRef) u32;
fn LLVMVectorType(ElementType: LLVMTypeRef, ElementCount: u32) LLVMTypeRef;
fn LLVMGetVectorSize(VectorTy: LLVMTypeRef) u32;
fn LLVMVoidTypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMLabelTypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMX86MMXTypeInContext(C: LLVMContextRef) LLVMTypeRef;
fn LLVMVoidType() LLVMTypeRef;
fn LLVMLabelType() LLVMTypeRef;
fn LLVMX86MMXType() LLVMTypeRef;
fn LLVMTypeOf(Val: LLVMValueRef) LLVMTypeRef;
fn LLVMGetValueKind(Val: LLVMValueRef) LLVMValueKind;
fn LLVMGetValueName(Val: LLVMValueRef) const(char)*;
fn LLVMSetValueName(Val: LLVMValueRef, Name: const(char)*);
fn LLVMDumpValue(Val: LLVMValueRef);
fn LLVMPrintValueToString(Val: LLVMValueRef) const(char)*;
fn LLVMReplaceAllUsesWith(OldVal: LLVMValueRef, NewVal: LLVMValueRef);
fn LLVMIsConstant(Val: LLVMValueRef) LLVMBool;
fn LLVMIsUndef(Val: LLVMValueRef) LLVMBool;
fn LLVMIsAMDNode(Val: LLVMValueRef) LLVMValueRef;
fn LLVMIsAMDString(Val: LLVMValueRef) LLVMValueRef;
fn LLVMGetFirstUse(Val: LLVMValueRef) LLVMUseRef;
fn LLVMGetNextUse(U: LLVMUseRef) LLVMUseRef;
fn LLVMGetUser(U: LLVMUseRef) LLVMValueRef;
fn LLVMGetUsedValue(U: LLVMUseRef) LLVMValueRef;
fn LLVMGetOperand(Val: LLVMValueRef, Index: u32) LLVMValueRef;
fn LLVMGetOperandUse(Val: LLVMValueRef, Index: u32) LLVMUseRef;
fn LLVMSetOperand(User: LLVMValueRef, Index: u32, Val: LLVMValueRef);
fn LLVMGetNumOperands(Val: LLVMValueRef) i32;
fn LLVMConstNull(Ty: LLVMTypeRef) LLVMValueRef;
fn LLVMConstAllOnes(Ty: LLVMTypeRef) LLVMValueRef;
fn LLVMGetUndef(Ty: LLVMTypeRef) LLVMValueRef;
fn LLVMIsNull(Val: LLVMValueRef) LLVMBool;
fn LLVMConstPointerNull(Ty: LLVMTypeRef) LLVMValueRef;
fn LLVMConstInt(IntTy: LLVMTypeRef, N: u64, SignExtend: LLVMBool) LLVMValueRef;
fn LLVMConstIntOfArbitraryPrecision(IntTy: LLVMTypeRef, NumWords: u32, Words: const(u64)*) LLVMValueRef;
fn LLVMConstIntOfString(IntTy: LLVMTypeRef, Text: const(char)*, Radix: u8) LLVMValueRef;
fn LLVMConstIntOfStringAndSize(IntTy: LLVMTypeRef, Text: const(char)*, SLen: u32, Radix: u8) LLVMValueRef;
fn LLVMConstReal(RealTy: LLVMTypeRef, N: f64) LLVMValueRef;
fn LLVMConstRealOfString(RealTy: LLVMTypeRef, Text: const(char)*) LLVMValueRef;
fn LLVMConstRealOfStringAndSize(RealTy: LLVMTypeRef, Text: const(char)*, SLen: u32) LLVMValueRef;
fn LLVMConstIntGetZExtValue(ConstantVal: LLVMValueRef) u64;
fn LLVMConstIntGetSExtValue(ConstantVal: LLVMValueRef) i64;
fn LLVMConstRealGetDouble(ConstantVal: LLVMValueRef, losesInfo: LLVMBool*) f64;
fn LLVMConstStringInContext(C: LLVMContextRef, Str: const(char)*, Length: u32, DontNullTerminate: LLVMBool) LLVMValueRef;
fn LLVMConstString(Str: const(char)*, Length: u32, DontNullTerminate: LLVMBool) LLVMValueRef;
fn LLVMIsConstantString(c: LLVMValueRef) LLVMBool;
fn LLVMGetAsString(c: LLVMValueRef, Length: size_t*) const(char)*;
fn LLVMConstStructInContext(C: LLVMContextRef, ConstantVals: LLVMValueRef*, Count: u32, Packed: LLVMBool) LLVMValueRef;
fn LLVMConstStruct(ConstantVals: LLVMValueRef*, Count: u32, Packed: LLVMBool) LLVMValueRef;
fn LLVMConstArray(ElementTy: LLVMTypeRef, ConstantVals: LLVMValueRef*, Length: u32) LLVMValueRef;
fn LLVMConstNamedStruct(StructTy: LLVMTypeRef, ConstantVals: LLVMValueRef*, Count: u32) LLVMValueRef;
fn LLVMGetElementAsConstant(C: LLVMValueRef, idx: u32) LLVMValueRef;
fn LLVMConstVector(ScalarConstantVals: LLVMValueRef*, Size: u32) LLVMValueRef;
fn LLVMGetConstOpcode(ConstantVal: LLVMValueRef) LLVMOpcode;
fn LLVMAlignOf(Ty: LLVMTypeRef) LLVMValueRef;
fn LLVMSizeOf(Ty: LLVMTypeRef) LLVMValueRef;
fn LLVMConstNeg(ConstantVal: LLVMValueRef) LLVMValueRef;
fn LLVMConstNSWNeg(ConstantVal: LLVMValueRef) LLVMValueRef;
fn LLVMConstNUWNeg(ConstantVal: LLVMValueRef) LLVMValueRef;
fn LLVMConstFNeg(ConstantVal: LLVMValueRef) LLVMValueRef;
fn LLVMConstNot(ConstantVal: LLVMValueRef) LLVMValueRef;
fn LLVMConstAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstNSWAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstNUWAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstFAdd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstNSWSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstNUWSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstFSub(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstNSWMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstNUWMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstFMul(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstUDiv(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstSDiv(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstExactSDiv(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstFDiv(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstURem(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstSRem(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstFRem(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstAnd(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstOr(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstXor(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstICmp(Predicate: LLVMIntPredicate, LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstFCmp(Predicate: LLVMRealPredicate, LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstShl(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstLShr(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstAShr(LHSConstant: LLVMValueRef, RHSConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstGEP(ConstantVal: LLVMValueRef, ConstantIndices: LLVMValueRef*, NumIndices: u32) LLVMValueRef;
fn LLVMConstInBoundsGEP(ConstantVal: LLVMValueRef, ConstantIndices: LLVMValueRef*, NumIndices: u32) LLVMValueRef;
fn LLVMConstTrunc(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstSExt(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstZExt(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstFPTrunc(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstFPExt(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstUIToFP(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstSIToFP(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstFPToUI(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstFPToSI(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstPtrToInt(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstIntToPtr(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstAddrSpaceCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstZExtOrBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstSExtOrBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstTruncOrBitCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstPointerCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstIntCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef, isSigned: LLVMBool) LLVMValueRef;
fn LLVMConstFPCast(ConstantVal: LLVMValueRef, ToType: LLVMTypeRef) LLVMValueRef;
fn LLVMConstSelect(ConstantCondition: LLVMValueRef, ConstantIfTrue: LLVMValueRef, ConstantIfFalse: LLVMValueRef) LLVMValueRef;
fn LLVMConstExtractElement(VectorConstant: LLVMValueRef, IndexConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstInsertElement(VectorConstant: LLVMValueRef, ElementValueConstant: LLVMValueRef, IndexConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstShuffleVector(VectorAConstant: LLVMValueRef, VectorBConstant: LLVMValueRef, MaskConstant: LLVMValueRef) LLVMValueRef;
fn LLVMConstExtractValue(AggConstant: LLVMValueRef, IdxList: u32*, NumIdx: u32) LLVMValueRef;
fn LLVMConstInsertValue(AggConstant: LLVMValueRef, ElementValueConstant: LLVMValueRef, IdxList: u32*, NumIdx: u32) LLVMValueRef;
fn LLVMConstInlineAsm(Ty: LLVMTypeRef, AsmString: const(char)*, Constraints: const(char)*, HasSideEffects: LLVMBool, IsAlignStack: LLVMBool) LLVMValueRef;
fn LLVMBlockAddress(F: LLVMValueRef, BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMGetGlobalParent(Global: LLVMValueRef) LLVMModuleRef;
fn LLVMIsDeclaration(Global: LLVMValueRef) LLVMBool;
fn LLVMGetLinkage(Global: LLVMValueRef) LLVMLinkage;
fn LLVMSetLinkage(Global: LLVMValueRef, Linkage: LLVMLinkage);
fn LLVMGetSection(Global: LLVMValueRef) const(char)*;
fn LLVMSetSection(Global: LLVMValueRef, Section: const(char)*);
fn LLVMGetVisibility(Global: LLVMValueRef) LLVMVisibility;
fn LLVMSetVisibility(Global: LLVMValueRef, Viz: LLVMVisibility);
fn LLVMGetDLLStorageClass(Global: LLVMValueRef) LLVMDLLStorageClass;
fn LLVMSetDLLStorageClass(Global: LLVMValueRef, Class: LLVMDLLStorageClass);
fn LLVMHasUnnamedAddr(Global: LLVMValueRef) LLVMBool;
fn LLVMSetUnnamedAddr(Global: LLVMValueRef, HasUnnamedAddr: LLVMBool);
fn LLVMGetAlignment(V: LLVMValueRef) u32;
fn LLVMSetAlignment(V: LLVMValueRef, Bytes: u32);
fn LLVMAddGlobal(M: LLVMModuleRef, Ty: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMAddGlobalInAddressSpace(M: LLVMModuleRef, Ty: LLVMTypeRef, Name: const(char)*, AddressSpace: u32) LLVMValueRef;
fn LLVMGetNamedGlobal(M: LLVMModuleRef, Name: const(char)*) LLVMValueRef;
fn LLVMGetFirstGlobal(M: LLVMModuleRef) LLVMValueRef;
fn LLVMGetLastGlobal(M: LLVMModuleRef) LLVMValueRef;
fn LLVMGetNextGlobal(GlobalVar: LLVMValueRef) LLVMValueRef;
fn LLVMGetPreviousGlobal(GlobalVar: LLVMValueRef) LLVMValueRef;
fn LLVMDeleteGlobal(GlobalVar: LLVMValueRef);
fn LLVMGetInitializer(GlobalVar: LLVMValueRef) LLVMValueRef;
fn LLVMSetInitializer(GlobalVar: LLVMValueRef, ConstantVal: LLVMValueRef);
fn LLVMIsThreadLocal(GlobalVar: LLVMValueRef) LLVMBool;
fn LLVMSetThreadLocal(GlobalVar: LLVMValueRef, IsThreadLocal: LLVMBool);
fn LLVMIsGlobalConstant(GlobalVar: LLVMValueRef) LLVMBool;
fn LLVMSetGlobalConstant(GlobalVar: LLVMValueRef, IsConstant: LLVMBool);
fn LLVMGetThreadLocalMode(GlobalVar: LLVMValueRef) LLVMThreadLocalMode;
fn LLVMSetThreadLocalMode(GlobalVar: LLVMValueRef, Mode: LLVMThreadLocalMode);
fn LLVMIsExternallyInitialized(GlobalVar: LLVMValueRef) LLVMBool;
fn LLVMSetExternallyInitialized(GlobalVar: LLVMValueRef, IsExtInit: LLVMBool);
fn LLVMAddAlias(M: LLVMModuleRef, Ty: LLVMTypeRef, Aliasee: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMDeleteFunction(Fn: LLVMValueRef);
fn LLVMHasPersonalityFn(Fn: LLVMValueRef) LLVMBool;
fn LLVMGetPersonalityFn(Fn: LLVMValueRef) LLVMValueRef;
fn LLVMSetPersonalityFn(Fn: LLVMValueRef, PersonalityFn: LLVMValueRef);
fn LLVMGetIntrinsicID(Fn: LLVMValueRef) u32;
fn LLVMGetFunctionCallConv(Fn: LLVMValueRef) u32;
fn LLVMSetFunctionCallConv(Fn: LLVMValueRef, CC: u32);
fn LLVMGetGC(Fn: LLVMValueRef) const(char)*;
fn LLVMSetGC(Fn: LLVMValueRef, Name: const(char)*);
fn LLVMAddFunctionAttr(Fn: LLVMValueRef, PA: LLVMAttribute);
fn LLVMAddAttributeAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, A: LLVMAttributeRef);
fn LLVMGetAttributeCountAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex) u32;
fn LLVMGetAttributesAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, Attrs: LLVMAttributeRef*);
fn LLVMGetEnumAttributeAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, KindID: u32) LLVMAttributeRef;
fn LLVMGetStringAttributeAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, K: const(char)*, KLen: u32) LLVMAttributeRef;
fn LLVMRemoveEnumAttributeAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, KindID: u32);
fn LLVMRemoveStringAttributeAtIndex(F: LLVMValueRef, Idx: LLVMAttributeIndex, K: const(char)*, KLen: u32);
fn LLVMAddTargetDependentFunctionAttr(Fn: LLVMValueRef, A: const(char)*, V: const(char)*);
fn LLVMGetFunctionAttr(Fn: LLVMValueRef) LLVMAttribute;
fn LLVMRemoveFunctionAttr(Fn: LLVMValueRef, PA: LLVMAttribute);
fn LLVMCountParams(Fn: LLVMValueRef) u32;
fn LLVMGetParams(Fn: LLVMValueRef, Params: LLVMValueRef*);
fn LLVMGetParam(Fn: LLVMValueRef, Index: u32) LLVMValueRef;
fn LLVMGetParamParent(Inst: LLVMValueRef) LLVMValueRef;
fn LLVMGetFirstParam(Fn: LLVMValueRef) LLVMValueRef;
fn LLVMGetLastParam(Fn: LLVMValueRef) LLVMValueRef;
fn LLVMGetNextParam(Arg: LLVMValueRef) LLVMValueRef;
fn LLVMGetPreviousParam(Arg: LLVMValueRef) LLVMValueRef;
fn LLVMAddAttribute(Arg: LLVMValueRef, PA: LLVMAttribute);
fn LLVMRemoveAttribute(Arg: LLVMValueRef, PA: LLVMAttribute);
fn LLVMGetAttribute(Arg: LLVMValueRef) LLVMAttribute;
fn LLVMSetParamAlignment(Arg: LLVMValueRef, Align: u32);
fn LLVMMDStringInContext(C: LLVMContextRef, Str: const(char)*, SLen: u32) LLVMValueRef;
fn LLVMMDString(Str: const(char)*, SLen: u32) LLVMValueRef;
fn LLVMMDNodeInContext(C: LLVMContextRef, Vals: LLVMValueRef*, Count: u32) LLVMValueRef;
fn LLVMMDNode(Vals: LLVMValueRef*, Count: u32) LLVMValueRef;
fn LLVMMetadataAsValue(C: LLVMContextRef, MD: LLVMMetadataRef) LLVMValueRef;
fn LLVMValueAsMetadata(Val: LLVMValueRef) LLVMMetadataRef;
fn LLVMGetMDString(V: LLVMValueRef, Length: u32*) const(char)*;
fn LLVMGetMDNodeNumOperands(V: LLVMValueRef) u32;
fn LLVMGetMDNodeOperands(V: LLVMValueRef, Dest: LLVMValueRef*);
fn LLVMBasicBlockAsValue(BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMValueIsBasicBlock(Val: LLVMValueRef) LLVMBool;
fn LLVMValueAsBasicBlock(Val: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMGetBasicBlockName(BB: LLVMBasicBlockRef) const(char)*;
fn LLVMGetBasicBlockParent(BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMGetBasicBlockTerminator(BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMCountBasicBlocks(Fn: LLVMValueRef) u32;
fn LLVMGetBasicBlocks(Fn: LLVMValueRef, BasicBlocks: LLVMBasicBlockRef*);
fn LLVMGetFirstBasicBlock(Fn: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMGetLastBasicBlock(Fn: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMGetNextBasicBlock(BB: LLVMBasicBlockRef) LLVMBasicBlockRef;
fn LLVMGetPreviousBasicBlock(BB: LLVMBasicBlockRef) LLVMBasicBlockRef;
fn LLVMGetEntryBasicBlock(Fn: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMAppendBasicBlockInContext(C: LLVMContextRef, Fn: LLVMValueRef, Name: const(char)*) LLVMBasicBlockRef;
fn LLVMAppendBasicBlock(Fn: LLVMValueRef, Name: const(char)*) LLVMBasicBlockRef;
fn LLVMInsertBasicBlockInContext(C: LLVMContextRef, BB: LLVMBasicBlockRef, Name: const(char)*) LLVMBasicBlockRef;
fn LLVMInsertBasicBlock(InsertBeforeBB: LLVMBasicBlockRef, Name: const(char)*) LLVMBasicBlockRef;
fn LLVMDeleteBasicBlock(BB: LLVMBasicBlockRef);
fn LLVMRemoveBasicBlockFromParent(BB: LLVMBasicBlockRef);
fn LLVMMoveBasicBlockBefore(BB: LLVMBasicBlockRef, MovePos: LLVMBasicBlockRef);
fn LLVMMoveBasicBlockAfter(BB: LLVMBasicBlockRef, MovePos: LLVMBasicBlockRef);
fn LLVMGetFirstInstruction(BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMGetLastInstruction(BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMHasMetadata(Val: LLVMValueRef) i32;
fn LLVMGetMetadata(Val: LLVMValueRef, KindID: u32) LLVMValueRef;
fn LLVMSetMetadata(Val: LLVMValueRef, KindID: u32, Node: LLVMValueRef);
fn LLVMGetInstructionParent(Inst: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMGetNextInstruction(Inst: LLVMValueRef) LLVMValueRef;
fn LLVMGetPreviousInstruction(Inst: LLVMValueRef) LLVMValueRef;
fn LLVMInstructionRemoveFromParent(Inst: LLVMValueRef);
fn LLVMInstructionEraseFromParent(Inst: LLVMValueRef);
fn LLVMGetInstructionOpcode(Inst: LLVMValueRef) LLVMOpcode;
fn LLVMGetICmpPredicate(Inst: LLVMValueRef) LLVMIntPredicate;
fn LLVMGetFCmpPredicate(Inst: LLVMValueRef) LLVMRealPredicate;
fn LLVMInstructionClone(Inst: LLVMValueRef) LLVMValueRef;
fn LLVMGetNumArgOperands(Instr: LLVMValueRef) u32;
fn LLVMSetInstructionCallConv(Instr: LLVMValueRef, CC: u32);
fn LLVMGetInstructionCallConv(Instr: LLVMValueRef) u32;
fn LLVMAddInstrAttribute(Instr: LLVMValueRef, index: u32, LLVMAttribute);
fn LLVMRemoveInstrAttribute(Instr: LLVMValueRef, index: u32, LLVMAttribute);
fn LLVMSetInstrParamAlignment(Instr: LLVMValueRef, index: u32, Align: u32);
fn LLVMAddCallSiteAttribute(C: LLVMValueRef, Idx: LLVMAttributeIndex, A: LLVMAttributeRef);
fn LLVMGetCallSiteAttributeCount(C: LLVMValueRef, Idx: LLVMAttributeIndex) u32;
fn LLVMGetCallSiteAttributes(C: LLVMValueRef, Idx: LLVMAttributeIndex, Attrs: LLVMAttributeRef*);
fn LLVMGetCallSiteEnumAttribute(C: LLVMValueRef, Idx: LLVMAttributeIndex, KindID: u32) LLVMAttributeRef;
fn LLVMGetCallSiteStringAttribute(C: LLVMValueRef, Idx: LLVMAttributeIndex, K: const(char)*, KLen: u32) LLVMAttributeRef;
fn LLVMRemoveCallSiteEnumAttribute(C: LLVMValueRef, Idx: LLVMAttributeIndex, KindID: u32);
fn LLVMRemoveCallSiteStringAttribute(C: LLVMValueRef, Idx: LLVMAttributeIndex, K: const(char)*, KLen: u32);
fn LLVMGetCalledValue(Instr: LLVMValueRef) LLVMValueRef;
fn LLVMIsTailCall(CallInst: LLVMValueRef) LLVMBool;
fn LLVMSetTailCall(CallInst: LLVMValueRef, IsTailCall: LLVMBool);
fn LLVMGetNormalDest(InvokeInst: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMGetUnwindDest(InvokeInst: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMSetNormalDest(InvokeInst: LLVMValueRef, B: LLVMBasicBlockRef);
fn LLVMSetUnwindDest(InvokeInst: LLVMValueRef, B: LLVMBasicBlockRef);
fn LLVMGetNumSuccessors(Term: LLVMValueRef) u32;
fn LLVMGetSuccessor(Term: LLVMValueRef, i: u32) LLVMBasicBlockRef;
fn LLVMSetSuccessor(Term: LLVMValueRef, i: u32, block: LLVMBasicBlockRef);
fn LLVMIsConditional(Branch: LLVMValueRef) LLVMBool;
fn LLVMGetCondition(Branch: LLVMValueRef) LLVMValueRef;
fn LLVMSetCondition(Branch: LLVMValueRef, Cond: LLVMValueRef);
fn LLVMGetSwitchDefaultDest(SwitchInstr: LLVMValueRef) LLVMBasicBlockRef;
fn LLVMGetAllocatedType(Alloca: LLVMValueRef) LLVMTypeRef;
fn LLVMIsInBounds(GEP: LLVMValueRef) LLVMBool;
fn LLVMSetIsInBounds(GEP: LLVMValueRef, InBounds: LLVMBool);
fn LLVMAddIncoming(PhiNode: LLVMValueRef, IncomingValues: LLVMValueRef*, IncomingBlocks: LLVMBasicBlockRef*, Count: u32);
fn LLVMCountIncoming(PhiNode: LLVMValueRef) u32;
fn LLVMGetIncomingValue(PhiNode: LLVMValueRef, Index: u32) LLVMValueRef;
fn LLVMGetIncomingBlock(PhiNode: LLVMValueRef, Index: u32) LLVMBasicBlockRef;
fn LLVMGetNumIndices(Inst: LLVMValueRef) u32;
fn LLVMGetIndices(Inst: LLVMValueRef) const(u32)*;
fn LLVMCreateBuilderInContext(C: LLVMContextRef) LLVMBuilderRef;
fn LLVMCreateBuilder() LLVMBuilderRef;
fn LLVMPositionBuilder(Builder: LLVMBuilderRef, Block: LLVMBasicBlockRef, Instr: LLVMValueRef);
fn LLVMPositionBuilderBefore(Builder: LLVMBuilderRef, Instr: LLVMValueRef);
fn LLVMPositionBuilderAtEnd(Builder: LLVMBuilderRef, Block: LLVMBasicBlockRef);
fn LLVMGetInsertBlock(Builder: LLVMBuilderRef) LLVMBasicBlockRef;
fn LLVMClearInsertionPosition(Builder: LLVMBuilderRef);
fn LLVMInsertIntoBuilder(Builder: LLVMBuilderRef, Instr: LLVMValueRef);
fn LLVMInsertIntoBuilderWithName(Builder: LLVMBuilderRef, Instr: LLVMValueRef, Name: const(char)*);
fn LLVMDisposeBuilder(Builder: LLVMBuilderRef);
fn LLVMSetCurrentDebugLocation(Builder: LLVMBuilderRef, L: LLVMValueRef);
fn LLVMGetCurrentDebugLocation(Builder: LLVMBuilderRef) LLVMValueRef;
fn LLVMSetInstDebugLocation(Builder: LLVMBuilderRef, Inst: LLVMValueRef);
fn LLVMBuildRetVoid(LLVMBuilderRef) LLVMValueRef;
fn LLVMBuildRet(LLVMBuilderRef, V: LLVMValueRef) LLVMValueRef;
fn LLVMBuildAggregateRet(LLVMBuilderRef, RetVals: LLVMValueRef*, N: u32) LLVMValueRef;
fn LLVMBuildBr(LLVMBuilderRef, Dest: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMBuildCondBr(LLVMBuilderRef, If: LLVMValueRef, Then: LLVMBasicBlockRef, Else: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMBuildSwitch(LLVMBuilderRef, V: LLVMValueRef, Else: LLVMBasicBlockRef, NumCases: u32) LLVMValueRef;
fn LLVMBuildIndirectBr(B: LLVMBuilderRef, Addr: LLVMValueRef, NumDests: u32) LLVMValueRef;
fn LLVMBuildInvoke(LLVMBuilderRef, Fn: LLVMValueRef, Args: LLVMValueRef*, NumArgs: u32, Then: LLVMBasicBlockRef, Catch: LLVMBasicBlockRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildLandingPad(B: LLVMBuilderRef, Ty: LLVMTypeRef, PersFn: LLVMValueRef, NumClauses: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildCleanupRet(B: LLVMBuilderRef, CatchPad: LLVMValueRef, BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMBuildCatchRet(B: LLVMBuilderRef, CatchPad: LLVMValueRef, BB: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMBuildCatchPad(B: LLVMBuilderRef, ParentPad: LLVMValueRef, Args: LLVMValueRef*, NumArgs: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildCleanupPad(B: LLVMBuilderRef, ParentPad: LLVMValueRef, Args: LLVMValueRef*, NumArgs: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildCatchSwitch(B: LLVMBuilderRef, ParentPad: LLVMValueRef, UnwindBB: LLVMBasicBlockRef, NumHandlers: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildResume(B: LLVMBuilderRef, Exn: LLVMValueRef) LLVMValueRef;
fn LLVMBuildUnreachable(LLVMBuilderRef) LLVMValueRef;
fn LLVMAddCase(Switch: LLVMValueRef, OnVal: LLVMValueRef, Dest: LLVMBasicBlockRef);
fn LLVMAddDestination(IndirectBr: LLVMValueRef, Dest: LLVMBasicBlockRef);
fn LLVMGetNumClauses(LandingPad: LLVMValueRef) u32;
fn LLVMGetClause(LandingPad: LLVMValueRef, Idx: u32) LLVMValueRef;
fn LLVMAddClause(LandingPad: LLVMValueRef, ClauseVal: LLVMValueRef);
fn LLVMIsCleanup(LandingPad: LLVMValueRef) LLVMBool;
fn LLVMSetCleanup(LandingPad: LLVMValueRef, Val: LLVMBool);
fn LLVMAddHandler(CatchSwitch: LLVMValueRef, Dest: LLVMBasicBlockRef);
fn LLVMGetNumHandlers(CatchSwitch: LLVMValueRef) u32;
fn LLVMGetHandlers(CatchSwitch: LLVMValueRef, Handlers: LLVMBasicBlockRef*);
fn LLVMGetArgOperand(Funclet: LLVMValueRef, i: u32) LLVMValueRef;
fn LLVMSetArgOperand(Funclet: LLVMValueRef, i: u32, value: LLVMValueRef);
fn LLVMGetParentCatchSwitch(CatchPad: LLVMValueRef) LLVMValueRef;
fn LLVMSetParentCatchSwitch(CatchPad: LLVMValueRef, CatchSwitch: LLVMValueRef);
fn LLVMBuildAdd(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNSWAdd(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNUWAdd(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFAdd(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildSub(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNSWSub(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNUWSub(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFSub(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildMul(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNSWMul(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNUWMul(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFMul(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildUDiv(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildSDiv(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildExactSDiv(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFDiv(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildURem(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildSRem(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFRem(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildShl(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildLShr(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildAShr(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildAnd(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildOr(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildXor(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildBinOp(B: LLVMBuilderRef, Op: LLVMOpcode, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNeg(LLVMBuilderRef, V: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNSWNeg(B: LLVMBuilderRef, V: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNUWNeg(B: LLVMBuilderRef, V: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFNeg(LLVMBuilderRef, V: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildNot(LLVMBuilderRef, V: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildMalloc(LLVMBuilderRef, Ty: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildArrayMalloc(LLVMBuilderRef, Ty: LLVMTypeRef, Val: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildAlloca(LLVMBuilderRef, Ty: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildArrayAlloca(LLVMBuilderRef, Ty: LLVMTypeRef, Val: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFree(LLVMBuilderRef, PointerVal: LLVMValueRef) LLVMValueRef;
fn LLVMBuildLoad(LLVMBuilderRef, PointerVal: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildStore(LLVMBuilderRef, Val: LLVMValueRef, Ptr: LLVMValueRef) LLVMValueRef;
fn LLVMBuildGEP(B: LLVMBuilderRef, Pointer: LLVMValueRef, Indices: LLVMValueRef*, NumIndices: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildInBoundsGEP(B: LLVMBuilderRef, Pointer: LLVMValueRef, Indices: LLVMValueRef*, NumIndices: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildStructGEP(B: LLVMBuilderRef, Pointer: LLVMValueRef, Idx: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildGlobalString(B: LLVMBuilderRef, Str: const(char)*, Name: const(char)*) LLVMValueRef;
fn LLVMBuildGlobalStringPtr(B: LLVMBuilderRef, Str: const(char)*, Name: const(char)*) LLVMValueRef;
fn LLVMGetVolatile(MemoryAccessInst: LLVMValueRef) LLVMBool;
fn LLVMSetVolatile(MemoryAccessInst: LLVMValueRef, IsVolatile: LLVMBool);
fn LLVMGetOrdering(MemoryAccessInst: LLVMValueRef) LLVMAtomicOrdering;
fn LLVMSetOrdering(MemoryAccessInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
fn LLVMBuildTrunc(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildZExt(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildSExt(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFPToUI(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFPToSI(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildUIToFP(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildSIToFP(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFPTrunc(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFPExt(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildPtrToInt(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildIntToPtr(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildBitCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildAddrSpaceCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildZExtOrBitCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildSExtOrBitCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildTruncOrBitCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildCast(B: LLVMBuilderRef, Op: LLVMOpcode, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildPointerCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildIntCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFPCast(LLVMBuilderRef, Val: LLVMValueRef, DestTy: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildICmp(LLVMBuilderRef, Op: LLVMIntPredicate, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFCmp(LLVMBuilderRef, Op: LLVMRealPredicate, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildPhi(LLVMBuilderRef, Ty: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildCall(LLVMBuilderRef, Fn: LLVMValueRef, Args: LLVMValueRef*, NumArgs: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildSelect(LLVMBuilderRef, If: LLVMValueRef, Then: LLVMValueRef, Else: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildVAArg(LLVMBuilderRef, List: LLVMValueRef, Ty: LLVMTypeRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildExtractElement(LLVMBuilderRef, VecVal: LLVMValueRef, Index: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildInsertElement(LLVMBuilderRef, VecVal: LLVMValueRef, EltVal: LLVMValueRef, Index: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildShuffleVector(LLVMBuilderRef, V1: LLVMValueRef, V2: LLVMValueRef, Mask: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildExtractValue(LLVMBuilderRef, AggVal: LLVMValueRef, Index: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildInsertValue(LLVMBuilderRef, AggVal: LLVMValueRef, EltVal: LLVMValueRef, Index: u32, Name: const(char)*) LLVMValueRef;
fn LLVMBuildIsNull(LLVMBuilderRef, Val: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildIsNotNull(LLVMBuilderRef, Val: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildPtrDiff(LLVMBuilderRef, LHS: LLVMValueRef, RHS: LLVMValueRef, Name: const(char)*) LLVMValueRef;
fn LLVMBuildFence(B: LLVMBuilderRef, ordering: LLVMAtomicOrdering, singleThread: LLVMBool, Name: const(char)*) LLVMValueRef;
fn LLVMBuildAtomicRMW(B: LLVMBuilderRef, op: LLVMAtomicRMWBinOp, PTR: LLVMValueRef, Val: LLVMValueRef, ordering: LLVMAtomicOrdering, singleThread: LLVMBool) LLVMValueRef;
fn LLVMBuildAtomicCmpXchg(B: LLVMBuilderRef, Ptr: LLVMValueRef, Cmp: LLVMValueRef, New: LLVMValueRef, SuccessOrdering: LLVMAtomicOrdering, FailureOrdering: LLVMAtomicOrdering, SingleThread: LLVMBool) LLVMValueRef;
fn LLVMIsAtomicSingleThread(AtomicInst: LLVMValueRef) LLVMBool;
fn LLVMSetAtomicSingleThread(AtomicInst: LLVMValueRef, SingleThread: LLVMBool);
fn LLVMGetCmpXchgSuccessOrdering(CmpXchgInst: LLVMValueRef) LLVMAtomicOrdering;
fn LLVMSetCmpXchgSuccessOrdering(CmpXchgInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
fn LLVMGetCmpXchgFailureOrdering(CmpXchgInst: LLVMValueRef) LLVMAtomicOrdering;
fn LLVMSetCmpXchgFailureOrdering(CmpXchgInst: LLVMValueRef, Ordering: LLVMAtomicOrdering);
fn LLVMCreateModuleProviderForExistingModule(M: LLVMModuleRef) LLVMModuleProviderRef;
fn LLVMDisposeModuleProvider(M: LLVMModuleProviderRef);
fn LLVMCreateMemoryBufferWithContentsOfFile(Path: const(char)*, OutMemBuf: LLVMMemoryBufferRef*, OutMessage: const(char)**) LLVMBool;
fn LLVMCreateMemoryBufferWithSTDIN(OutMemBuf: LLVMMemoryBufferRef*, OutMessage: const(char)**) LLVMBool;
fn LLVMCreateMemoryBufferWithMemoryRange(InputData: const(char)*, InputDataLength: size_t, BufferName: const(char)*, RequiresNullTerminator: LLVMBool) LLVMMemoryBufferRef;
fn LLVMCreateMemoryBufferWithMemoryRangeCopy(InputData: const(char)*, InputDataLength: size_t, BufferName: const(char)*) LLVMMemoryBufferRef;
fn LLVMGetBufferStart(MemBuf: LLVMMemoryBufferRef) const(char)*;
fn LLVMGetBufferSize(MemBuf: LLVMMemoryBufferRef) size_t;
fn LLVMDisposeMemoryBuffer(MemBuf: LLVMMemoryBufferRef);
fn LLVMGetGlobalPassRegistry() LLVMPassRegistryRef;
fn LLVMCreatePassManager() LLVMPassManagerRef;
fn LLVMCreateFunctionPassManagerForModule(M: LLVMModuleRef) LLVMPassManagerRef;
fn LLVMCreateFunctionPassManager(MP: LLVMModuleProviderRef) LLVMPassManagerRef;
fn LLVMRunPassManager(PM: LLVMPassManagerRef, M: LLVMModuleRef) LLVMBool;
fn LLVMInitializeFunctionPassManager(FPM: LLVMPassManagerRef) LLVMBool;
fn LLVMRunFunctionPassManager(FPM: LLVMPassManagerRef, F: LLVMValueRef) LLVMBool;
fn LLVMFinalizeFunctionPassManager(FPM: LLVMPassManagerRef) LLVMBool;
fn LLVMDisposePassManager(PM: LLVMPassManagerRef);
fn LLVMStartMultithreaded() LLVMBool;
fn LLVMStopMultithreaded();
fn LLVMIsMultithreaded() LLVMBool;

lib.llvm.c.BitWriter

module lib.llvm.c.BitWriter;


fn LLVMWriteBitcodeToFile(M: LLVMModuleRef, Path: const(char)*) i32;
fn LLVMWriteBitcodeToFD(M: LLVMModuleRef, FD: i32, ShouldClose: i32, Unbuffered: i32) i32;
fn LLVMWriteBitcodeToFileHandle(M: LLVMModuleRef, Handle: i32) i32;

volta.parser.expression

module volta.parser.expression;


class ExpOrOp
{
public:
	exp: intir.UnaryExp;
	op: ir.BinOp.Op;
	bin: ir.BinOp;


public:
	this(exp: intir.UnaryExp) { }
	this(op: ir.BinOp.Op) { }
	fn isExp() bool { }
}

fn parseExp(ps: ParserStream, exp: ir.Exp) ParseStatus { }
fn assignToExp(ps: ParserStream, assign: intir.AssignExp, exp: ir.Exp) ParseStatus { }
fn ternaryToExp(ps: ParserStream, tern: intir.TernaryExp, exp: ir.Exp) ParseStatus { }
fn gatherExps(bin: intir.BinExp) ExpOrOp[] { }
fn binexpToExp(ps: ParserStream, bin: intir.BinExp, exp: ir.Exp) ParseStatus { }
fn unaryToExp(ps: ParserStream, unary: intir.UnaryExp, exp: ir.Exp) ParseStatus { }
fn postfixToExp(ps: ParserStream, loc: const(Location), exp: ir.Exp, postfix: intir.PostfixExp, seed: ir.Exp) ParseStatus { }
fn primaryToExp(ps: ParserStream, primary: intir.PrimaryExp, exp: ir.Exp) ParseStatus { }
fn parseArgumentList(ps: ParserStream, outexps: ir.Exp[], endChar: TokenType) ParseStatus { }
fn parseIsExp(ps: ParserStream, ie: ir.IsExp) ParseStatus { }
fn parseFunctionLiteral(ps: ParserStream, fl: ir.FunctionLiteral) ParseStatus { }
//! ugly intir stuff ***
fn parseAssignExp(ps: ParserStream, exp: intir.AssignExp) ParseStatus { }
fn parseTernaryExp(ps: ParserStream, exp: intir.TernaryExp) ParseStatus { }
fn parseBinExp(ps: ParserStream, exp: intir.BinExp) ParseStatus { }
fn parseUnaryExp(ps: ParserStream, exp: intir.UnaryExp) ParseStatus { }
fn getLastSlice(pe: intir.PostfixExp) intir.PostfixExp { }
fn parseNewOrDup(ps: ParserStream, exp: intir.UnaryExp) ParseStatus { }
fn parseDupExp(ps: ParserStream, doubleDotDepth: i32, dupExp: intir.DupExp) ParseStatus { }
fn parseNewExp(ps: ParserStream, newExp: intir.NewExp) ParseStatus { }
fn parseCastExp(ps: ParserStream, exp: intir.CastExp) ParseStatus { }
fn parsePostfixExp(ps: ParserStream, exp: intir.PostfixExp, disableNoDoubleDotSlice: bool, depth: i32) ParseStatus { }
fn parsePrimaryExp(ps: ParserStream, exp: intir.PrimaryExp) ParseStatus { }
fn parseVaArgExp(ps: ParserStream, vaexp: ir.VaArgExp) ParseStatus { }
fn parseRunExp(ps: ParserStream, runexp: ir.RunExp) ParseStatus { }
//! Parse a volt expression in slice into exp.
fn parseInlineExp(loc: const(Location), ps: ParserStream, slice: string, exp: ir.Exp) ParseStatus { }
//! Parse a composable string expression.
fn parseComposableString(ps: ParserStream, exp: ir.Exp) ParseStatus { }
fn isComposableString(ps: ParserStream) bool { }
fn isUnambiguouslyParenType(ps: ParserStream) bool { }
fn isFunctionLiteral(ps: ParserStream) bool { }

volt.semantic.templatelifter

module volt.semantic.templatelifter;


class TemplateLifter : Lifter
{
public:
	currentTemplateDefinitionName: string;
	currentInstanceType: ir.Type;


public:
	this() { }
	fn lift(old: ir.TopLevelBlock) ir.TopLevelBlock { }
	fn lift(old: ir.Function) ir.Function { }
	fn liftInPlace(old: ir.Function, f: ir.Function) { }
	fn lift(old: ir.FunctionParam) ir.FunctionParam { }
	fn lift(n: ir.Variable) ir.Variable { }
	fn lift(old: ir.Import) ir.Import { }
	fn lift(old: ir.Module) ir.Module { }
	fn lift(old: ir.Aggregate) ir.Aggregate { }
	fn lift(old: ir.Enum) ir.Enum { }
	fn lift(en: ir.Enum, old: ir.EnumDeclaration) ir.EnumDeclaration { }
	fn lift(old: ir.Alias) ir.Alias { }
	fn lift(old: ir.Struct) ir.Struct { }
	fn lift(old: ir.Union) ir.Union { }
	fn lift(old: ir.Class) ir.Class { }
	fn lift(old: ir._Interface) ir._Interface { }
	fn liftedOrPanic(node: ir.Node, msg: string) ir.Node { }
	fn copy(parent: ir.Scope, old: ir.BlockStatement) ir.BlockStatement { }
	fn copy(old: ir.FunctionType) ir.FunctionType { }
	fn copy(old: ir.TypeReference) ir.TypeReference { }
	fn templateLift(_current: ir.Scope, lp: LanguagePass, ti: ir.TemplateInstance) { }
	fn templateLiftFunction(_current: ir.Scope, lp: LanguagePass, ti: ir.TemplateInstance) { }
	fn templateLiftAggregate(_current: ir.Scope, lp: LanguagePass, ti: ir.TemplateInstance) { }
}

volta.parser.templates

module volta.parser.templates;


//! Returns: true if ps is at a template instantiation, false otherwise.
fn isTemplateInstance(ps: ParserStream) bool { }
//! Returns: true if ps is at a template definition, false otherwise.
fn isTemplateDefinition(ps: ParserStream) bool { }
//! Returns: true if the stream is at a point where we know it's a type,
//! false otherwise.
fn isUnambigouslyType(ps: ParserStream) bool { }
fn parseLegacyTemplateInstance(ps: ParserStream, ti: ir.TemplateInstance) ParseStatus { }
fn parseTemplateInstance(ps: ParserStream, ti: ir.TemplateInstance) ParseStatus { }
fn parseTemplateDefinition(ps: ParserStream, td: ir.TemplateDefinition) ParseStatus { }

lib.llvm.c.BitReader

module lib.llvm.c.BitReader;


fn LLVMParseBitcode(MemBuf: LLVMMemoryBufferRef, OutModule: LLVMModuleRef*, OutMessage: const(char)**) LLVMBool;
fn LLVMParseBitcodeInContext(ContextRef: LLVMContextRef, MemBuf: LLVMMemoryBufferRef, OutModule: LLVMModuleRef*, OutMessage: const(char)**) LLVMBool;
fn LLVMGetBitcodeModuleInContext(ContextRef: LLVMContextRef, MemBuf: LLVMMemoryBufferRef, OutM: LLVMModuleRef*, OutMessage: const(char)**) LLVMBool;
fn LLVMGetBitcodeModule(MemBuf: LLVMMemoryBufferRef, OutM: LLVMModuleRef*, OutMessage: const(char)**) LLVMBool;
fn LLVMGetBitcodeModuleProviderInContext(ContextRef: LLVMContextRef, MemBuf: LLVMMemoryBufferRef, OutMP: LLVMModuleProviderRef*, OutMessage: const(char)**) LLVMBool;
fn LLVMGetBitcodeModuleProvider(MemBuf: LLVMMemoryBufferRef, OutMP: LLVMModuleProviderRef*, OutMessage: const(char)**) LLVMBool;

lib.llvm.c.ExecutionEngine

module lib.llvm.c.ExecutionEngine;


alias LLVMGenericValueRef = LLVMGenericValue*;
alias LLVMExecutionEngineRef = LLVMExecutionEngine*;
alias LLVMMCJITMemoryManagerRef = LLVMMCJITMemoryManager*;
alias LLVMMemoryManagerAllocateCodeSectionCallback = fn (void*, uintptr_t, u32, u32, const(char)*) (uint8_t);
alias LLVMMemoryManagerAllocateDataSectionCallback = fn (void*, uintptr_t, u32, u32, const(char)*, LLVMBool) (uint8_t);
alias LLVMMemoryManagerFinalizeMemoryCallback = fn (void*, char**) (LLVMBool);
alias LLVMMemoryManagerDestroyCallback = fn (void*) (void);

struct LLVMGenericValue
{
}

struct LLVMExecutionEngine
{
}

struct LLVMMCJITMemoryManager
{
}

struct LLVMMCJITCompilerOptions
{
public:
	OptLevel: u32;
	CodeModel: LLVMCodeModel;
	NoFramePointerElim: LLVMBool;
	EnableFastISel: LLVMBool;
	MCJMM: LLVMMCJITMemoryManagerRef;
}

fn LLVMLinkInMCJIT();
fn LLVMLinkInInterpreter();
fn LLVMCreateGenericValueOfInt(Ty: LLVMTypeRef, N: u64, IsSigned: LLVMBool) LLVMGenericValueRef;
fn LLVMCreateGenericValueOfPointer(P: void*) LLVMGenericValueRef;
fn LLVMCreateGenericValueOfFloat(Ty: LLVMTypeRef, N: f64) LLVMGenericValueRef;
fn LLVMGenericValueIntWidth(GenValRef: LLVMGenericValueRef) u32;
fn LLVMGenericValueToInt(GenVal: LLVMGenericValueRef, IsSigned: LLVMBool) u64;
fn LLVMGenericValueToPointer(GenVal: LLVMGenericValueRef) void*;
fn LLVMGenericValueToFloat(TyRef: LLVMTypeRef, GenVal: LLVMGenericValueRef) f64;
fn LLVMDisposeGenericValue(GenVal: LLVMGenericValueRef);
fn LLVMCreateExecutionEngineForModule(OutEE: LLVMExecutionEngineRef*, M: LLVMModuleRef, OutError: const(const(char)*)*) LLVMBool;
fn LLVMInitializeMCJITCompilerOptions(Options: LLVMMCJITCompilerOptions*, SizeOfOptions: size_t);
fn LLVMCreateMCJITCompilerForModule(OutJIT: LLVMExecutionEngineRef*, M: LLVMModuleRef, Options: LLVMMCJITCompilerOptions*, SizeOfOptions: size_t, OutError: const(const(char)*)*) LLVMBool;
fn LLVMDisposeExecutionEngine(EE: LLVMExecutionEngineRef);
fn LLVMRunStaticConstructors(EE: LLVMExecutionEngineRef);
fn LLVMRunStaticDestructors(EE: LLVMExecutionEngineRef);
fn LLVMRunFunctionAsMain(EE: LLVMExecutionEngineRef, F: LLVMValueRef, ArgC: u32, ArgV: const(const(char)*)*, EnvP: const(const(char)*)*) i32;
fn LLVMRunFunction(EE: LLVMExecutionEngineRef, F: LLVMValueRef, NumArgs: u32, Args: LLVMGenericValueRef*) LLVMGenericValueRef;
fn LLVMFreeMachineCodeForFunction(EE: LLVMExecutionEngineRef, F: LLVMValueRef);
fn LLVMAddModule(EE: LLVMExecutionEngineRef, M: LLVMModuleRef);
fn LLVMRemoveModule(EE: LLVMExecutionEngineRef, M: LLVMModuleRef, OutMod: LLVMModuleRef*, OutError: const(const(char)*)*) LLVMBool;
fn LLVMFindFunction(EE: LLVMExecutionEngineRef, Name: const(char)*, OutFn: LLVMValueRef*) LLVMBool;
fn LLVMRecompileAndRelinkFunction(EE: LLVMExecutionEngineRef, Fn: LLVMValueRef) void*;
fn LLVMGetExecutionEngineTargetData(EE: LLVMExecutionEngineRef) LLVMTargetDataRef;
fn LLVMGetExecutionEngineTargetMachine(EE: LLVMExecutionEngineRef) LLVMTargetMachineRef;
fn LLVMAddGlobalMapping(EE: LLVMExecutionEngineRef, Global: LLVMValueRef, Addr: void*);
fn LLVMGetPointerToGlobal(EE: LLVMExecutionEngineRef, Global: LLVMValueRef) void*;
fn LLVMGetGlobalValueAddress(EE: LLVMExecutionEngineRef, Name: const(char)*) uint64_t;
fn LLVMGetFunctionAddress(EE: LLVMExecutionEngineRef, Name: const(char)*) uint64_t;
fn LLVMCreateSimpleMCJITMemoryManager(Opaque: void*, AllocateCodeSection: LLVMMemoryManagerAllocateCodeSectionCallback, AllocateDataSection: LLVMMemoryManagerAllocateDataSectionCallback, FinalizeMemory: LLVMMemoryManagerFinalizeMemoryCallback, Destroy: LLVMMemoryManagerDestroyCallback) LLVMMCJITMemoryManagerRef;
fn LLVMDisposeMCJITMemoryManager(MM: LLVMMCJITMemoryManagerRef);

volt.llvm.abi.base

//! Perform ABI modifications to functions and function calls, if needed.
module volt.llvm.abi.base;


enum NotCoerced;
enum Coerced;

alias CoercedStatus = bool;

//! If the target platform and this function needs it, modify to match the
//! ABI.
fn abiCoerceParameters(state: State, ft: ir.FunctionType, retType: LLVMTypeRef, params: LLVMTypeRef[]) { }
//! If the parameters for the given function were modified, modify the
//! call to match.
fn abiCoerceArguments(state: State, ct: ir.CallableType, params: LLVMValueRef[]) { }
//! Coerce the prologue section of the function.
fn abiCoercePrologueParameter(state: State, llvmFunc: LLVMValueRef, func: ir.Function, ct: ir.CallableType, val: LLVMValueRef, index: size_t, offset: size_t) CoercedStatus { }
fn buildGep(state: State, ptr: LLVMValueRef, a: u64, b: u64) LLVMValueRef { }

volt.llvm.common

//! Common code generation code.
module volt.llvm.common;


//! Returns true if the C calling convention returns structs via
//! arguments.
fn shouldCUseStructRet(target: TargetInfo, irStruct: ir.Struct) bool { }
//! Turns a ArrayType Value into a Pointer Value. Value must be of type
//! ArrayType.
fn getPointerFromArray(state: State, loc: const(Location), result: Value) { }
//! Turns a StaticArrayType Value into a Pointer Value. Value must be of
//! type StaticArrayType.
fn getPointerFromStaticArray(state: State, loc: const(Location), result: Value) { }
//! Turns a StaticArrayType Value into a Array Value. Value must be of type
//! StaticArrayType.
fn getArrayFromStaticArray(state: State, loc: const(Location), result: Value) { }
//! Return the field from a aggregate at the given index.
fn getFieldFromAggregate(state: State, loc: const(Location), left: Value, index: u32, resultType: Type, result: Value) { }
//! Returns a member of aggregate type in value form. Note only value form.
fn getValueFromAggregate(state: State, loc: const(Location), left: Value, index: u32) LLVMValueRef { }
fn makeArrayValue(state: State, loc: Location, at: ArrayType, ptr: LLVMValueRef, len: LLVMValueRef, result: Value) { }
fn makeDelegateValue(state: State, loc: const(Location), dt: DelegateType, voidPtr: LLVMValueRef, funcPtr: LLVMValueRef, result: Value) { }
//! Common handle functions for both inline and constants.
fn handleConstant(state: State, asConst: ir.Constant, result: Value) { }
//! Common handle functions for both inline and constants.
fn handleArrayLiteral(state: State, al: ir.ArrayLiteral, result: Value) { }
//! Common handle functions for both inline and constants.
fn handleStructLiteral(state: State, sl: ir.StructLiteral, result: Value) { }
//! Common handle functions for both inline and constants.
fn handleUnionLiteral(state: State, ul: ir.UnionLiteral, result: Value) { }
//! Common handle functions for both inline and constants.
fn handleClassLiteral(state: State, cl: ir.ClassLiteral, result: Value) { }

volta.parser.intir

module volta.parser.intir;


class IntExp
{
public:
	loc: Location;


public:
	this() { }
}

class AssignExp : IntExp
{
public:
	op: BinOp.Op;
	left: TernaryExp;
	right: AssignExp;
	taggedRef: bool;
	taggedOut: bool;


public:
	this() { }
}

class TernaryExp : IntExp
{
public:
	isTernary: bool;
	condition: BinExp;
	ifTrue: TernaryExp;
	ifFalse: TernaryExp;


public:
	this() { }
}

class BinExp : IntExp
{
public:
	op: BinOp.Op;
	left: UnaryExp;
	right: BinExp;


public:
	this() { }
}

class UnaryExp : IntExp
{
public:
	op: Unary.Op;
	unaryExp: UnaryExp;
	postExp: PostfixExp;
	newExp: NewExp;
	castExp: CastExp;
	dupExp: DupExp;
	runExp: RunExp;


public:
	this() { }
}

class NewExp : IntExp
{
public:
	type: Type;
	isArray: bool;
	exp: TernaryExp;
	hasArgumentList: bool;
	argumentList: AssignExp[];
	argumentLabels: string[];


public:
	this() { }
}

class DupExp : IntExp
{
public:
	name: PostfixExp;
	beginning: AssignExp;
	end: AssignExp;
	shorthand: bool;


public:
	this() { }
}

class CastExp : IntExp
{
public:
	type: Type;
	unaryExp: UnaryExp;


public:
	this() { }
}

class PostfixExp : IntExp
{
public:
	op: Postfix.Op;
	primary: PrimaryExp;
	postfix: PostfixExp;
	arguments: AssignExp[];
	labels: string[];
	identifier: Identifier;
	templateInstance: Exp;


public:
	this() { }
}

class PrimaryExp : IntExp
{
public:
	enum Type
	{
		Identifier,
		DotIdentifier,
		This,
		Super,
		Null,
		True,
		False,
		Dollar,
		IntegerLiteral,
		FloatLiteral,
		CharLiteral,
		StringLiteral,
		ArrayLiteral,
		AssocArrayLiteral,
		FunctionLiteral,
		Assert,
		Import,
		Type,
		Typeof,
		Typeid,
		Is,
		ParenExp,
		StructLiteral,
		TemplateInstance,
		FunctionName,
		PrettyFunctionName,
		File,
		Line,
		Location,
		VaArg,
		ComposableString,
	}


public:
	op: Type;
	type: Type;
	exp: Exp;
	_string: string;
	keys: AssignExp[];
	arguments: AssignExp[];
	tlargs: AssignExp[];
	isExp: IsExp;
	functionLiteral: FunctionLiteral;
	vaexp: VaArgExp;


public:
	this() { }
}

fn isLeftAssociative(operator: BinOp.Op) bool { }
fn getPrecedence(operator: BinOp.Op) i32 { }

volt.llvm.abi.sysvamd64

//! Provides a solution for implementing structs passed by value.
module volt.llvm.abi.sysvamd64;


enum AMD64_SYSV_INTEGER_REGISTERS;
enum AMD64_SYSV_FLOAT_REGISTERS;
enum AMD64_SYSV_MAX_COERCIBLE_SZ;
enum AMD64_SYSV_WORD_SZ;
enum AMD64_SYSV_HALFWORD_SZ;
enum NOT_FLOAT;
enum ONE_FLOAT;
enum TWO_FLOATS;
enum ONE_DOUBLE;

enum Classification
{
	Memory,
	Integer,
	Float,
	CoercedStructSingle,
	CoercedStructDouble,
}

fn sysvAmd64AbiCoerceParameters(state: State, ft: ir.FunctionType, retType: LLVMTypeRef, params: LLVMTypeRef[]) { }
fn consumeRegisters(state: State, types: LLVMTypeRef[], integerRegisters: i32, floatRegisters: i32) { }
fn classifyType(state: State, type: LLVMTypeRef, structTypes: LLVMTypeRef[]) Classification { }
fn classifyStructType(state: State, type: LLVMTypeRef, structTypes: LLVMTypeRef[]) Classification { }
fn sysvAmd64AbiCoerceArguments(state: State, ct: ir.CallableType, args: LLVMValueRef[]) { }
fn sysvAmd64AbiCoercePrologueParameter(state: State, llvmFunc: LLVMValueRef, func: ir.Function, ct: ir.CallableType, val: LLVMValueRef, index: size_t, offset: size_t) CoercedStatus { }

volt.llvm.abi.winamd64

//! Windows AMD64 ABI Implementation.
module volt.llvm.abi.winamd64;


fn winAmd64AbiCoerceParameters(state: State, ft: ir.FunctionType, retType: LLVMTypeRef, params: LLVMTypeRef[]) { }
fn winAmd64AbiCoerceArguments(state: State, ct: ir.CallableType, args: LLVMValueRef[]) { }
fn winAmd64AbiPrologueParameter(state: State, llvmFunc: LLVMValueRef, func: ir.Function, ct: ir.CallableType, val: LLVMValueRef, index: size_t, offset: size_t) CoercedStatus { }

volt.llvm.debugInfo

//! Debug info generation code.
module volt.llvm.debugInfo;


fn diCreateDIBuilder(mod: LLVMModuleRef) LLVMDIBuilderRef { }
fn diDisposeDIBuilder(LLVMDIBuilderRef) { }
fn diSetPosition(state: State, loc: Location) { }
fn diUnsetPosition(state: State) { }
fn diCompileUnit(state: State) LLVMMetadataRef { }
fn diFinalize(state: State) { }
fn diUnspecifiedType(state: State, t: Type) LLVMMetadataRef { }
fn diBaseType(state: State, pt: ir.PrimitiveType) LLVMMetadataRef { }
fn diPointerType(state: State, pt: ir.PointerType, base: Type) LLVMMetadataRef { }
fn diStaticArrayType(state: State, sat: ir.StaticArrayType, type: Type) LLVMMetadataRef { }
fn diForwardDeclareAggregate(state: State, t: ir.Type) LLVMMetadataRef { }
fn diUnionReplace(state: State, diType: LLVMMetadataRef, p: Type, elms: ir.Variable[]) { }
fn diStructReplace(state: State, diType: LLVMMetadataRef, irType: ir.Type, elms: ir.Variable[]) { }
fn diStructReplace(state: State, diType: LLVMMetadataRef, p: Type, t: Type[2], names: string[2]) { }
fn diFunctionType(state: State, ret: Type, args: Type[], mangledName: string, diCallType: LLVMMetadataRef) LLVMMetadataRef { }
fn diFunction(state: State, irFn: ir.Function, func: LLVMValueRef, ft: FunctionType) LLVMMetadataRef { }
fn diGlobalVariable(state: State, var: ir.Variable, type: Type, val: LLVMValueRef) { }
fn diLocalVariable(state: State, var: ir.Variable, type: Type, val: LLVMValueRef) { }
fn diParameterVariable(state: State, var: ir.FunctionParam, type: Type, val: LLVMValueRef) { }

lib.llvm.c.DebugInfo

module lib.llvm.c.DebugInfo;


enum LLVMDIFlags
{
	Zero,
	Private,
	Protected,
	Public,
	FwdDecl,
	AppleBlock,
	BlockByrefStruct,
	Virtual,
	Artificial,
	Explicit,
	Prototyped,
	ObjcClassComplete,
	ObjectPointer,
	Vector,
	StaticMember,
	LValueReference,
	RValueReference,
	Reserved,
	SingleInheritance,
	MultipleInheritance,
	VirtualInheritance,
	IntroducedVirtual,
	BitField,
	NoReturn,
	MainSubprogram,
	TypePassByValue,
	TypePassByReference,
	FixedEnum,
	Thunk,
	Trivial,
	BigEndian,
	LittleEndian,
	IndirectVirtualBase,
	Accessibility,
	PtrToMemberRep,
}

enum LLVMDWARFSourceLanguage
{
	C89,
	C,
	Ada83,
	C_plus_plus,
	Cobol74,
	Cobol85,
	Fortran77,
	Fortran90,
	Pascal83,
	Modula2,
	Java,
	C99,
	Ada95,
	Fortran95,
	PLI,
	ObjC,
	ObjC_plus_plus,
	UPC,
	D,
	Python,
	OpenCL,
	Go,
	Modula3,
	Haskell,
	C_plus_plus_03,
	C_plus_plus_11,
	OCaml,
	Rust,
	C11,
	Swift,
	Julia,
	Dylan,
	C_plus_plus_14,
	Fortran03,
	Fortran08,
	RenderScript,
	BLISS,
	Mips_Assembler,
	GOOGLE_RenderScript,
	BORLAND_Delphi,
}

enum LLVMDWARFEmissionKind
{
	None,
	Full,
	LineTablesOnly,
}

alias LLVMDWARFTypeEncoding = u32;

fn LLVMDebugMetadataVersion() u32;
fn LLVMGetModuleDebugMetadataVersion(Module: LLVMModuleRef) u32;
fn LLVMStripModuleDebugInfo(Module: LLVMModuleRef) LLVMBool;
fn LLVMCreateDIBuilderDisallowUnresolved(M: LLVMModuleRef) LLVMDIBuilderRef;
fn LLVMCreateDIBuilder(M: LLVMModuleRef) LLVMDIBuilderRef;
fn LLVMDisposeDIBuilder(Builder: LLVMDIBuilderRef);
fn LLVMDIBuilderFinalize(Builder: LLVMDIBuilderRef);
fn LLVMDIBuilderCreateCompileUnit(Builder: LLVMDIBuilderRef, Lang: LLVMDWARFSourceLanguage, FileRef: LLVMMetadataRef, Producer: const(char)*, ProducerLen: size_t, isOptimized: LLVMBool, Flags: const(char)*, FlagsLen: size_t, RuntimeVer: u32, SplitName: const(char)*, SplitNameLen: size_t, Kind: LLVMDWARFEmissionKind, DWOId: u32, SplitDebugInlining: LLVMBool, DebugInfoForProfiling: LLVMBool) LLVMMetadataRef;
fn LLVMDIBuilderCreateFile(Builder: LLVMDIBuilderRef, Filename: const(char)*, FilenameLen: size_t, Directory: const(char)*, DirectoryLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateModule(Builder: LLVMDIBuilderRef, ParentScope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, ConfigMacros: const(char)*, ConfigMacrosLen: size_t, IncludePath: const(char)*, IncludePathLen: size_t, ISysRoot: const(char)*, ISysRootLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateNameSpace(Builder: LLVMDIBuilderRef, ParentScope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, ExportSymbols: LLVMBool) LLVMMetadataRef;
fn LLVMDIBuilderCreateFunction(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, LinkageName: const(char)*, LinkageNameLen: size_t, File: LLVMMetadataRef, LineNo: u32, Ty: LLVMMetadataRef, IsLocalToUnit: LLVMBool, IsDefinition: LLVMBool, ScopeLine: u32, Flags: LLVMDIFlags, IsOptimized: LLVMBool) LLVMMetadataRef;
fn LLVMDIBuilderCreateLexicalBlock(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, File: LLVMMetadataRef, Line: u32, Column: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateLexicalBlockFile(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, File: LLVMMetadataRef, Discriminator: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateImportedModuleFromNamespace(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, NS: LLVMMetadataRef, File: LLVMMetadataRef, Line: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateImportedModuleFromAlias(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, ImportedEntity: LLVMMetadataRef, File: LLVMMetadataRef, Line: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateImportedModuleFromModule(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, M: LLVMMetadataRef, File: LLVMMetadataRef, Line: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateImportedDeclaration(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Decl: LLVMMetadataRef, File: LLVMMetadataRef, Line: u32, Name: const(char)*, NameLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateDebugLocation(Ctx: LLVMContextRef, Line: u32, Column: u32, Scope: LLVMMetadataRef, InlinedAt: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDILocationGetLine(Location: LLVMMetadataRef) u32;
fn LLVMDILocationGetColumn(Location: LLVMMetadataRef) u32;
fn LLVMDILocationGetScope(Location: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderGetOrCreateTypeArray(Builder: LLVMDIBuilderRef, Data: LLVMMetadataRef*, NumElements: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateSubroutineType(Builder: LLVMDIBuilderRef, File: LLVMMetadataRef, ParameterTypes: LLVMMetadataRef*, NumParameterTypes: u32, Flags: LLVMDIFlags) LLVMMetadataRef;
fn LLVMDIBuilderCreateEnumerationType(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNumber: u32, SizeInBits: u64, AlignInBits: u32, Elements: LLVMMetadataRef*, NumElements: u32, ClassTy: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateUnionType(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNumber: u32, SizeInBits: u64, AlignInBits: u32, Flags: LLVMDIFlags, Elements: LLVMMetadataRef*, NumElements: u32, RunTimeLang: u32, UniqueId: const(char)*, UniqueIdLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateArrayType(Builder: LLVMDIBuilderRef, Size: u64, AlignInBits: u32, Ty: LLVMMetadataRef, Subscripts: LLVMMetadataRef*, NumSubscripts: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateVectorType(Builder: LLVMDIBuilderRef, Size: u64, AlignInBits: u32, Ty: LLVMMetadataRef, Subscripts: LLVMMetadataRef*, NumSubscripts: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateUnspecifiedType(Builder: LLVMDIBuilderRef, Name: const(char)*, NameLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateBasicType(Builder: LLVMDIBuilderRef, Name: const(char)*, NameLen: size_t, SizeInBits: u64, Encoding: LLVMDWARFTypeEncoding, Flags: LLVMDIFlags) LLVMMetadataRef;
fn LLVMDIBuilderCreatePointerType(Builder: LLVMDIBuilderRef, PointeeTy: LLVMMetadataRef, SizeInBits: u64, AlignInBits: u32, AddressSpace: u32, Name: const(char)*, NameLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateStructType(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNumber: u32, SizeInBits: u64, AlignInBits: u32, Flags: LLVMDIFlags, DerivedFrom: LLVMMetadataRef, Elements: LLVMMetadataRef*, NumElements: u32, RunTimeLang: u32, VTableHolder: LLVMMetadataRef, UniqueId: const(char)*, UniqueIdLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateMemberType(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNo: u32, SizeInBits: u64, AlignInBits: u32, OffsetInBits: u64, Flags: LLVMDIFlags, Ty: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateStaticMemberType(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNumber: u32, Type: LLVMMetadataRef, Flags: LLVMDIFlags, ConstantVal: LLVMValueRef, AlignInBits: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateMemberPointerType(Builder: LLVMDIBuilderRef, PointeeType: LLVMMetadataRef, ClassType: LLVMMetadataRef, SizeInBits: u64, AlignInBits: u32, Flags: LLVMDIFlags) LLVMMetadataRef;
fn LLVMDIBuilderCreateObjCIVar(Builder: LLVMDIBuilderRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNo: u32, SizeInBits: u64, AlignInBits: u32, OffsetInBits: u64, Flags: LLVMDIFlags, Ty: LLVMMetadataRef, PropertyNode: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateObjCProperty(Builder: LLVMDIBuilderRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNo: u32, GetterName: const(char)*, GetterNameLen: size_t, SetterName: const(char)*, SetterNameLen: size_t, PropertyAttributes: u32, Ty: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateObjectPointerType(Builder: LLVMDIBuilderRef, Type: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateQualifiedType(Builder: LLVMDIBuilderRef, Tag: u32, Type: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateReferenceType(Builder: LLVMDIBuilderRef, Tag: u32, Type: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateNullPtrType(Builder: LLVMDIBuilderRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateTypedef(Builder: LLVMDIBuilderRef, Type: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNo: u32, Scope: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateInheritance(Builder: LLVMDIBuilderRef, Ty: LLVMMetadataRef, BaseTy: LLVMMetadataRef, BaseOffset: u64, VBPtrOffset: u32, Flags: LLVMDIFlags) LLVMMetadataRef;
fn LLVMDIBuilderCreateForwardDecl(Builder: LLVMDIBuilderRef, Tag: u32, Name: const(char)*, NameLen: size_t, Scope: LLVMMetadataRef, File: LLVMMetadataRef, Line: u32, RuntimeLang: u32, SizeInBits: u64, AlignInBits: u32, UniqueIdentifier: const(char)*, UniqueIdentifierLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateReplaceableCompositeType(Builder: LLVMDIBuilderRef, Tag: u32, Name: const(char)*, NameLen: size_t, Scope: LLVMMetadataRef, File: LLVMMetadataRef, Line: u32, RuntimeLang: u32, SizeInBits: u64, AlignInBits: u32, Flags: LLVMDIFlags, UniqueIdentifier: const(char)*, UniqueIdentifierLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateBitFieldMemberType(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNumber: u32, SizeInBits: u64, OffsetInBits: u64, StorageOffsetInBits: u64, Flags: LLVMDIFlags, Type: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDIBuilderCreateClassType(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNumber: u32, SizeInBits: u64, AlignInBits: u32, OffsetInBits: u64, Flags: LLVMDIFlags, DerivedFrom: LLVMMetadataRef, Elements: LLVMMetadataRef*, NumElements: u32, VTableHolder: LLVMMetadataRef, TemplateParamsNode: LLVMMetadataRef, UniqueIdentifier: const(char)*, UniqueIdentifierLen: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateArtificialType(Builder: LLVMDIBuilderRef, Type: LLVMMetadataRef) LLVMMetadataRef;
fn LLVMDITypeGetName(DType: LLVMMetadataRef, Length: size_t*) const(char)*;
fn LLVMDITypeGetSizeInBits(DType: LLVMMetadataRef) u64;
fn LLVMDITypeGetOffsetInBits(DType: LLVMMetadataRef) u64;
fn LLVMDITypeGetAlignInBits(DType: LLVMMetadataRef) u32;
fn LLVMDITypeGetLine(DType: LLVMMetadataRef) u32;
fn LLVMDITypeGetFlags(DType: LLVMMetadataRef) LLVMDIFlags;
fn LLVMDIBuilderGetOrCreateSubrange(Builder: LLVMDIBuilderRef, LowerBound: i64, Count: i64) LLVMMetadataRef;
fn LLVMDIBuilderGetOrCreateArray(Builder: LLVMDIBuilderRef, Data: LLVMMetadataRef*, NumElements: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateExpression(Builder: LLVMDIBuilderRef, Addr: i64*, Length: size_t) LLVMMetadataRef;
fn LLVMDIBuilderCreateConstantValueExpression(Builder: LLVMDIBuilderRef, Value: i64) LLVMMetadataRef;
fn LLVMDIBuilderCreateGlobalVariableExpression(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, Linkage: const(char)*, LinkLen: size_t, File: LLVMMetadataRef, LineNo: u32, Ty: LLVMMetadataRef, LocalToUnit: LLVMBool, Expr: LLVMMetadataRef, Decl: LLVMMetadataRef, AlignInBits: u32) LLVMMetadataRef;
fn LLVMTemporaryMDNode(Ctx: LLVMContextRef, Data: LLVMMetadataRef*, NumElements: size_t) LLVMMetadataRef;
fn LLVMDisposeTemporaryMDNode(TempNode: LLVMMetadataRef);
fn LLVMMetadataReplaceAllUsesWith(TempTargetMetadata: LLVMMetadataRef, Replacement: LLVMMetadataRef);
fn LLVMDIBuilderCreateTempGlobalVariableFwdDecl(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, Linkage: const(char)*, LnkLen: size_t, File: LLVMMetadataRef, LineNo: u32, Ty: LLVMMetadataRef, LocalToUnit: LLVMBool, Decl: LLVMMetadataRef, AlignInBits: u32) LLVMMetadataRef;
fn LLVMDIBuilderInsertDeclareBefore(Builder: LLVMDIBuilderRef, Storage: LLVMValueRef, VarInfo: LLVMMetadataRef, Expr: LLVMMetadataRef, DebugLoc: LLVMMetadataRef, Instr: LLVMValueRef) LLVMValueRef;
fn LLVMDIBuilderInsertDeclareAtEnd(Builder: LLVMDIBuilderRef, Storage: LLVMValueRef, VarInfo: LLVMMetadataRef, Expr: LLVMMetadataRef, DebugLoc: LLVMMetadataRef, Block: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMDIBuilderInsertDbgValueBefore(Builder: LLVMDIBuilderRef, Val: LLVMValueRef, VarInfo: LLVMMetadataRef, Expr: LLVMMetadataRef, DebugLoc: LLVMMetadataRef, Instr: LLVMValueRef) LLVMValueRef;
fn LLVMDIBuilderInsertDbgValueAtEnd(Builder: LLVMDIBuilderRef, Val: LLVMValueRef, VarInfo: LLVMMetadataRef, Expr: LLVMMetadataRef, DebugLoc: LLVMMetadataRef, Block: LLVMBasicBlockRef) LLVMValueRef;
fn LLVMDIBuilderCreateAutoVariable(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, File: LLVMMetadataRef, LineNo: u32, Ty: LLVMMetadataRef, AlwaysPreserve: LLVMBool, Flags: LLVMDIFlags, AlignInBits: u32) LLVMMetadataRef;
fn LLVMDIBuilderCreateParameterVariable(Builder: LLVMDIBuilderRef, Scope: LLVMMetadataRef, Name: const(char)*, NameLen: size_t, ArgNo: u32, File: LLVMMetadataRef, LineNo: u32, Ty: LLVMMetadataRef, AlwaysPreserve: LLVMBool, Flags: LLVMDIFlags) LLVMMetadataRef;
fn LLVMGetSubprogram(Func: LLVMValueRef) LLVMMetadataRef;
fn LLVMSetSubprogram(Func: LLVMValueRef, SP: LLVMMetadataRef);

volt.llvm.dwarf

//! DWARF enums and code.
module volt.llvm.dwarf;


enum DwAte
{
	Address,
	Boolean,
	ComplexFloat,
	Float,
	Signed,
	SignedChar,
	Unsigned,
	UnsignedChar,
	LoUser,
	HiUser,
}