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