Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ internal enum EXPRFLAG
EXF_MEMBERSET = 0x2, // Only on EXPRFIELD, indicates that the reference is for set purposes
EXF_OPENTYPE = 0x2, // Only on EXPRTYPEOF. Indicates that the type is an open type.
EXF_LABELREFERENCED = 0x2, // Only on EXPRLABEL. Indicates the label was targeted by a goto.
#if CSEE
EXF_CLASSASSTATICSCHILD = 0x2, // Only on EXPRCLASS, indicates a synthesized child which is parent of statics
EXF_DECLASSG = 0x2, // Only on EK_ASSG
#endif
EXF_GENERATEDQMARK = 0x2, // only on EK_QMARK

// 0x4
Expand All @@ -47,9 +43,6 @@ internal enum EXPRFLAG
EXF_FINALLYBLOCKED = 0x8, // Only on EXPRTRY, EXPRGOTO, EXPRRETURN, means that FINALLY block end is unreachable
EXF_REFCHECK = 0x8, // Only on EXPRCAST, indicates an reference checked cast is required
EXF_WRAPASTEMP = 0x8, // Only on EXPRWRAP, indicates that this wrap represents an actual local
#if CSEE
EXF_ADDROFREF = 0x8, // Only on EXPRBINOP, with kind == EK_ADDR, indicates*f where f is of a class type
#endif

// 0x10
EXF_LITERALCONST = 0x10, // Only on EXPRCONSTANT, means this was not a folded constant
Expand All @@ -59,18 +52,12 @@ internal enum EXPRFLAG
EXF_NEWOBJCALL = 0x10, // Only on EXPRCALL and EXPRMEMGRP, to indicate new <...>(...)
EXF_INDEXEXPR = 0x10, // Only on EXPRCAST, indicates a special cast for array indexing
EXF_REPLACEWRAP = 0x10, // Only on EXPRWRAP, it means the wrap should be replaced with its expr (during rewriting)
#if CSEE
EXF_ADDROFREFLOC = 0x10, // Only on EXPRBINOP, with kind == EK_ADDR, indicates &f where f is of a class type
#endif

// 0x20
EXF_UNREALIZEDGOTO = 0x20, // Only on EXPRGOTO, means target unknown
EXF_CONSTRAINED = 0x20, // Only on EXPRCALL, EXPRPROP, indicates a call through a method or prop on a type variable or value type
EXF_FORCE_BOX = 0x20, // Only on EXPRCAST, GENERICS: indicates a "forcing" boxing operation (if type parameter boxed then nop, i.e. object -> object, else value type -> object)
EXF_SIMPLENAME = 0x20, // Only on EXPRMEMGRP, We're binding a dynamic simple name.
#if CSEE
EXF_BUCKETSINDEX = 0x20, // Only on EXPRBINOP, with kind == EK_INDEX, indicates Everett view of hashtable bucket
#endif

// 0x40
EXF_ASFINALLYLEAVE = 0x40, // Only on EXPRGOTO, EXPRRETURN, means leave through a finally, ASLEAVE must also be set
Expand All @@ -89,17 +76,11 @@ internal enum EXPRFLAG

// 0x200
EXF_NEWSTRUCTASSG = 0x200, // Only on EXPRCALL, indicates that this is a constructor call which assigns to object
#if CSEE
EXF_OBJDECL = 0x200, // Only on EXPRCAST, indicates a cast of object or itf declared var to actual type
#endif
EXF_GENERATEDSTMT = 0x200, // Only on statement exprs. Indicates that the statement is compiler generated
// so we shouldn't report things like "unreachable code" on it.

// 0x400
EXF_IMPLICITSTRUCTASSG = 0x400, // Only on EXPRCALL, indicates that this an implicit struct assg call
#if CSEE
EXF_BASECAST = 0x400, // Only on EXPRCAST, indicates a cast from declared type to its base type
#endif
EXF_MARKING = 0x400, // Only on statement exprs. Indicates that we're currently marking
// its children for reachability (it's up the stack).

Expand All @@ -114,9 +95,6 @@ internal enum EXPRFLAG
EXF_IMPLICITTHIS = 0x010000, // indicates a compiler provided this pointer (in the EE, when doing autoexp, this can be anything)
EXF_CANTBENULL = 0x020000, // indicate this expression can't ever be null (e.g., "this").
EXF_CHECKOVERFLOW = 0x040000, // indicates that operation should be checked for overflow
#if CSEE
EXF_THREWEXCEPTION = 0x080000, // indicates the expr originally threw an exception
#endif
EXF_PUSH_OP_FIRST = 0x100000, // On any expr, indicates that the first operand must be placed on the stack before
// anything else - this is needed for multi-ops involving string concat.
EXF_ASSGOP = 0x200000, // On any non stmt exprs, indicates assignment node...
Expand All @@ -132,15 +110,9 @@ internal enum EXPRFLAG
EXF_USEORIGDEBUGINFO | EXF_LASTBRACEDEBUGINFO | EXF_NODEBUGINFO |
EXF_IMPLICITTHIS | EXF_CANTBENULL | EXF_CHECKOVERFLOW |
EXF_PUSH_OP_FIRST | EXF_ASSGOP | EXF_LVALUE | EXF_SAMENAMETYPE
#if CSEE
| EXF_THREWEXCEPTION
#endif
,

// Used to mask the cast flags off an EXPRCAST.
EXF_CAST_ALL = EXF_BOX | EXF_UNBOX | EXF_REFCHECK | EXF_INDEXEXPR | EXF_FORCE_BOX | EXF_FORCE_UNBOX | EXF_STATIC_CAST
#if CSEE
| EXF_MAYBE_BOX | EXF_OBJDECL | EXF_BASECAST
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,7 @@ private AggCastResult bindExplicitConversionFromTypeVarToAggregate(AggregateType
{
return AggCastResult.Failure;
}
#if ! CSEE
if (aggTypeDest.getAggregate().IsInterface())
#else
if ((exprSrc != null && !exprSrc.eeValue.substType.IsNullableType()) || aggTypeDest.getAggregate().IsInterface())
#endif
{
// Explicit conversion of type variables to interfaces.
if (_needsExprDest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,8 @@ internal Expr BindArrayIndexCore(BindingFlag bindFlags, Expr pOp1, Expr pOp2)
Expr pTemp = mustConvert(x, pDestType);
if (pDestType == pIntType)
return pTemp;
#if CSEE
EXPRFLAG flag = 0;
#else
EXPRFLAG flag = EXPRFLAG.EXF_INDEXEXPR;
#endif
ExprClass exprType = GetExprFactory().MakeClass(pDestType);
return GetExprFactory().CreateCast(flag, exprType, pTemp);
return GetExprFactory().CreateCast(EXPRFLAG.EXF_INDEXEXPR, exprType, pTemp);
});

if (cIndices != rank)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,12 @@ private bool SearchSingleType(AggregateType typeCur, out bool pfHideByName)
if (!_fMulti)
{
if (_swtFirst.Sym.IsFieldSymbol() && symCur.IsEventSymbol()
#if !CSEE // The isEvent bit is only set on symbols which come from source...
// The isEvent bit is only set on symbols which come from source...
// This is not a problem for the compiler because the field is only
// accessible in the scope in which it is declared,
// but in the EE we ignore accessibility...
&& _swtFirst.Field().isEvent
#endif
)
)
{
// m_swtFirst is just the field behind the event symCur so ignore symCur.
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1437,12 +1437,7 @@ private UnaryOperatorSignatureFindResult PopulateSignatureList(Expr pArgument, U
}

// Check for user defined inc/dec
#if !CSEE
ExprMultiGet exprGet = GetExprFactory().CreateMultiGet(0, pArgumentType, null);
#else // CSEE

Expr exprGet = pArgument;
#endif // CSEE

Expr exprVal = bindUDUnop((ExpressionKind)(exprKind - ExpressionKind.Add + ExpressionKind.Inc), exprGet);
if (exprVal != null)
Expand All @@ -1454,9 +1449,7 @@ private UnaryOperatorSignatureFindResult PopulateSignatureList(Expr pArgument, U

Debug.Assert(pArgument != null);
ExprMulti exprMulti = GetExprFactory().CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, pArgumentType, pArgument, exprVal);
#if ! CSEE
exprGet.OptionalMulti = exprMulti;
#endif // !CSEE

// Check whether Lvalue can be assigned. checkLvalue may return true
// despite reporting an error.
Expand Down Expand Up @@ -1822,13 +1815,8 @@ private ExprMulti BindNonliftedIncOp(ExpressionKind ek, EXPRFLAG flags, Expr arg
Debug.Assert(!uofs.isLifted());

Debug.Assert(arg != null);
#if ! CSEE
ExprMultiGet exprGet = GetExprFactory().CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.Type, null);
Expr exprVal = exprGet;
#else
Expr exprVal = arg;
#endif

CType type = uofs.GetType();
Debug.Assert(!type.IsNullableType());

Expand All @@ -1843,10 +1831,7 @@ private ExprMulti BindNonliftedIncOp(ExpressionKind ek, EXPRFLAG flags, Expr arg
Expr op = mustCast(exprVal, arg.Type, CONVERTTYPE.NOUDC);

ExprMulti exprMulti = GetExprFactory().CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.Type, arg, op);

#if ! CSEE
exprGet.OptionalMulti = exprMulti;
#endif
return exprMulti;
}

Expand All @@ -1858,31 +1843,22 @@ private ExprMulti BindLiftedIncOp(ExpressionKind ek, EXPRFLAG flags, Expr arg, U
NullableType type = uofs.GetType().AsNullableType();
Debug.Assert(arg != null);

#if ! CSEE
ExprMultiGet exprGet = GetExprFactory().CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.Type, null);
Expr exprVal = exprGet;
#else
Expr exprVal = arg;
#endif

Expr nonLiftedResult = null;
Expr nonLiftedArg = exprVal;

// We want to give the lifted argument as the binop, but use the non-lifted argument as the
// argument of the call.
//Debug.Assert(uofs.LiftArg() || type.IsValType());
nonLiftedArg = mustCast(nonLiftedArg, type.GetUnderlyingType());
nonLiftedResult = BindIncOpCore(ek, flags, nonLiftedArg, type.GetUnderlyingType());
Expr nonLiftedResult = BindIncOpCore(ek, flags, nonLiftedArg, type.GetUnderlyingType());
exprVal = mustCast(exprVal, type);
ExprUnaryOp exprRes = GetExprFactory().CreateUnaryOp((ek == ExpressionKind.Add) ? ExpressionKind.Inc : ExpressionKind.Dec, arg.Type/* type */, exprVal);
mustCast(mustCast(nonLiftedResult, type), arg.Type);
exprRes.Flags |= flags;

ExprMulti exprMulti = GetExprFactory().CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.Type, arg, exprRes);

#if ! CSEE
exprGet.OptionalMulti = exprMulti;
#endif
return exprMulti;
}

Expand Down Expand Up @@ -1923,15 +1899,6 @@ private ExprBinOp BindDecBinOp(ExpressionKind ek, EXPRFLAG flags, Expr arg1, Exp
break;
}

#if CSEE
// In the EE, we want to emit an EXPRBINOP with the
// right EK so that when we evalsync we can just do the work ourselves instead of
// delegating to method calls.

return GetExprFactory().CreateBinop(tree, ek, typeRet, arg1, arg2);

#endif // CSEE

return GetExprFactory().CreateBinop(ek, typeRet, arg1, arg2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ internal enum KAID
kaidNil = -1,

kaidGlobal = 0,
kaidErrorAssem, // NOTE: !CSEE only
kaidThisAssembly,
kaidUnresolved,
kaidStartAssigning,
Expand Down Expand Up @@ -395,7 +394,6 @@ public InputFile getInputFile()

case SYMKIND.SK_AggregateSymbol:
{
#if !CSEE
AggregateSymbol AggregateSymbol = this.AsAggregateSymbol();
if (!AggregateSymbol.IsSource())
return AggregateSymbol.DeclOnly().getInputFile();
Expand All @@ -404,7 +402,6 @@ public InputFile getInputFile()
// files, getInputFile isn't a reasonable operation.
Debug.Assert(false);
return null;
#endif
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@ internal partial class AggregateType : CType
private TypeArray _pTypeArgsAll; // includes args from outer types
private AggregateSymbol _pOwningAggregate;

#if ! CSEE // The EE can't cache these since the AGGSYMs may change as things are imported.
private AggregateType _baseType; // This is the result of calling SubstTypeArray on the aggregate's baseClass.
private TypeArray _ifacesAll; // This is the result of calling SubstTypeArray on the aggregate's ifacesAll.
private TypeArray _winrtifacesAll; //This is the list of collection interfaces implemented by a WinRT object.
#else // !CSEE

public short proxyOID; // oid for the managed proxy in the host running inside the debugee
public short typeConverterID;
#endif // !CSEE

public bool fConstraintsChecked; // Have the constraints been checked yet?
public bool fConstraintError; // Did the constraints check produce an error?
Expand All @@ -51,21 +45,8 @@ public AggregateSymbol GetOwningAggregate()

public AggregateType GetBaseClass()
{
#if CSEE
AggregateType atsBase = getAggregate().GetBaseClass();
if (!atsBase || GetTypeArgsAll().size == 0 || atsBase.GetTypeArgsAll().size == 0)
return atsBase;

return getAggregate().GetTypeManager().SubstType(atsBase, GetTypeArgsAll()).AsAggregateType();
#else // !CSEE

if (_baseType == null)
{
_baseType = getAggregate().GetTypeManager().SubstType(getAggregate().GetBaseClass(), GetTypeArgsAll()) as AggregateType;
}

return _baseType;
#endif // !CSEE
return _baseType ??
(_baseType = getAggregate().GetTypeManager().SubstType(getAggregate().GetBaseClass(), GetTypeArgsAll()) as AggregateType);
}

public void SetTypeArgsThis(TypeArray pTypeArgsThis)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ public bool Init(ErrorHandling errorContext, SymbolTable symtable)
{
_runtimeBinderSymbolTable = symtable;
Debug.Assert(_pBSymmgr != null);

#if !CSEE
Debug.Assert(_predefSyms == null);
#else // CSEE
Debug.Assert(predefSyms == null || aidMsCorLib != KAID.kaidNil);
#endif // CSEE

if (_aidMsCorLib == KAID.kaidNil)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,6 @@ public void InitFromParent()

_fHasErrors = typePar.HasErrors();
_fUnres = typePar.IsUnresolved();
#if CSEE

this.typeRes = this;
if (!this.fUnres)
this.tsRes = ktsImportMax;
this.fDirty = typePar.fDirty;
this.tsDirty = typePar.tsDirty;
#endif // CSEE
}

public bool HasErrors()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ public TypeParameterType CreateTypeParameter(TypeParameterSymbol pSymbol)
type.SetTypeParameterSymbol(pSymbol);
type.SetUnresolved(pSymbol.parent != null && pSymbol.parent.IsAggregateSymbol() && pSymbol.parent.AsAggregateSymbol().IsUnresolved());
type.SetName(pSymbol.name);

#if CSEE
type.typeRes = type;
if (!type.IsUnresolved())
{
type.tsRes = ktsImportMax;
}
#endif // CSEE

Debug.Assert(pSymbol.GetTypeParameterType() == null);
pSymbol.SetTypeParameterType(type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,6 @@ public AggregateType GetAggregate(AggregateSymbol agg, AggregateType atsOuter, T
Debug.Assert(!pAggregate.fConstraintsChecked && !pAggregate.fConstraintError);

pAggregate.SetErrors(false);
#if CSEE

SpecializedSymbolCreationEE* pSymCreate = static_cast<SpecializedSymbolCreationEE*>(m_BSymmgr.GetSymFactory().m_pSpecializedSymbolCreation);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's safe to say there's nothing using this as part of a C# project!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

AggregateSymbolExtra* pExtra = pSymCreate.GetHashTable().GetElement(agg).AsAggregateSymbolExtra();
pAggregate.typeRes = pAggregate;
if (!pAggregate.IsUnresolved())
{
pAggregate.tsRes = ktsImportMax;
}
pAggregate.fDirty = pExtra.IsDirty() || pAggregate.IsUnresolved();
pAggregate.tsDirty = pExtra.GetLastComputedDirtyBit();
#endif // CSEE

_typeTable.InsertAggregate(name, agg, pAggregate);

// If we have a generic type definition, then we need to set the
Expand Down