Example #1
0
        public void UpdateBlocks()
        {
            var body = method.Body;

            locals       = body.Variables;
            methodBlocks = new InstructionListParser(body.Instructions, body.ExceptionHandlers).Parse();
        }
Example #2
0
 public Blocks(MethodDefinition method)
 {
     var body = method.Body;
     this.method = method;
     this.locals = body.Variables;
     methodBlocks = new InstructionListParser(body.Instructions, body.ExceptionHandlers).parse();
 }
Example #3
0
        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;
        }
Example #5
0
        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);
        }
Example #6
0
		public void UpdateBlocks() {
			var body = method.Body;
			locals = body.Variables;
			methodBlocks = new InstructionListParser(body.Instructions, body.ExceptionHandlers).Parse();
		}
 public DeadBlocksRemover(MethodBlocks methodBlocks) => this.methodBlocks = methodBlocks;
 public CodeGenerator(MethodBlocks methodBlocks)
 {
     this.methodBlocks = methodBlocks;
 }
 public DeadBlocksRemover(MethodBlocks methodBlocks)
 {
     this.methodBlocks = methodBlocks;
 }
Example #10
0
 public CodeGenerator(MethodBlocks methodBlocks)
 {
     this.methodBlocks = methodBlocks;
 }