예제 #1
0
        private void ExtractArguments(IList <AnalysisNet.ThreeAddressCode.Values.Constant> dest, IEnumerable <Cecil.CustomAttributeArgument> source)
        {
            foreach (Cecil.CustomAttributeArgument mexpr in source)
            {
                AnalysisNet.ThreeAddressCode.Values.Constant argument = new AnalysisNet.ThreeAddressCode.Values.Constant(mexpr.Value)
                {
                    Type = ExtractType(mexpr.Type)
                };

                dest.Add(argument);
            }
        }
예제 #2
0
        private AnalysisNet.IInstruction ProcessLoadConstant(Cecil.Cil.Instruction op)
        {
            AnalysisNetBytecode.LoadOperation operation = OperationHelper.ToLoadOperation(op.OpCode.Code);
            AnalysisNet.Types.IType           type      = OperationHelper.GetOperationType(op.OpCode.Code);
            object value = OperationHelper.GetOperationConstant(op);

            AnalysisNetTac.Values.Constant source = new AnalysisNetTac.Values.Constant(value)
            {
                Type = type
            };

            AnalysisNetBytecode.LoadInstruction instruction = new AnalysisNetBytecode.LoadInstruction((uint)op.Offset, operation, source);
            return(instruction);
        }