示例#1
0
        public void VisitAccess(AccessNode node)
        {
            // Don't insert unreachable code
            if (!_builder.InsertBlock.IsValid)
            {
                return;
            }

            node.Lhs.AcceptExpressionVisitor(this);
            if (!_visitedValue.IsValid)
            {
                throw new InvalidOperationException("access did not produce a usable base pointer");
            }
            Value lhs = _visitedValue;

            StructType   structType = (StructType)_genContext.SemanticModule.ExpressionResultTypes[node.Lhs];
            StructLayout layout     = _genContext.StructLayoutManager.GetLayout(structType);

            if (!layout.MemberOffsets.TryGetValue(node.Rhs, out int index))
            {
                throw new InvalidOperationException();
            }

            _visitedValue = _builder.BuildExtractValue(lhs, (uint)index);
        }
示例#2
0
        public void VisitAccess(AccessNode node)
        {
            if (!node.IsAddressable())
            {
                return;
            }

            IAddressableNode addressableLhs = (IAddressableNode)node.Lhs;

            addressableLhs.AcceptAddressableVisitor(this);
            _path.Add(node.Rhs);
        }
示例#3
0
        public void VisitAccess(AccessNode node)
        {
            IAddressableNode addressableLhs = (IAddressableNode)node.Lhs;

            addressableLhs.AcceptAddressableVisitor(this);

            StructType   structType = (StructType)_module.ExpressionResultTypes[node.Lhs];
            StructLayout layout     = _structLayoutManager.GetLayout(structType);

            if (!layout.MemberOffsets.TryGetValue(node.Rhs, out int offset))
            {
                throw new InvalidOperationException();
            }

            AbsoluteStackAddress += offset;
        }
示例#4
0
        public void VisitAccess(AccessNode node)
        {
            IAddressableNode addressableNode = (IAddressableNode)node.Lhs;

            addressableNode.AcceptAddressableVisitor(this);

            StructType   structType = (StructType)_genContext.SemanticModule.ExpressionResultTypes[node.Lhs];
            StructLayout layout     = _genContext.StructLayoutManager.GetLayout(structType);

            if (!layout.MemberOffsets.TryGetValue(node.Rhs, out int index))
            {
                throw new InvalidOperationException();
            }

            AssignmentWritePointer = _builder.BuildStructGEP(AssignmentWritePointer, (uint)index);
        }
示例#5
0
        public AccessNode GetAccessNode(long id)
        {
            AccessNode accessNode = null;

            using (var transaction = DbTransaction())
            {
                var repository = transaction.Repository <AccessNode>();

                try
                {
                    accessNode = repository.Find(u => u.ID == id);
                }
                catch (Exception exc)
                {
                    Facade.Log.CreateErrorLog(ModuleName, "GetAccessNode", "", exc, "");
                }
            }

            return(accessNode);
        }
示例#6
0
        public void VisitAccess(AccessNode node)
        {
            node.Lhs.AcceptExpressionVisitor(this);

            StructType   structType = (StructType)_module.ExpressionResultTypes[node.Lhs];
            StructLayout layout     = _structLayoutManager.GetLayout(structType);

            if (!layout.MemberOffsets.TryGetValue(node.Rhs, out int offset))
            {
                throw new InvalidOperationException();
            }

            int structSize = _typeSizeManager.GetSize(structType);
            int fieldSize  = _typeSizeManager.GetSize(((TypeSpecifierNode)node.Rhs.Type).Type);

            int trim = structSize - offset - fieldSize;

            _functionBuilder.AddInstruction(OpCode.POP, 0, trim);
            _functionBuilder.AddInstruction(OpCode.ACCESS, offset, offset + fieldSize);
        }
示例#7
0
 public void UpdateAccessNode(AccessNode accessNode)
 {
     Update(accessNode);
 }
示例#8
0
 public void DeleteAccessNode(AccessNode accessNode)
 {
     Delete(accessNode);
 }
示例#9
0
 public void SaveAccessNode(AccessNode accessNode)
 {
     Add(accessNode);
 }
示例#10
0
 public void VisitAccess(AccessNode node)
 {
     VisitDefaultExpression(node);
 }
 public void VisitAccess(AccessNode node)
 {
     node.Lhs = _processor.ProcessReplacement(node.Lhs);
     node.Rhs = _processor.ProcessReplacement(node.Rhs);
 }
示例#12
0
 public AssignmentNode(AccessNode left, ExpressionNode body)
     : base(body)
 {
     Left = left;
     Left.Parent = this;
 }
示例#13
0
 public void Visit(AccessNode node)
 {
     ValidateUsage(node);
 }
 public void VisitAccess(AccessNode node)
 {
     node.Lhs.AcceptExpressionVisitor(this);
 }
示例#15
0
 public void VisitAccess(AccessNode node)
 {
     Print($"Access (Rhs.Name = {node.Rhs.Name})");
     VisitSubnode(node.Lhs);
 }
示例#16
0
 public void VisitAccess(AccessNode node)
 {
     VisitPreOrder(node);
     node.Lhs.AcceptExpressionVisitor(this);
     VisitPostOrder(node);
 }
示例#17
0
 public void VisitAccess(AccessNode node)
 {
     AccessVisitor?.Visit(node);
 }
示例#18
0
 public void VisitAccess(AccessNode node)
 {
     node.Rhs.Type.AcceptSpecifierVisitor(this);
     SetAndCacheType(node, Type);
 }
 public SymConst Visit(AccessNode node)
 {
     throw EvalException();
 }