Exemple #1
0
        public Identifier VisitRegister(Register_v1 reg)
        {
            var      regStorage = arch.GetRegister(reg.Name.Trim());
            DataType dt;

            if (this.argCur.Type != null)
            {
                dt = this.argCur.Type.Accept(procSer.TypeLoader);
            }
            else
            {
                dt = regStorage.DataType;
            }
            if (dt is VoidType)
            {
                return(null);
            }
            var idArg = procSer.CreateId(
                argCur.Name ?? regStorage.Name,
                dt,
                regStorage);

            if (argCur.OutParameter)
            {
                idArg = frame.EnsureOutArgument(idArg, arch.FramePointerType);
            }
            return(idArg);
        }
Exemple #2
0
        public Identifier VisitRegister(Register_v1 reg)
        {
            var      regStorage = arch.GetRegister(reg.Name.Trim());
            DataType dt;

            if (this.argCur.Type != null)
            {
                dt = this.argCur.Type.Accept(procSer.TypeLoader);
            }
            else
            {
                dt = regStorage.DataType;
            }
            if (dt is VoidType)
            {
                return(null);
            }
            var idArg = procSer.CreateId(
                argCur.Name ?? regStorage.Name,
                dt,
                regStorage);

            if (argCur.OutParameter)
            {
                //$REVIEW: out arguments are weird, as they are synthetic. It's possible that
                // future versions of reko will opt to model multiple values return from functions
                // explicitly instead of using destructive updates of this kind.
                idArg = frame.EnsureOutArgument(idArg, PrimitiveType.Create(Domain.Pointer, arch.FramePointerType.BitSize));
            }
            return(idArg);
        }
Exemple #3
0
 public Identifier Deserialize(Register_v1 reg)
 {
     var idArg = frame.EnsureRegister(arch.GetRegister(reg.Name.Trim()));
     if (argCur.OutParameter)
     {
         idArg = frame.EnsureOutArgument(idArg, arch.FramePointerType);
     }
     return idArg;
 }
Exemple #4
0
        public Identifier Deserialize(Register_v1 reg)
        {
            var idArg = frame.EnsureRegister(arch.GetRegister(reg.Name.Trim()));

            if (argCur.OutParameter)
            {
                idArg = frame.EnsureOutArgument(idArg, arch.FramePointerType);
            }
            return(idArg);
        }
		public void ArgSer_DeserializeRegister()
		{
			Register_v1 reg = new Register_v1("eax");
            Argument_v1 arg = new Argument_v1
            {
                Name = "eax",
                Kind = reg,
            };
            Identifier id = argser.Deserialize(arg);
			Assert.AreEqual("eax", id.Name);
			Assert.AreEqual(32, id.DataType.BitSize);
		}
Exemple #6
0
        public Identifier?VisitRegister(Register_v1 reg)
        {
            var regName = reg.Name;

            if (regName == null)
            {
                return(null);
            }
            var regStorage = arch.GetRegister(regName.Trim());

            if (regStorage is null)
            {
                return(null);
            }
            DataType dt;

            if (this.argCur !.Type != null)
            {
                dt = this.argCur.Type.Accept(procSer.TypeLoader);
            }
Exemple #7
0
 public Identifier VisitRegister(Register_v1 reg)
 {
     var regStorage = arch.GetRegister(reg.Name.Trim());
     DataType dt;
     if (this.argCur.Type != null)
         dt = this.argCur.Type.Accept(procSer.TypeLoader);
     else
         dt = regStorage.DataType;
     if (dt is VoidType)
         return null;
     var idArg = procSer.CreateId(
         argCur.Name ?? regStorage.Name,
         dt,
         regStorage);
     if (argCur.OutParameter)
     {
         //$REVIEW: out arguments are weird, as they are synthetic. It's possible that 
         // future versions of reko will opt to model multiple values return from functions
         // explicitly instead of using destructive updates of this kind.
         idArg = frame.EnsureOutArgument(idArg, PrimitiveType.Create(Domain.Pointer, arch.FramePointerType.Size));
     }
     return idArg;
 }
Exemple #8
0
 public SerializedSequence(SequenceStorage seq)
 {
     Registers    = new Register_v1[2];
     Registers[0] = new Register_v1(seq.Head.Name);
     Registers[1] = new Register_v1(seq.Tail.Name);
 }
Exemple #9
0
 public SerializedSequence(SequenceStorage seq)
 {
     Registers = new Register_v1[2];
     Registers[0] = new Register_v1(seq.Head.Name);
     Registers[1] = new Register_v1(seq.Tail.Name);
 }