Esempio n. 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);
        }
Esempio n. 2
0
        public void VisitAccess(AccessNode node)
        {
            if (!node.IsAddressable())
            {
                return;
            }

            IAddressableNode addressableLhs = (IAddressableNode)node.Lhs;

            addressableLhs.AcceptAddressableVisitor(this);
            _path.Add(node.Rhs);
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 7
0
 public void UpdateAccessNode(AccessNode accessNode)
 {
     Update(accessNode);
 }
Esempio n. 8
0
 public void DeleteAccessNode(AccessNode accessNode)
 {
     Delete(accessNode);
 }
Esempio n. 9
0
 public void SaveAccessNode(AccessNode accessNode)
 {
     Add(accessNode);
 }
Esempio n. 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);
 }
Esempio n. 12
0
 public AssignmentNode(AccessNode left, ExpressionNode body)
     : base(body)
 {
     Left = left;
     Left.Parent = this;
 }
Esempio n. 13
0
 public void Visit(AccessNode node)
 {
     ValidateUsage(node);
 }
 public void VisitAccess(AccessNode node)
 {
     node.Lhs.AcceptExpressionVisitor(this);
 }
Esempio n. 15
0
 public void VisitAccess(AccessNode node)
 {
     Print($"Access (Rhs.Name = {node.Rhs.Name})");
     VisitSubnode(node.Lhs);
 }
Esempio n. 16
0
 public void VisitAccess(AccessNode node)
 {
     VisitPreOrder(node);
     node.Lhs.AcceptExpressionVisitor(this);
     VisitPostOrder(node);
 }
Esempio n. 17
0
 public void VisitAccess(AccessNode node)
 {
     AccessVisitor?.Visit(node);
 }
Esempio n. 18
0
 public void VisitAccess(AccessNode node)
 {
     node.Rhs.Type.AcceptSpecifierVisitor(this);
     SetAndCacheType(node, Type);
 }
 public SymConst Visit(AccessNode node)
 {
     throw EvalException();
 }