public void UpdateBlocks() { var body = method.Body; locals = body.Variables; methodBlocks = new InstructionListParser(body.Instructions, body.ExceptionHandlers).Parse(); }
public Blocks(MethodDefinition method) { var body = method.Body; this.method = method; this.locals = body.Variables; methodBlocks = new InstructionListParser(body.Instructions, body.ExceptionHandlers).parse(); }
protected override bool IsFunction(SyntaxNode node) { if (!FunctionKinds.Contains(node.Kind()) || !MethodBlocks.Contains(node.Parent.Kind()) || node.Parent.Parent.IsKind(SyntaxKind.InterfaceBlock)) { return(false); } if (node is MethodBaseSyntax method && method.Modifiers.Any(m => m.IsKind(SyntaxKind.MustOverrideKeyword))) { return(false); } return(true); }
public MethodBlocks parse() { var instrToBlock = new List<Block>(instructions.Count); var allBlocks = new List<Block>(); findBlocks(instrToBlock, allBlocks); fixBranchTargets(instrToBlock, allBlocks); fixBlockSources(allBlocks); var exSorted = getSortedExceptionInfos(); var bbl = createBaseBlockList(allBlocks, exSorted); foreach (var block in allBlocks) block.removeLastBr(); var mb = new MethodBlocks(); mb.BaseBlocks = bbl.getBlocks(mb); return mb; }
public MethodBlocks parse() { var instrToBlock = new List <Block>(instructions.Count); var allBlocks = new List <Block>(); findBlocks(instrToBlock, allBlocks); fixBranchTargets(instrToBlock, allBlocks); fixBlockSources(allBlocks); var exSorted = getSortedExceptionInfos(); var bbl = createBaseBlockList(allBlocks, exSorted); foreach (var block in allBlocks) { block.removeLastBr(); } var mb = new MethodBlocks(); mb.BaseBlocks = bbl.getBlocks(mb); return(mb); }
public DeadBlocksRemover(MethodBlocks methodBlocks) => this.methodBlocks = methodBlocks;
public CodeGenerator(MethodBlocks methodBlocks) { this.methodBlocks = methodBlocks; }
public DeadBlocksRemover(MethodBlocks methodBlocks) { this.methodBlocks = methodBlocks; }