public EXPRTHISPOINTER CreateThis(LocalVariableSymbol pLocal, bool fImplicit)
        {
            Debug.Assert(pLocal == null || pLocal.isThis);

            CType type = null;

            if (pLocal != null)
            {
                type = pLocal.GetType();
            }

            EXPRFLAG flags = EXPRFLAG.EXF_CANTBENULL;

            if (fImplicit)
            {
                flags |= EXPRFLAG.EXF_IMPLICITTHIS;
            }
            if (type != null && type.isStructType())
            {
                flags |= EXPRFLAG.EXF_LVALUE;
            }

            EXPRTHISPOINTER rval = new EXPRTHISPOINTER();

            rval.kind  = ExpressionKind.EK_THISPOINTER;
            rval.type  = type;
            rval.flags = flags;
            rval.local = pLocal;
            Debug.Assert(rval != null);
            return(rval);
        }
Exemplo n.º 2
0
 public ExprLocal(LocalVariableSymbol local)
     : base(ExpressionKind.Local)
 {
     Flags = EXPRFLAG.EXF_LVALUE;
     Local = local;
     Type  = local?.GetType();
 }
        public EXPRLOCAL CreateLocal(EXPRFLAG nFlags, LocalVariableSymbol pLocal)
        {
            Debug.Assert(0 == (nFlags & ~(EXPRFLAG.EXF_MASK_ANY)));

            CType type = null;

            if (pLocal != null)
            {
                type = pLocal.GetType();
            }

            EXPRLOCAL rval = new EXPRLOCAL();

            rval.kind  = ExpressionKind.EK_LOCAL;
            rval.type  = type;
            rval.flags = nFlags;
            rval.local = pLocal;
            Debug.Assert(rval != null);
            return(rval);
        }
Exemplo n.º 4
0
        public ExprThisPointer CreateThis(LocalVariableSymbol pLocal, bool fImplicit)
        {
            Debug.Assert(pLocal == null || pLocal.isThis);

            EXPRFLAG flags = EXPRFLAG.EXF_CANTBENULL;

            if (fImplicit)
            {
                flags |= EXPRFLAG.EXF_IMPLICITTHIS;
            }
            if (pLocal != null && pLocal.GetType().isStructType())
            {
                flags |= EXPRFLAG.EXF_LVALUE;
            }

            ExprThisPointer rval = new ExprThisPointer();

            rval.Flags = flags;
            rval.Local = pLocal;
            return(rval);
        }
Exemplo n.º 5
0
        public EXPRTHISPOINTER CreateThis(LocalVariableSymbol pLocal, bool fImplicit)
        {
            Debug.Assert(pLocal == null || pLocal.isThis);

            CType type = null;
            if (pLocal != null)
            {
                type = pLocal.GetType();
            }

            EXPRFLAG flags = EXPRFLAG.EXF_CANTBENULL;
            if (fImplicit)
            {
                flags |= EXPRFLAG.EXF_IMPLICITTHIS;
            }
            if (type != null && type.isStructType())
            {
                flags |= EXPRFLAG.EXF_LVALUE;
            }

            EXPRTHISPOINTER rval = new EXPRTHISPOINTER();
            rval.kind = ExpressionKind.EK_THISPOINTER;
            rval.type = type;
            rval.flags = flags;
            rval.local = pLocal;
            Debug.Assert(rval != null);
            return (rval);
        }
Exemplo n.º 6
0
        public EXPRLOCAL CreateLocal(EXPRFLAG nFlags, LocalVariableSymbol pLocal)
        {
            Debug.Assert(0 == (nFlags & ~(EXPRFLAG.EXF_MASK_ANY)));

            CType type = null;
            if (pLocal != null)
            {
                type = pLocal.GetType();
            }

            EXPRLOCAL rval = new EXPRLOCAL();
            rval.kind = ExpressionKind.EK_LOCAL;
            rval.type = type;
            rval.flags = nFlags;
            rval.local = pLocal;
            Debug.Assert(rval != null);
            return (rval);
        }