Esempio n. 1
0
        public void VisitBorrowUnaryOp(BorrowUnaryOpNode node)
        {
            IAddressableNode?addressableRhs = node.RHS as IAddressableNode;

            if (addressableRhs == null || !addressableRhs.IsAddressable())
            {
                _errors.AddError("Cannot borrow non-lvalue type", node);
            }
        }
Esempio n. 2
0
        public void VisitBorrowUnaryOp(BorrowUnaryOpNode node)
        {
            IAddressableNode addressableRhs   = (IAddressableNode)node.RHS;
            AddressOfVisitor addressOfVisitor = new AddressOfVisitor(_functionStackLayout, _semanticModule, _structLayoutManager);

            addressableRhs.AcceptAddressableVisitor(addressOfVisitor);
            int startAddr = _builder.AddInstruction(OpCode.ADDRESSOF, addressOfVisitor.AbsoluteStackAddress);

            _builder.AddDebugSymbol(startAddr, node);
        }
Esempio n. 3
0
        public void VisitBorrowUnaryOp(BorrowUnaryOpNode node)
        {
            node.RHS.AcceptExpressionVisitor(this);

            if (!(Type is IValueType valueType))
            {
                _errors.AddError("Cannot borrow non-value type", node);
                SetAndCacheType(node, Type);
                return;
            }

            SetAndCacheType(node, _typeManager.GetType(valueType, PointerMode.Borrowed));
        }
Esempio n. 4
0
 public void VisitBorrowUnaryOp(BorrowUnaryOpNode node)
 {
     VisitPreOrder(node);
     node.RHS.AcceptExpressionVisitor(this);
     VisitPostOrder(node);
 }
 public void VisitBorrowUnaryOp(BorrowUnaryOpNode node)
 {
 }