115 references to Create
Microsoft.CodeAnalysis (7)
Compilation\Expression.cs (1)
14return ConstantValue.Create(value);
ConstantValue.cs (2)
359return (size == 0) ? ConstantValue.NotAvailable : ConstantValue.Create(size); 373case 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)
3444return ConstantValue.Create(reader.ReadInt32());
Operations\ControlFlowGraphBuilder.cs (1)
5147constantValue: ConstantValue.Create(bits), isImplicit: true);
Microsoft.CodeAnalysis.CSharp (29)
Binder\Binder_Expressions.cs (2)
3764ConstantValue.Create(knownSizes[i] ?? 0), 3989ConstantValue.Create(boundInitExprOpt.Length),
Binder\Binder_InterpolatedString.cs (2)
674argumentsBuilder.Add(new BoundLiteral(syntax, ConstantValue.Create(baseStringLength), intType) { WasCompilerGenerated = true }); 676argumentsBuilder.Add(new BoundLiteral(syntax, ConstantValue.Create(numFormatHoles), intType) { WasCompilerGenerated = true });
Binder\Binder_Invocation.cs (1)
1377defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
Binder\Binder_Operators.cs (1)
3061return new BoundLiteral(node, ConstantValue.Create((int)-2147483648), GetSpecialType(SpecialType.System_Int32, diagnostics, node));
Binder\DecisionDagBuilder.cs (3)
340tests.Add(new Tests.One(new BoundDagValueTest(syntax, ConstantValue.Create(patternLength), lengthTemp))); 1453(conditions ??= ArrayBuilder<Tests>.GetInstance()).Add(new Tests.One(new BoundDagValueTest(syntax, ConstantValue.Create(lengthValue), s1LengthTemp))); 2117return ConstantValue.Create(offset > (int.MaxValue - value) ? int.MaxValue : value + offset);
Binder\DecisionDagBuilder_ListPatterns.cs (2)
45? new BoundDagRelationalTest(syntax, BinaryOperatorKind.IntGreaterThanOrEqual, ConstantValue.Create(subpatterns.Length - 1), lengthTemp) 46: 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)
1617BoundLiteral intMaxValueLiteral = new BoundLiteral(syntaxNode, ConstantValue.Create(int.MaxValue), expectedAttributeType);
CodeGen\EmitStatement.cs (1)
1385lengthBasedSwitchInfo.LengthBasedJumpTable.LengthCaseLabels.Select(p => new KeyValuePair<ConstantValue, object>(ConstantValue.Create(p.value), p.label)).ToArray(),
Compiler\MethodBodySynthesizer.cs (3)
105ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.Create(slotIndex), intType) { WasCompilerGenerated = true }), 125ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.Create(0), intType) { WasCompilerGenerated = true }), 153ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.Create(targetSubmissionIndex), intType) { WasCompilerGenerated = true }),
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (2)
2069loweredRight = MakeLiteral(rightSyntax, ConstantValue.Create(shiftAmount), rightType); 2082MakeLiteral(rightSyntax, ConstantValue.Create(rightMask), rightType),
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
1321BoundExpression arraySize = MakeLiteral(syntax, ConstantValue.Create(arrayArgs.Length), int32Type, localRewriter);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
1040constantValue: 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)
1076constantOne = ConstantValue.Create(1); 1088constantOne = ConstantValue.Create(1);
Lowering\SyntheticBoundNodeFactory.cs (2)
677return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true }; 1024caseBuilder.Add((ConstantValue.Create(value), sectionLabel));
Utilities\ValueSetFactory.IntTC.cs (1)
55public ConstantValue ToConstantValue(int value) => ConstantValue.Create(value);
Utilities\ValueSetFactory.NonNegativeIntTC.cs (1)
61return ConstantValue.Create(value);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (2)
Rewriters\LocalDeclarationRewriter.cs (1)
159var lengthExpr = new BoundLiteral(syntax, ConstantValue.Create(numBytes), intType);
Symbols\ReturnValueLocalSymbol.cs (1)
33Microsoft.CodeAnalysis.ConstantValue.Create(_index),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (9)
Semantics\ConstantTests.cs (3)
2301ConstantValue nonNullValue = ConstantValue.Create(10); 3989byteConst = ConstantValue.Create(0x4), 3993int32Const = 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 (3)
CorLibTypesTests.cs (3)
96var cv = ConstantValue.Create(1); 153var cv51 = ConstantValue.Create(12345); 154var cv52 = ConstantValue.Create(12345);
Microsoft.CodeAnalysis.VisualBasic (43)
Binding\Binder_Expressions.vb (2)
4111ConstantValue.Create(size.Size), 4387Dim one = New BoundLiteral(argumentSyntax, ConstantValue.Create(1), int32Type)
Binding\Binder_Invocation.vb (5)
1121Return ConstantValue.Create(AscW(argumentValue)) 1164Return ConstantValue.Create(charValue) 2724ConstantValue.Create(items.Count), 3127callerInfoValue = ConstantValue.Create(callerInfoOpt.SyntaxTree.GetDisplayLineNumber(GetCallerLocation(callerInfoOpt))) 3223defaultConstantValue = ConstantValue.Create(1)
Binding\Binder_Statements.vb (1)
3135ConstantValue.Create(1),
Binding\SyntheticBoundTrees\AnonymousTypeSyntheticMethods.vb (4)
131expression = New BoundLiteral(syntax, ConstantValue.Create(hashBase), integerType).MakeCompilerGenerated() 133Dim factorLiteral = New BoundLiteral(syntax, ConstantValue.Create(&HA5555529), integerType).MakeCompilerGenerated() 134Dim zeroLiteral = New BoundLiteral(syntax, ConstantValue.Create(0), integerType).MakeCompilerGenerated() 367New BoundLiteral(syntax, ConstantValue.Create(numberOfFields),
Binding\SyntheticBoundTrees\SynthesizedStringSwitchHashMethod.vb (2)
102F.Assignment(F.Local(i, True), New BoundLiteral(Me.Syntax, ConstantValue.Create(0), i.Type)), 116New BoundLiteral(Me.Syntax, ConstantValue.Create(1), i.Type))),
CodeGen\EmitOperators.vb (2)
313_builder.EmitConstantValue(ConstantValue.Create(shiftMax)) 328_builder.EmitConstantValue(ConstantValue.Create(shiftMax))
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.vb (1)
490If(midResult.LengthOpt, New BoundLiteral(node.Syntax, ConstantValue.Create(&H7FFFFFFF), midResult.Start.Type)),
Lowering\LocalRewriter\LocalRewriter_BinaryOperators.vb (4)
496New BoundLiteral(node.Syntax, ConstantValue.Create(0I), memberSymbol.ReturnType), 535New BoundLiteral(node.Syntax, ConstantValue.Create(0I), memberSymbol.ReturnType), 710compare, New BoundLiteral(node.Syntax, ConstantValue.Create(0I), memberSymbol.ReturnType), 770New BoundLiteral(node.Syntax, ConstantValue.Create(If(compareText, 1I, 0I)), memberSymbol.Parameters(2).Type)),
Lowering\LocalRewriter\LocalRewriter_Constant.vb (3)
126New BoundLiteral(node.Syntax, ConstantValue.Create(UncheckedCInt(low)), decCtor.Parameters(0).Type), 127New BoundLiteral(node.Syntax, ConstantValue.Create(UncheckedCInt(mid)), decCtor.Parameters(1).Type), 128New BoundLiteral(node.Syntax, ConstantValue.Create(UncheckedCInt(high)), decCtor.Parameters(2).Type),
Lowering\LocalRewriter\LocalRewriter_ForEach.vb (1)
391New BoundLiteral(syntaxNode, ConstantValue.Create(1), expressionType),
Lowering\LocalRewriter\LocalRewriter_ForTo.vb (1)
635Dim shiftConst = New BoundLiteral(value.Syntax, ConstantValue.Create(bits), int32Type)
Lowering\LocalRewriter\LocalRewriter_Label.vb (1)
31New BoundLiteral(node.Syntax, ConstantValue.Create(lineNumber), _currentLineTemporary.Type),
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (9)
75Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(flags.Length), intType) 115Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(rewrittenArguments.Length), intType) 143Dim indexExpr As BoundExpression = New BoundLiteral(node, ConstantValue.Create(indexVal), intType) 204Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(rewrittenArguments.Length + 1), intType) 254Dim indexExpr As BoundExpression = New BoundLiteral(node, ConstantValue.Create(index), intType) 280Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(rewrittenArguments.Length), intType) 329Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(initializer.Initializers.Length), intType) 347Dim index As BoundExpression = New BoundLiteral(syntax, ConstantValue.Create(argNum), intType) 953Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(types.Length), intType)
Lowering\LocalRewriter\LocalRewriter_XmlLiterals.vb (2)
260ConstantValue.Create(rewrittenCallArguments.Length), 350Dim size = (New BoundLiteral(syntax, ConstantValue.Create(items.Length), GetSpecialType(SpecialType.System_Int32))).MakeCompilerGenerated()
Lowering\SyntheticBoundNodeFactory.vb (1)
445Dim boundNode = New BoundLiteral(_syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32))
Semantics\CompileTimeCalculations.vb (1)
171Case ConstantValueTypeDiscriminator.Int32 : result = ConstantValue.Create(UncheckedCInt(value))
Symbols\Source\SynthesizedSubmissionConstructorSymbol.vb (3)
79New BoundArrayAccess(syntax, submissionArrayReference, ImmutableArray.Create(Of BoundExpression)(New BoundLiteral(syntax, ConstantValue.Create(slotIndex), intType)), isLValue:=True, type:=objectType), 93New BoundArrayAccess(syntax, submissionArrayReference, ImmutableArray.Create(Of BoundExpression)(New BoundLiteral(syntax, ConstantValue.Create(0), intType)), isLValue:=False, type:=objectType), 113New BoundArrayAccess(syntax, submissionArrayReference, ImmutableArray.Create(Of BoundExpression)(New BoundLiteral(syntax, ConstantValue.Create(targetSubmissionId), intType)), isLValue:=False, type:=objectType),
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler (1)
Symbols\ReturnValueLocalSymbol.vb (1)
37Microsoft.CodeAnalysis.ConstantValue.Create(_index),
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (6)
Semantics\Conversions.vb (1)
103Dim intZero = New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.Create(0I), m13p(c))
Semantics\OptionalArgumentTests.vb (2)
2216Assert.Equal(ConstantValue.Create(0), parameters(1).ExplicitDefaultConstantValue) 2222Assert.Equal(ConstantValue.Create(1), parameters(2).ExplicitDefaultConstantValue)
Semantics\OverloadResolution.vb (3)
194Dim intZero As BoundExpression = New BoundLiteral(_syntaxNode, ConstantValue.Create(0I), c1.GetSpecialType(System_Int32)) 2884Dim IntegerMaxValue As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.Null, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(Integer.MaxValue), c1.GetSpecialType(System_Int32), Nothing) 3075Dim IntegerMaxValue As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.Null, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(Integer.MaxValue), c1.GetSpecialType(System_Int32), Nothing)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
SymbolsTests\Source\PropertyTests.vb (1)
7140Dim defaultValue = ConstantValue.Create(1)