private Computation ConvertNode(AST.InstructionBlock node, ILabel after) { ILabel start = node.Instructions .Reverse() .Aggregate(after, (next, expression) => this.GenerateExpression(expression, next).Start); return(new Computation(start)); }
public ILabel BuildFunctionBody(AST.InstructionBlock body) { var retVal = this.function.IsEntryPoint ? (Node) new IntegerImmediateValue(0) : new UnitImmediateValue(); var guardEpilogue = this.prologueEpilogueGenerator.GenerateEpilogue(this.function, retVal); var afterPrologue = this.ConvertNode(body, guardEpilogue); return(this.prologueEpilogueGenerator.GeneratePrologue(this.function, afterPrologue.Start)); }
public ILabel BuildFunctionBody(Function.Function function, AST.InstructionBlock body) { return(new GenerateProcess( this.labelFactory, this.readWriteGenerator, this.prologueEpilogueGenerator, this.callGenerator, function) .BuildFunctionBody(body)); }