Skip to content

Commit 9326e91

Browse files
JonHannastephentoub
authored andcommitted
Remove CSEE code from Microsoft.CSharp (#17979)
As discussed at dotnet/corefx#17810 (comment)
1 parent 4fa40fe commit 9326e91

File tree

11 files changed

+6
-134
lines changed

11 files changed

+6
-134
lines changed

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/EXPRFLAG.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ internal enum EXPRFLAG
2626
EXF_MEMBERSET = 0x2, // Only on EXPRFIELD, indicates that the reference is for set purposes
2727
EXF_OPENTYPE = 0x2, // Only on EXPRTYPEOF. Indicates that the type is an open type.
2828
EXF_LABELREFERENCED = 0x2, // Only on EXPRLABEL. Indicates the label was targeted by a goto.
29-
#if CSEE
30-
EXF_CLASSASSTATICSCHILD = 0x2, // Only on EXPRCLASS, indicates a synthesized child which is parent of statics
31-
EXF_DECLASSG = 0x2, // Only on EK_ASSG
32-
#endif
3329
EXF_GENERATEDQMARK = 0x2, // only on EK_QMARK
3430

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

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

6656
// 0x20
6757
EXF_UNREALIZEDGOTO = 0x20, // Only on EXPRGOTO, means target unknown
6858
EXF_CONSTRAINED = 0x20, // Only on EXPRCALL, EXPRPROP, indicates a call through a method or prop on a type variable or value type
6959
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)
7060
EXF_SIMPLENAME = 0x20, // Only on EXPRMEMGRP, We're binding a dynamic simple name.
71-
#if CSEE
72-
EXF_BUCKETSINDEX = 0x20, // Only on EXPRBINOP, with kind == EK_INDEX, indicates Everett view of hashtable bucket
73-
#endif
7461

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

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

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

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

140115
// Used to mask the cast flags off an EXPRCAST.
141116
EXF_CAST_ALL = EXF_BOX | EXF_UNBOX | EXF_REFCHECK | EXF_INDEXEXPR | EXF_FORCE_BOX | EXF_FORCE_UNBOX | EXF_STATIC_CAST
142-
#if CSEE
143-
| EXF_MAYBE_BOX | EXF_OBJDECL | EXF_BASECAST
144-
#endif
145117
}
146118
}

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExplicitConversion.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,7 @@ private AggCastResult bindExplicitConversionFromTypeVarToAggregate(AggregateType
775775
{
776776
return AggCastResult.Failure;
777777
}
778-
#if ! CSEE
779778
if (aggTypeDest.getAggregate().IsInterface())
780-
#else
781-
if ((exprSrc != null && !exprSrc.eeValue.substType.IsNullableType()) || aggTypeDest.getAggregate().IsInterface())
782-
#endif
783779
{
784780
// Explicit conversion of type variables to interfaces.
785781
if (_needsExprDest)

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,8 @@ internal Expr BindArrayIndexCore(BindingFlag bindFlags, Expr pOp1, Expr pOp2)
502502
Expr pTemp = mustConvert(x, pDestType);
503503
if (pDestType == pIntType)
504504
return pTemp;
505-
#if CSEE
506-
EXPRFLAG flag = 0;
507-
#else
508-
EXPRFLAG flag = EXPRFLAG.EXF_INDEXEXPR;
509-
#endif
510505
ExprClass exprType = GetExprFactory().MakeClass(pDestType);
511-
return GetExprFactory().CreateCast(flag, exprType, pTemp);
506+
return GetExprFactory().CreateCast(EXPRFLAG.EXF_INDEXEXPR, exprType, pTemp);
512507
});
513508

514509
if (cIndices != rank)

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,12 @@ private bool SearchSingleType(AggregateType typeCur, out bool pfHideByName)
287287
if (!_fMulti)
288288
{
289289
if (_swtFirst.Sym.IsFieldSymbol() && symCur.IsEventSymbol()
290-
#if !CSEE // The isEvent bit is only set on symbols which come from source...
290+
// The isEvent bit is only set on symbols which come from source...
291291
// This is not a problem for the compiler because the field is only
292292
// accessible in the scope in which it is declared,
293293
// but in the EE we ignore accessibility...
294294
&& _swtFirst.Field().isEvent
295-
#endif
296-
)
295+
)
297296
{
298297
// m_swtFirst is just the field behind the event symCur so ignore symCur.
299298
continue;

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Operators.cs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,12 +1437,7 @@ private UnaryOperatorSignatureFindResult PopulateSignatureList(Expr pArgument, U
14371437
}
14381438

14391439
// Check for user defined inc/dec
1440-
#if !CSEE
14411440
ExprMultiGet exprGet = GetExprFactory().CreateMultiGet(0, pArgumentType, null);
1442-
#else // CSEE
1443-
1444-
Expr exprGet = pArgument;
1445-
#endif // CSEE
14461441

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

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

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

18241817
Debug.Assert(arg != null);
1825-
#if ! CSEE
18261818
ExprMultiGet exprGet = GetExprFactory().CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.Type, null);
18271819
Expr exprVal = exprGet;
1828-
#else
1829-
Expr exprVal = arg;
1830-
#endif
1831-
18321820
CType type = uofs.GetType();
18331821
Debug.Assert(!type.IsNullableType());
18341822

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

18451833
ExprMulti exprMulti = GetExprFactory().CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.Type, arg, op);
1846-
1847-
#if ! CSEE
18481834
exprGet.OptionalMulti = exprMulti;
1849-
#endif
18501835
return exprMulti;
18511836
}
18521837

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

1861-
#if ! CSEE
18621846
ExprMultiGet exprGet = GetExprFactory().CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.Type, null);
18631847
Expr exprVal = exprGet;
1864-
#else
1865-
Expr exprVal = arg;
1866-
#endif
1867-
1868-
Expr nonLiftedResult = null;
18691848
Expr nonLiftedArg = exprVal;
18701849

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

18811860
ExprMulti exprMulti = GetExprFactory().CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.Type, arg, exprRes);
1882-
1883-
#if ! CSEE
18841861
exprGet.OptionalMulti = exprMulti;
1885-
#endif
18861862
return exprMulti;
18871863
}
18881864

@@ -1923,15 +1899,6 @@ private ExprBinOp BindDecBinOp(ExpressionKind ek, EXPRFLAG flags, Expr arg1, Exp
19231899
break;
19241900
}
19251901

1926-
#if CSEE
1927-
// In the EE, we want to emit an EXPRBINOP with the
1928-
// right EK so that when we evalsync we can just do the work ourselves instead of
1929-
// delegating to method calls.
1930-
1931-
return GetExprFactory().CreateBinop(tree, ek, typeRet, arg1, arg2);
1932-
1933-
#endif // CSEE
1934-
19351902
return GetExprFactory().CreateBinop(ek, typeRet, arg1, arg2);
19361903
}
19371904

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/Symbol.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ internal enum KAID
1818
kaidNil = -1,
1919

2020
kaidGlobal = 0,
21-
kaidErrorAssem, // NOTE: !CSEE only
2221
kaidThisAssembly,
2322
kaidUnresolved,
2423
kaidStartAssigning,
@@ -395,7 +394,6 @@ public InputFile getInputFile()
395394

396395
case SYMKIND.SK_AggregateSymbol:
397396
{
398-
#if !CSEE
399397
AggregateSymbol AggregateSymbol = this.AsAggregateSymbol();
400398
if (!AggregateSymbol.IsSource())
401399
return AggregateSymbol.DeclOnly().getInputFile();
@@ -404,7 +402,6 @@ public InputFile getInputFile()
404402
// files, getInputFile isn't a reasonable operation.
405403
Debug.Assert(false);
406404
return null;
407-
#endif
408405
}
409406

410407
/*

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/AggregateType.cs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,9 @@ internal partial class AggregateType : CType
1919
private TypeArray _pTypeArgsAll; // includes args from outer types
2020
private AggregateSymbol _pOwningAggregate;
2121

22-
#if ! CSEE // The EE can't cache these since the AGGSYMs may change as things are imported.
2322
private AggregateType _baseType; // This is the result of calling SubstTypeArray on the aggregate's baseClass.
2423
private TypeArray _ifacesAll; // This is the result of calling SubstTypeArray on the aggregate's ifacesAll.
2524
private TypeArray _winrtifacesAll; //This is the list of collection interfaces implemented by a WinRT object.
26-
#else // !CSEE
27-
28-
public short proxyOID; // oid for the managed proxy in the host running inside the debugee
29-
public short typeConverterID;
30-
#endif // !CSEE
3125

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

5246
public AggregateType GetBaseClass()
5347
{
54-
#if CSEE
55-
AggregateType atsBase = getAggregate().GetBaseClass();
56-
if (!atsBase || GetTypeArgsAll().size == 0 || atsBase.GetTypeArgsAll().size == 0)
57-
return atsBase;
58-
59-
return getAggregate().GetTypeManager().SubstType(atsBase, GetTypeArgsAll()).AsAggregateType();
60-
#else // !CSEE
61-
62-
if (_baseType == null)
63-
{
64-
_baseType = getAggregate().GetTypeManager().SubstType(getAggregate().GetBaseClass(), GetTypeArgsAll()) as AggregateType;
65-
}
66-
67-
return _baseType;
68-
#endif // !CSEE
48+
return _baseType ??
49+
(_baseType = getAggregate().GetTypeManager().SubstType(getAggregate().GetBaseClass(), GetTypeArgsAll()) as AggregateType);
6950
}
7051

7152
public void SetTypeArgsThis(TypeArray pTypeArgsThis)

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/PredefinedTypes.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ public bool Init(ErrorHandling errorContext, SymbolTable symtable)
5151
{
5252
_runtimeBinderSymbolTable = symtable;
5353
Debug.Assert(_pBSymmgr != null);
54-
55-
#if !CSEE
5654
Debug.Assert(_predefSyms == null);
57-
#else // CSEE
58-
Debug.Assert(predefSyms == null || aidMsCorLib != KAID.kaidNil);
59-
#endif // CSEE
6055

6156
if (_aidMsCorLib == KAID.kaidNil)
6257
{

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/Type.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,6 @@ public void InitFromParent()
308308

309309
_fHasErrors = typePar.HasErrors();
310310
_fUnres = typePar.IsUnresolved();
311-
#if CSEE
312-
313-
this.typeRes = this;
314-
if (!this.fUnres)
315-
this.tsRes = ktsImportMax;
316-
this.fDirty = typePar.fDirty;
317-
this.tsDirty = typePar.tsDirty;
318-
#endif // CSEE
319311
}
320312

321313
public bool HasErrors()

src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeFactory.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ public TypeParameterType CreateTypeParameter(TypeParameterSymbol pSymbol)
3434
type.SetTypeParameterSymbol(pSymbol);
3535
type.SetUnresolved(pSymbol.parent != null && pSymbol.parent.IsAggregateSymbol() && pSymbol.parent.AsAggregateSymbol().IsUnresolved());
3636
type.SetName(pSymbol.name);
37-
38-
#if CSEE
39-
type.typeRes = type;
40-
if (!type.IsUnresolved())
41-
{
42-
type.tsRes = ktsImportMax;
43-
}
44-
#endif // CSEE
45-
4637
Debug.Assert(pSymbol.GetTypeParameterType() == null);
4738
pSymbol.SetTypeParameterType(type);
4839

0 commit comments

Comments
 (0)