67 references to Create
Microsoft.CodeAnalysis (7)
Compilation\Expression.cs (1)
14
return ConstantValue.
Create
(value);
ConstantValue.cs (2)
365
return (size == 0) ? ConstantValue.NotAvailable : ConstantValue.
Create
(size);
377
case ConstantValueTypeDiscriminator.Int32: return
Create
((int)value);
EnumConstantHelper.cs (1)
76
offsetValue = ConstantValue.
Create
((int)(previous + offset));
MetadataReader\MetadataDecoder.cs (1)
1087
return ConstantValue.
Create
(sigReader.ReadInt32());
MetadataReader\PEModule.cs (1)
3725
return ConstantValue.
Create
(reader.ReadInt32());
Operations\ControlFlowGraphBuilder.cs (1)
5244
constantValue: ConstantValue.
Create
(bits), isImplicit: true);
Microsoft.CodeAnalysis.CSharp (31)
Binder\Binder_Expressions.cs (3)
4483
ConstantValue.
Create
(knownSizes[i] ?? 0),
4708
ConstantValue.
Create
(boundInitExprOpt.Length),
5322
lengthOrCount = new BoundLiteral(expression.Syntax, ConstantValue.
Create
(length), @this.GetSpecialType(SpecialType.System_Int32, diagnostics, expression.Syntax)) { WasCompilerGenerated = true };
Binder\Binder_InterpolatedString.cs (2)
820
argumentsBuilder.Add(new BoundLiteral(syntax, ConstantValue.
Create
(baseStringLength), intType) { WasCompilerGenerated = true });
822
argumentsBuilder.Add(new BoundLiteral(syntax, ConstantValue.
Create
(numFormatHoles), intType) { WasCompilerGenerated = true });
Binder\Binder_Invocation.cs (2)
1686
defaultValue = new BoundLiteral(syntax, ConstantValue.
Create
(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
1782
BoundExpression arraySize = new BoundLiteral(node, ConstantValue.
Create
(collectionArgs.Length), int32Type) { WasCompilerGenerated = true };
Binder\Binder_Operators.cs (1)
4531
return new BoundLiteral(node, ConstantValue.
Create
((int)-2147483648), GetSpecialType(SpecialType.System_Int32, diagnostics, node));
Binder\DecisionDagBuilder.cs (3)
343
tests.Add(new Tests.One(new BoundDagValueTest(syntax, ConstantValue.
Create
(patternLength), lengthTemp)));
1502
(conditions ??= ArrayBuilder<Tests>.GetInstance()).Add(new Tests.One(new BoundDagValueTest(syntax, ConstantValue.
Create
(lengthValue), s1LengthTemp)));
2271
return ConstantValue.
Create
(offset > (int.MaxValue - value) ? int.MaxValue : value + offset);
Binder\DecisionDagBuilder_ListPatterns.cs (2)
46
? new BoundDagRelationalTest(syntax, BinaryOperatorKind.IntGreaterThanOrEqual, ConstantValue.
Create
(subpatterns.Length - 1), lengthTemp)
47
: new BoundDagValueTest(syntax, ConstantValue.
Create
(subpatterns.Length), lengthTemp)));
Binder\PatternExplainer.cs (2)
676
if (remainingValues.Any(BinaryOperatorKind.GreaterThan, ConstantValue.
Create
(int.MaxValue)))
679
if (remainingValues.Any(BinaryOperatorKind.LessThan, ConstantValue.
Create
(int.MinValue)))
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1757
BoundLiteral intMaxValueLiteral = new BoundLiteral(syntaxNode, ConstantValue.
Create
(int.MaxValue), expectedAttributeType);
CodeGen\EmitStatement.cs (1)
1410
lengthBasedSwitchInfo.LengthBasedJumpTable.LengthCaseLabels.Select(p => new KeyValuePair<ConstantValue, object>(ConstantValue.
Create
(p.value), p.label)).ToArray(),
Compiler\MethodBodySynthesizer.cs (3)
106
ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.
Create
(slotIndex), intType) { WasCompilerGenerated = true }),
126
ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.
Create
(0), intType) { WasCompilerGenerated = true }),
154
ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.
Create
(targetSubmissionIndex), intType) { WasCompilerGenerated = true }),
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (2)
2167
loweredRight = MakeLiteral(rightSyntax, ConstantValue.
Create
(shiftAmount), rightType);
2180
MakeLiteral(rightSyntax, ConstantValue.
Create
(rightMask), rightType),
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
1422
ConstantValue.
Create
(0),
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
750
ConstantValue.
Create
(knownLength),
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
1252
constantValue: ConstantValue.
Create
(1),
Lowering\LocalRewriter\LocalRewriter_Literal.cs (1)
100
arguments.Add(new BoundLiteral(syntax, ConstantValue.
Create
((int)value), _compilation.GetSpecialType(SpecialType.System_Int32)));
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
1252
constantOne = ConstantValue.
Create
(1);
1264
constantOne = ConstantValue.
Create
(1);
Lowering\SyntheticBoundNodeFactory.cs (2)
728
return new BoundLiteral(Syntax, ConstantValue.
Create
(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true };
1105
caseBuilder.Add((ConstantValue.
Create
(value), sectionLabel));
Utilities\ValueSetFactory.IntTC.cs (1)
67
public ConstantValue ToConstantValue(int value) => ConstantValue.
Create
(value);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\ConstantTests.cs (3)
2301
ConstantValue nonNullValue = ConstantValue.
Create
(10);
4008
byteConst = ConstantValue.
Create
(0x4),
4012
int32Const = ConstantValue.
Create
(unchecked((int)uint.MaxValue)),
Semantics\NamedAndOptionalTests.cs (6)
2061
Assert.Equal(ConstantValue.
Create
(0), parameters[1].ExplicitDefaultConstantValue);
2067
Assert.Equal(ConstantValue.
Create
(1), parameters[2].ExplicitDefaultConstantValue);
2080
Assert.Equal(ConstantValue.
Create
(0), parameters[4].ExplicitDefaultConstantValue);
2087
Assert.Equal(ConstantValue.
Create
(1), parameters[5].ExplicitDefaultConstantValue);
2093
Assert.Equal(ConstantValue.
Create
(0), parameters[6].ExplicitDefaultConstantValue);
2099
Assert.Equal(ConstantValue.
Create
(1), parameters[7].ExplicitDefaultConstantValue);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (12)
Compilation\GetSemanticInfoTests.cs (12)
920
EnumOffset(ConstantValue.
Create
((int)int.MinValue), 1, EnumOverflowKind.NoOverflow, ConstantValue.
Create
((int)(int.MinValue + 1)));
921
EnumOffset(ConstantValue.
Create
((int)int.MinValue), 2, EnumOverflowKind.NoOverflow, ConstantValue.
Create
((int)(int.MinValue + 2)));
922
EnumOffset(ConstantValue.
Create
((int)-2), 1, EnumOverflowKind.NoOverflow, ConstantValue.
Create
((int)(-1)));
923
EnumOffset(ConstantValue.
Create
((int)-2), 3, EnumOverflowKind.NoOverflow, ConstantValue.
Create
((int)(1)));
924
EnumOffset(ConstantValue.
Create
((int)(int.MaxValue - 3)), 3, EnumOverflowKind.NoOverflow, ConstantValue.
Create
((int)int.MaxValue));
925
EnumOffset(ConstantValue.
Create
((int)(int.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad);
926
EnumOffset(ConstantValue.
Create
((int)(int.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
PDB\PdbHelpers.cs (1)
95
(SpecialType.System_Int32, int intVal) => ConstantValue.
Create
(intVal),
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
68
var constantValue = ConstantValue.
Create
(1);
Microsoft.CodeAnalysis.UnitTests (6)
CorLibTypesTests.cs (6)
97
var cv1 = ConstantValue.
Create
(1);
101
var cv2 = ConstantValue.
Create
(2);
118
var cv1 = ConstantValue.
Create
(1);
147
Assert.True(ConstantValue.
Create
((int)1).IsOne);
197
var cv51 = ConstantValue.
Create
(12345);
198
var cv52 = ConstantValue.
Create
(12345);