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);
        }
예제 #2
0
 protected override EXPR VisitTHISPOINTER(EXPRTHISPOINTER expr)
 {
     Debug.Assert(expr != null);
     Debug.Assert(alwaysRewrite || currentAnonMeth != null);
     Debug.Assert(expr.local.isThis);
     return GenerateConstant(expr);
 }
예제 #3
0
 protected virtual EXPR VisitTHISPOINTER(EXPRTHISPOINTER pExpr)
 {
     return(VisitLOCAL(pExpr));
 }
예제 #4
0
 protected virtual EXPR VisitTHISPOINTER(EXPRTHISPOINTER pExpr)
 {
     return VisitLOCAL(pExpr);
 }
예제 #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);
        }