3 overrides of Int32Value
Microsoft.CodeAnalysis (3)
ConstantValueSpecialized.cs (3)
587public override int Int32Value 802public override int Int32Value 889public override int Int32Value
136 references to Int32Value
Microsoft.CodeAnalysis (12)
CodeGen\ILBuilderEmit.cs (2)
592EmitIntConstant(value.Int32Value); 599EmitNativeIntConstant(value.Int32Value);
CodeGen\SwitchIntegralJumpTableEmitter.cs (1)
487default: return value.Int32Value;
ConstantValue.cs (6)
69public virtual long Int64Value { get { return Int32Value; } } 525case ConstantValueTypeDiscriminator.Int32: return Boxes.Box(Int32Value); 529case ConstantValueTypeDiscriminator.NInt: return Boxes.Box(Int32Value); 584return Int32Value < 0; 786writer.WriteInt32(this.Int32Value); 823ConstantValueTypeDiscriminator.NInt or ConstantValueTypeDiscriminator.Int32 => Int32Value.ToString(provider),
ConstantValueSpecialized.cs (2)
825return base.Equals(other) && _value == other.Int32Value; 912return base.Equals(other) && _value == other.Int32Value;
EnumConstantHelper.cs (1)
72long previous = constantValue.Int32Value;
Microsoft.CodeAnalysis.CSharp (123)
Binder\Binder_Conversions.cs (4)
4094int int32Value = value.Int32Value; 4134int nintValue = value.Int32Value; 4289case ConstantValueTypeDiscriminator.Int32: return (decimal)value.Int32Value; 4291case ConstantValueTypeDiscriminator.NInt: return (decimal)value.Int32Value;
Binder\Binder_Expressions.cs (6)
4813return constantValue.Int32Value; 4834return constantValue.Int32Value < 0; 9788if (convertedIndex.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex }) 9870if (hatExpression.Operand.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex }) 9876else if (convertedIndex is BoundConversion { Operand: { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex } } operand }) 9883arguments[0] is { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex1 } } index &&
Binder\Binder_InterpolatedString.cs (2)
107int alignmentValue = alignmentConstant.Int32Value; 112diagnostics.Add(ErrorCode.WRN_AlignmentMagnitude, alignment.Syntax.Location, alignmentConstant.Int32Value, magnitudeLimit);
Binder\Binder_Operators.cs (76)
2499return valueLeft.Int32Value + valueRight.Int32Value; 2503return valueLeft.Int32Value - valueRight.Int32Value; 2507return valueLeft.Int32Value * valueRight.Int32Value; 2511return valueLeft.Int32Value / valueRight.Int32Value; 2513return valueLeft.Int32Value % valueRight.Int32Value; 2516var int32Value = valueLeft.Int32Value << valueRight.Int32Value; 2517var int64Value = valueLeft.Int64Value << valueRight.Int32Value; 2522var uint32Value = valueLeft.UInt32Value << valueRight.Int32Value; 2523var uint64Value = valueLeft.UInt64Value << valueRight.Int32Value; 2542return valueLeft.Int32Value + valueRight.Int32Value; 2550return valueLeft.Int32Value - valueRight.Int32Value; 2558return valueLeft.Int32Value * valueRight.Int32Value; 2568if (valueLeft.Int32Value == int.MinValue && valueRight.Int32Value == -1) 2573return valueLeft.Int32Value / valueRight.Int32Value; 2598return valueLeft.Int32Value + valueRight.Int32Value; 2606return valueLeft.Int32Value - valueRight.Int32Value; 2614return valueLeft.Int32Value * valueRight.Int32Value; 2622return valueLeft.Int32Value / valueRight.Int32Value; 2981return valueLeft.Int32Value << valueRight.Int32Value; 2983return valueLeft.Int64Value << valueRight.Int32Value; 2985return valueLeft.UInt32Value << valueRight.Int32Value; 2987return valueLeft.UInt64Value << valueRight.Int32Value; 2990return valueLeft.Int32Value >> valueRight.Int32Value; 2992return (int)(((uint)valueLeft.Int32Value) >> valueRight.Int32Value); // Switch to `valueLeft.Int32Value >>> valueRight.Int32Value` once >>> becomes available 2994return (valueLeft.Int32Value >= 0) ? valueLeft.Int32Value >> valueRight.Int32Value : null; 2996return valueLeft.Int64Value >> valueRight.Int32Value; 2998return (long)(((ulong)valueLeft.Int64Value) >> valueRight.Int32Value); // Switch to `valueLeft.Int64Value >>> valueRight.Int32Value` once >>> becomes available 3003return valueLeft.UInt32Value >> valueRight.Int32Value; 3006return valueLeft.UInt64Value >> valueRight.Int32Value; 3011return valueLeft.Int32Value & valueRight.Int32Value; 3023return valueLeft.Int32Value | valueRight.Int32Value; 3035return valueLeft.Int32Value ^ valueRight.Int32Value; 3059return valueLeft.Int32Value == valueRight.Int32Value; 3079return valueLeft.Int32Value != valueRight.Int32Value; 3095return valueLeft.Int32Value < valueRight.Int32Value; 3111return valueLeft.Int32Value > valueRight.Int32Value; 3127return valueLeft.Int32Value <= valueRight.Int32Value; 3143return valueLeft.Int32Value >= valueRight.Int32Value; 3159return (valueRight.Int32Value != -1) ? valueLeft.Int32Value % valueRight.Int32Value : 0; 4543return +value.Int32Value; 4550return ~value.Int32Value; 4571return -value.Int32Value; 4587return -value.Int32Value; 4601return -value.Int32Value; 4741return valueRight.Int32Value == 0;
Binder\DecisionDagBuilder.cs (3)
3468Debug.Assert(t.Value.Int32Value >= 0); 3469if (t.Value.Int32Value == 0) 3508int value = constant.Int32Value;
Binder\PatternExplainer.cs (1)
461int lengthValue = lengthValues.Sample.Int32Value;
Binder\Semantics\Conversions\ConversionsBase.cs (2)
1383int value = constantValue.IsBad ? 0 : constantValue.Int32Value; 2094return value.Int32Value == 0;
Binder\SwitchBinder.cs (1)
294return new System.IntPtr(constantValue.Int32Value);
CodeGen\EmitArrayInitializer.cs (1)
531lengthForConstructor = length.ConstantValueOpt.Int32Value;
FlowAnalysis\DefiniteAssignment.cs (1)
1548(elementAccess.Argument.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: 0 } ||
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
797cases = node.Cases.SelectAsArray(p => (ConstantValue.Create((long)p.value.Int32Value), p.label));
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (5)
2162int shiftAmount = rightConstantValue.Int32Value & rightMask; 2237&& rightConstantValue.Int32Value is >= 0 and <= 0x1F) 2240int shiftAmount = rightConstantValue.Int32Value; 2338if (sizeOfExpression.ConstantValueOpt?.Int32Value == 1) 2360if (constVal == null || constVal.Int32Value < 0)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (8)
336rangeSizeExpr.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: >= 0 and int rangeSizeConst } && 364return expr.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: 0 }; 372makeOffsetInput is { ConstantValueOpt.Int32Value: var offset }) 408if (index.ConstantValueOpt is { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex }) 725if (loweredExpr.ConstantValueOpt?.Int32Value == 0) 1154if (startExpr.ConstantValueOpt?.Int32Value == 0) 1158else if (startExpr.ConstantValueOpt is { Int32Value: var startConst } && endExpr.ConstantValueOpt is { Int32Value: var endConst })
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (4)
31if (rewrittenCount.ConstantValueOpt?.Int32Value == 0) 122int size = sizeConst.Int32Value; 129var count = countConst.Int32Value; 143if (sizeConst?.Int32Value == 1)
Symbols\Compilation_WellKnownMembers.cs (4)
756int constantVal = ignoreSymbolStoreDebuggingMode.GetConstantValue(ConstantFieldsInProgress.Empty, earlyDecodingWellKnownAttributes: false).Int32Value; 778constantVal |= defaultDebuggingMode.GetConstantValue(ConstantFieldsInProgress.Empty, earlyDecodingWellKnownAttributes: false).Int32Value; 779constantVal |= disableOptimizationsDebuggingMode.GetConstantValue(ConstantFieldsInProgress.Empty, earlyDecodingWellKnownAttributes: false).Int32Value; 790constantVal |= enableEncDebuggingMode.GetConstantValue(ConstantFieldsInProgress.Empty, earlyDecodingWellKnownAttributes: false).Int32Value;
Symbols\Source\SourceFixedFieldSymbol.cs (1)
105int int32Value = sizeConstant.Int32Value;
Utilities\ValueSetFactory.IntTC.cs (1)
65public int FromConstantValue(ConstantValue constantValue) => constantValue.IsBad ? 0 : constantValue.Int32Value;
Utilities\ValueSetFactory.NintValueSet.cs (2)
74bool IConstantValueSet.All(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || All(relation, value.Int32Value); 85bool IConstantValueSet.Any(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || Any(relation, value.Int32Value);
Microsoft.CodeAnalysis.UnitTests (1)
CorLibTypesTests.cs (1)
129Assert.Equal(1, cv1.Int32Value);