Пример #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);
 }
Пример #14
0
 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();
 }