Esempio n. 1
0
        private bool IsSupportedFromObject(Instruction instruction)
        {
            var fromObjectType = InstructionKeyService.GetFromObjectType(instruction);

            if (!InstructionKeyService.IsSupportedObject(fromObjectType))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        private void ParseInstruction(Instruction instruction, MethodDefinition parentMethod, List <Triple> triples, string constructorInstructionKey = null)
        {
            var toObjectType = InstructionKeyService.GetToObjectType(instruction);

            if (!InstructionKeyService.IsSupportedObject(toObjectType))
            {
                return;
            }

            if (toObjectType == ObjectType.Argument)
            {
                var argumentTriples = GetMethodCallArgumentTriples(parentMethod, instruction, constructorInstructionKey);
                foreach (var argumentTriple in argumentTriples)
                {
                    triples.Add(argumentTriple);
                }
            }
            else if (toObjectType == ObjectType.NilArgument)
            {
                var triple = GetNilArgumentTriple(instruction, parentMethod);
                if (triple != null)
                {
                    triples.Add(triple);
                }
            }
            else if (toObjectType == ObjectType.ReturnValue && parentMethod.FullName.StartsWith("System.Void"))
            {
            }
            else
            {
                var triple = GetGenericTriple(instruction, parentMethod, toObjectType);
                if (triple != null)
                {
                    triples.Add(triple);
                }
            }
        }