/// <summary> /// May introduce a temp which it will return. (otherwise returns null) /// </summary> private LocalDefinition EmitDupAddress(BoundDup dup, AddressKind addressKind) { if (!HasHome(dup, addressKind)) { return(EmitAddressOfTempClone(dup)); } _builder.EmitOpCode(ILOpCode.Dup); return(null); }
/// <summary> /// May introduce a temp which it will return. (otherwise returns null) /// </summary> private LocalDefinition EmitDupAddress(BoundDup dup, AddressKind addressKind) { if (!HasHome(dup, needWriteable: addressKind != AddressKind.ReadOnly)) { return(EmitAddressOfTempClone(dup)); } _builder.EmitOpCode(ILOpCode.Dup); return(null); }
internal SubsumptionDiagnosticBuilder(Symbol enclosingSymbol, SwitchStatementSyntax syntax, Conversions conversions, TypeSymbol switchGoverningType) : base(enclosingSymbol, syntax, conversions) { // For the purpose of computing subsumption, we ignore the input expression's constant // value. Therefore we create a fake expression here that doesn't contain the value. var placeholderExpression = new BoundDup(syntax, RefKind.None, switchGoverningType); _subsumptionTree = CreateEmptyDecisionTree(placeholderExpression); }
private void EmitDupExpression(BoundDup expression, bool used) { if (expression.RefKind == RefKind.None) { // unused dup is noop if (used) { _builder.EmitOpCode(ILOpCode.Dup); } } else { _builder.EmitOpCode(ILOpCode.Dup); // must read in case if it is a null ref EmitLoadIndirect(expression.Type, expression.Syntax); EmitPopIfUnused(used); } }