module volta.util.util

Code Map

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 { }
fn buildIdentifierExp(loc: const(Location), value: string, isGlobal: bool) ir.IdentifierExp

Builds an identifier exp from a string.

fn buildQualifiedName(loc: const(Location), value: scope (scope (string)[])) ir.QualifiedName

Builds a QualifiedName from an array.

fn buildQualifiedNameSmart(i: ir.Identifier) ir.QualifiedName

Builds a QualifiedName from a Identifier.

fn getScopeFromType(type: ir.Type) ir.Scope

Return the scope from the given type if it is, a aggregate or a derivative from one.

fn getScopeFromStore(store: ir.Store) ir.Scope

For the given store get the scope that it introduces.

Returns null for Values and non-scope types.

fn copyTypeSmart(loc: const(Location), type: ir.Type) ir.Type

Does a smart copy of a type.

A smart copy is one in which all types are copied, but TypeReferences are skipped, and TypeReferences are inserted if we encounter a named type.

fn buildPrimitiveType(loc: const(Location), kind: ir.PrimitiveType.Kind) ir.PrimitiveType

Build a PrimitiveType.

fn buildString(loc: const(Location)) ir.ArrayType

Build a string (immutable(char)[]) type.

fn buildVoidPtr(loc: const(Location)) ir.PointerType

Build a void* type.

fn buildVoidArray(loc: const(Location)) ir.ArrayType

Build a void[] type.

fn addVariable(errSink: ErrorSink, b: ir.BlockStatement, statExp: ir.StatementExp, var: ir.Variable)

Add a Variable to the BlockStatement scope and either to its statement or if StatementExp given to it instead.

fn buildVariable(loc: const(Location), type: ir.Type, st: ir.Variable.Storage, name: string, assign: ir.Exp) ir.Variable

Build a Variable, while not being smart about its type.

fn buildVariableAnonSmart(errSink: ErrorSink, loc: const(Location), b: ir.BlockStatement, statExp: ir.StatementExp, type: ir.Type, 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 buildVariableAnonSmartAtTop(errSink: ErrorSink, loc: const(Location), b: ir.BlockStatement, type: ir.Type, assign: ir.Exp) ir.Variable

Build a variable and add it to the top of a block statement.

fn buildVariableAnonSmart(errSink: ErrorSink, loc: const(Location), current: ir.Scope, statExp: ir.StatementExp, type: ir.Type, assign: ir.Exp) ir.Variable

Create an anonymous variable for a statementexp without a block statement.

fn copyVariableSmart(loc: const(Location), right: ir.Variable) ir.Variable

Copy a Variable, while being smart about its type, does not copy the the assign exp on the Variable.

fn getExpRefs(loc: const(Location), vars: ir.FunctionParam[]) ir.Exp[]

Get ExpReferences from a list of variables.

fn buildVariableSmart(loc: const(Location), type: ir.Type, st: ir.Variable.Storage, name: string) ir.Variable

Build a Variable, while being smart about its type.

fn buildExpReference(loc: const(Location), decl: ir.Declaration, names: scope (scope (string)[])) ir.ExpReference

Builds a usable ExpReference.

fn buildConstantDouble(loc: const(Location), value: f64) ir.Constant

Builds a constant double.

fn buildConstantFloat(loc: const(Location), value: f32) ir.Constant

Builds a constant float.

fn buildConstantInt(loc: const(Location), value: i32) ir.Constant

Builds a constant int.

fn buildConstantBool(loc: const(Location), val: bool) ir.Constant

Builds a constant bool.

fn buildConstantSizeT(loc: const(Location), target: TargetInfo, val: size_t) ir.Constant

Gets a size_t Constant and fills it with a value.

fn buildConstantString(errSink: ErrorSink, loc: const(Location), val: string, escape: bool) ir.Constant

Builds a constant string.

fn buildConstantCString(errSink: ErrorSink, loc: const(Location), val: string, escape: bool) ir.Exp

Builds a constant 'c' string.

fn buildConstantEnum(loc: const(Location), ed: ir.EnumDeclaration) ir.Constant

Build a constant to insert to the IR from a resolved EnumDeclaration.

fn buildCast(loc: const(Location), type: ir.Type, exp: ir.Exp) ir.Unary

Build a cast and sets the loc, does not call copyTypeSmart.

fn buildCastSmart(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 buildNot(loc: const(Location), exp: ir.Exp) ir.Unary

Builds a not expression.

fn buildAddrOf(loc: const(Location), exp: ir.Exp) ir.Unary

Builds an AddrOf expression.

fn buildAddrOf(loc: const(Location), var: ir.Variable, names: scope (scope (string)[])) ir.Unary

Builds a ExpReference and a AddrOf from a Variable.

fn buildDeref(loc: const(Location), exp: ir.Exp) ir.Unary

Builds a dereference expression.

fn buildDeref(loc: const(Location), var: ir.Variable) ir.Unary

Builds an expression that dereferences a variable.

fn buildNew(loc: const(Location), type: ir.Type, name: string, arguments: scope (scope (ir.Exp)[])) ir.Unary

Builds a New expression.

fn buildTypeidSmart(loc: const(Location), type: ir.Type) ir.Typeid

Builds a typeid with type smartly.

fn buildTypeidSmart(loc: const(Location), typeInfoClass: ir.Class, type: ir.Type) ir.Exp

Build a typeid casting if needed.

fn buildArrayPtr(loc: const(Location), base: ir.Type, child: ir.Exp) ir.BuiltinExp

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 buildBuildVtable(loc: const(Location), type: ir.Type, _class: ir.Class, functionSink: FunctionSink) ir.BuiltinExp

Builds a BuiltinExp of BuildVtable type.

fn buildEnumMembers(loc: const(Location), _enum: ir.Enum, enumRef: ir.Exp, sinkRef: ir.Exp) ir.BuiltinExp

Builds a BuiltinExp of EnumMembers type.

fn buildArrayLength(loc: const(Location), target: TargetInfo, child: ir.Exp) ir.BuiltinExp

Builds a BuiltinExp of ArrayLength type. Make sure the child exp is not a pointer to an array.

fn buildArrayDup(loc: const(Location), t: ir.Type, children: ir.Exp[]) ir.BuiltinExp

Builds an ArrayDup BuiltinExp.

fn buildAALength(loc: const(Location), target: TargetInfo, child: ir.Exp[]) ir.BuiltinExp

Builds a BuiltinExp of AALength type.

fn buildAAKeys(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp

Builds a BuiltinExp of AAKeys type.

fn buildAAValues(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp

Builds a BuiltinExp of AAValues type.

fn buildAARehash(loc: const(Location), child: ir.Exp[]) ir.BuiltinExp

Builds a BuiltinExp of AARehash type.

fn buildAAGet(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp

Builds a BuiltinExp of AAGet 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 AARemove type.

fn buildClassinfo(loc: const(Location), type: ir.Type, child: ir.Exp) ir.BuiltinExp

Builds a BuiltinExp of Classinfo type.

fn buildAAIn(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp

Builds a BuiltinExp of AARemove type.

fn buildAADup(loc: const(Location), aa: ir.AAType, child: ir.Exp[]) ir.BuiltinExp

Builds a BuiltinExp of AADup type.

fn buildPODCtor(loc: const(Location), pod: ir.PODAggregate, postfix: ir.Postfix, ctor: ir.Function) ir.BuiltinExp

Builds a BuiltinExp of PODCtor type.

fn buildPostfixIdentifier(loc: const(Location), exp: ir.Exp, name: string) ir.Postfix

Build a postfix Identifier expression.

fn buildPostfixIdentifier(loc: const(Location), qname: ir.QualifiedName, name: string) ir.Postfix

Builds a chain of postfix lookups from a QualifiedName. These are only useful before the extyper runs.

fn buildSlice(loc: const(Location), child: ir.Exp, args: scope (scope (ir.Exp)[])) ir.Postfix

Builds a postfix slice.

fn buildIncrement(loc: const(Location), child: ir.Exp) ir.Postfix

Builds a postfix increment.

fn buildDecrement(loc: const(Location), child: ir.Exp) ir.Postfix

Builds a postfix decrement.

fn buildIndex(loc: const(Location), child: ir.Exp, arg: ir.Exp) ir.Postfix

Builds a postfix index.

fn buildCall(loc: const(Location), child: ir.Exp, args: ir.Exp[]) ir.Postfix

Builds a postfix call.

fn buildCall(loc: const(Location), func: ir.Function, args: ir.Exp[]) ir.Postfix

Builds a call to a function.

fn buildCall(loc: const(Location), decl: ir.Declaration, args: ir.Exp[], names: scope (scope (string)[])) ir.Postfix

Builds a postfix call.

fn buildAdd(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds an add BinOp.

fn buildSub(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a subtraction BinOp.

fn buildMul(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a multiplication BinOp.

fn buildDiv(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a division BinOp.

fn buildMod(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a modulo BinOp.

fn buildAnd(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a bitwise and Binop

fn buildOr(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a bitwise or Binop

fn buildXor(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a bitwise xor binop.

fn buildCat(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a concatenate BinOp.

fn buildLS(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a LS BinOp.

fn buildSRS(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a SRS BinOp.

fn buildRS(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds an RS BinOp.

fn buildPow(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a Pow BinOp.

fn buildAssign(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds an assign BinOp.

fn buildAssign(loc: const(Location), left: ir.Variable, right: ir.Exp) ir.BinOp

Builds an assign BinOp to a given variable.

fn buildAssign(loc: const(Location), left: ir.Variable, right: ir.Variable) ir.BinOp

Builds an assign BinOp to a given variable from a given variable.

fn buildAddAssign(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds an add-assign BinOp.

fn buildCatAssign(loc: const(Location), left: ir.Exp, right: ir.Exp) ir.BinOp

Builds a cat-assign BinOp.

fn buildBinOp(loc: const(Location), op: ir.BinOp.Op, left: ir.Exp, right: ir.Exp) ir.BinOp

Builds an BinOp.

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

Adds a variable argument to a function, also adds it to the scope.

fn buildVarStatSmart(errSink: ErrorSink, loc: const(Location), block: ir.BlockStatement, _scope: ir.Scope, type: ir.Type, name: string) ir.Variable

Builds a variable statement smartly, inserting at the end of the block statements and inserting it in the scope.

fn buildExpStat(loc: const(Location), stat: ir.StatementExp, exp: ir.Exp) ir.ExpStatement

Add an Exp to a StatementExp.

fn buildTernary(loc: const(Location), condition: ir.Exp, l: ir.Exp, r: ir.Exp) ir.Ternary

Build a Ternary expression.

fn buildExpStat(loc: const(Location), block: ir.BlockStatement, exp: ir.Exp) ir.ExpStatement

Build an exp statement and add it to a block.

fn buildExpStat(loc: const(Location), exp: ir.Exp) ir.ExpStatement

Build an exp statement without inserting it anywhere.

fn buildSwitchStat(loc: const(Location), condition: ir.Exp) ir.SwitchStatement

Build a switch statement.

fn buildSwitchCase(loc: const(Location), caseExp: ir.Exp) ir.SwitchCase

Build a simple switch case.

Does not build a block statement, only uses firstExp.

fn buildAssertFalse(loc: const(Location)) ir.AssertStatement

Build an assert(false) statement.

No message.

fn buildSwitchDefault(loc: const(Location)) ir.SwitchCase

Build a simple default switch case.

Does not build a block statement.

fn buildIfStat(loc: const(Location), exp: ir.Exp, thenState: ir.BlockStatement, elseState: ir.BlockStatement, autoName: string) ir.IfStatement

Build an if statement.

fn buildIfElseIfStat(loc: const(Location), exp: ir.Exp, thenState: ir.BlockStatement, elseState: ir.IfStatement) ir.IfStatement

Build an if statement using an if statement as the else 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 buildBlockStat(loc: const(Location), introducingNode: ir.Node, _scope: ir.Scope, statements: scope (scope (ir.Node)[])) ir.BlockStatement

Build a block statement.

fn buildReturnStat(loc: const(Location), block: ir.BlockStatement, exp: ir.Exp) ir.ReturnStatement

Build a return statement.

fn buildFunction(loc: const(Location), _scope: ir.Scope, name: string, buildBody: bool) ir.Function

Builds a function without inserting it anywhere.

fn buildFunction(loc: const(Location), _scope: ir.Scope, name: string, ftype: ir.FunctionType) ir.Function

Builds a function with a given type.

fn buildFunction(errSink: ErrorSink, loc: const(Location), tlb: ir.TopLevelBlock, _scope: ir.Scope, name: string, buildBody: bool) ir.Function

Builds a completely useable Function and insert it into the various places it needs to be inserted.

fn buildAliasSmart(loc: const(Location), name: string, i: ir.Identifier) ir.Alias

Builds a alias from a string and a Identifier.

fn buildAlias(loc: const(Location), name: string, from: string) ir.Alias

Builds a alias from two strings.

fn buildStruct(errSink: ErrorSink, loc: const(Location), tlb: ir.TopLevelBlock, _scope: ir.Scope, name: string, members: scope (scope (ir.Variable)[])) ir.Struct

Builds a completely useable struct and insert it into the various places it needs to be inserted.

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

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 addVarToStructSmart(errSink: ErrorSink, _struct: ir.Struct, var: ir.Variable) ir.Variable

Add a variable to a pre-built struct.

fn getClass(t: ir.Type) ir.Class

If t is a class, or a typereference to a class, returns the class. Otherwise, returns null.

fn realBase(ptr: ir.PointerType) ir.Type

Returns the base of consecutive pointers. e.g. 'int***' returns 'int'.

fn buildWithStatement(loc: const(Location), exp: ir.Exp) ir.WithStatement

Build a with statement that has no block.

fn buildForStatement(loc: const(Location), target: TargetInfo, parent: ir.Scope, length: ir.Exp, forStatement: ir.ForStatement, ivar: ir.Variable)

Build a simple index for loop. for (i = 0; i < length; ++i)

fn buildTypeInfoCast(typeInfoClass: ir.Class, e: ir.Exp) ir.Exp

Build a cast to a TypeInfo.