58 instantiations of BoundLiteral
Microsoft.CodeAnalysis.CSharp (50)
Binder\Binder_Await.cs (1)
369var receiver = new BoundLiteral(node, ConstantValue.Null, awaiterType);
Binder\Binder_Expressions.cs (3)
3762sizeArray[i] = new BoundLiteral( 3987sizeOpt = new BoundLiteral( 6270return new BoundLiteral(node, cv, type);
Binder\Binder_InterpolatedString.cs (4)
137format = new BoundLiteral(interpolation.FormatClause, ConstantValue.Create(text), stringType, hasErrors); 168builder.Add(new BoundLiteral(content, constantValue, stringType)); 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 (5)
1377defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 1382defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1387defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1396defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1419defaultValue = new BoundLiteral(syntax, defaultConstantValue, constantType) { WasCompilerGenerated = true };
Binder\Binder_Operators.cs (3)
542return new BoundLiteral(node, ConstantValue.Create(kind == BinaryOperatorKind.Equal), GetSpecialType(SpecialType.System_Boolean, diagnostics, node)); 3061return new BoundLiteral(node, ConstantValue.Create((int)-2147483648), GetSpecialType(SpecialType.System_Int32, diagnostics, node)); 3076return new BoundLiteral(node, ConstantValue.Create(-9223372036854775808), GetSpecialType(SpecialType.System_Int64, diagnostics, node));
Binder\Binder_Statements.cs (1)
2214ConversionsBase.HasImplicitConstantExpressionConversion(new BoundLiteral(syntax, ConstantValue.Bad, sourceType), targetType))
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1617BoundLiteral intMaxValueLiteral = new BoundLiteral(syntaxNode, ConstantValue.Create(int.MaxValue), expectedAttributeType);
Compilation\CSharpCompilation.cs (1)
2012var dumbInstance = new BoundLiteral(syntax, ConstantValue.Null, namedType);
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 }),
Generated\BoundNodes.xml.Generated.cs (1)
4210var result = new BoundLiteral(this.Syntax, constantValueOpt, type, this.HasErrors);
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
379_factory.Convert(operandType, new BoundLiteral(syntax, ConstantValue.Null, objectType)),
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
1342return new BoundLiteral(syntax, constantValue, type, constantValue.IsBad) { WasCompilerGenerated = true };
Lowering\LocalRewriter\LocalRewriter_Literal.cs (11)
47return new BoundLiteral(syntax, constantValue, type, hasErrors: constantValue.IsBad); 100arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((int)value), _compilation.GetSpecialType(SpecialType.System_Int32))); 106arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((uint)value), _compilation.GetSpecialType(SpecialType.System_UInt32))); 112arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((long)value), _compilation.GetSpecialType(SpecialType.System_Int64))); 118arguments.Add(new BoundLiteral(syntax, ConstantValue.Create((ulong)value), _compilation.GetSpecialType(SpecialType.System_UInt64))); 124arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(low), _compilation.GetSpecialType(SpecialType.System_Int32))); 125arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(mid), _compilation.GetSpecialType(SpecialType.System_Int32))); 126arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(high), _compilation.GetSpecialType(SpecialType.System_Int32))); 127arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(isNegative), _compilation.GetSpecialType(SpecialType.System_Boolean))); 128arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(scale), _compilation.GetSpecialType(SpecialType.System_Byte))); 148arguments.Add(new BoundLiteral(syntax, ConstantValue.Create(constantValue.DateTimeValue.Ticks), _compilation.GetSpecialType(SpecialType.System_Int64)));
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (3)
206return new BoundLiteral(expr.Syntax, ConstantValue.Null, expr.Type); 259return new BoundLiteral(left.Syntax, ConstantValue.Create(nullnull.Kind == BinaryOperatorKind.Equal), boolType); 569return new BoundLiteral(left.Syntax, ConstantValue.Create(operatorKind == BinaryOperatorKind.Equal), boolType);
Lowering\SyntheticBoundNodeFactory.cs (8)
672return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Byte)) { WasCompilerGenerated = true }; 677return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Int32)) { WasCompilerGenerated = true }; 685return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_UInt32)) { WasCompilerGenerated = true }; 690return new BoundLiteral(Syntax, value, type) { WasCompilerGenerated = true }; 1064return new BoundLiteral(Syntax, ConstantValue.Create(value), SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Boolean)) { WasCompilerGenerated = true }; 1076return new BoundLiteral(Syntax, stringConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_String)) { WasCompilerGenerated = true }; 1087return new BoundLiteral(Syntax, charConst, SpecialType(Microsoft.CodeAnalysis.SpecialType.System_Char)) { WasCompilerGenerated = true }; 1169BoundExpression nullLiteral = new BoundLiteral(syntax, ConstantValue.Null, type) { WasCompilerGenerated = true };
Symbols\ReducedExtensionMethodSymbol.cs (2)
139var thisArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, thisType) { WasCompilerGenerated = true }; 141var otherArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, otherArgumentType) { WasCompilerGenerated = true };
Symbols\Source\SourceComplexParameterSymbol.cs (1)
342new BoundLiteral(parameterSyntax, defaultValue, Type));
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (8)
Rewriters\LocalDeclarationRewriter.cs (5)
110var name = new BoundLiteral(syntax, ConstantValue.Create(local.Name), stringType); 133new BoundLiteral(syntax, value, guidConstructor.ContainingType)); 146return new BoundLiteral(syntax, ConstantValue.Null, byteArrayType); 156initializerExprs.Add(new BoundLiteral(syntax, ConstantValue.Create(b), byteType)); 159var lengthExpr = new BoundLiteral(syntax, ConstantValue.Create(numBytes), intType);
Symbols\ObjectAddressLocalSymbol.cs (1)
34var argument = new BoundLiteral(
Symbols\ObjectIdLocalSymbol.cs (1)
87var argument = new BoundLiteral(
Symbols\ReturnValueLocalSymbol.cs (1)
31var argument = new BoundLiteral(
73 references to BoundLiteral
Microsoft.CodeAnalysis.CSharp (68)
Binder\Binder_Await.cs (1)
369var receiver = new BoundLiteral(node, ConstantValue.Null, awaiterType);
Binder\Binder_Expressions.cs (2)
6217private BoundLiteral BindLiteralConstant(LiteralExpressionSyntax node, BindingDiagnosticBag diagnostics) 6651if (boundLeft.Kind == BoundKind.Literal && ((BoundLiteral)boundLeft).ConstantValueOpt == ConstantValue.Null)
Binder\Binder_InterpolatedString.cs (6)
98BoundLiteral? format = null; 298=> parts.All(p => p is BoundLiteral or BoundStringInsert { Value.Type.SpecialType: SpecialType.System_String, Alignment: null, Format: null }); 719Debug.Assert(part is BoundLiteral { Type: { SpecialType: SpecialType.System_String } }); 752Debug.Assert(part is BoundLiteral or BoundStringInsert); 783var boundLiteral = (BoundLiteral)part;
Binder\Binder_Operators.cs (2)
2667BoundLiteral constant = BindIntegralMinValConstants(node, operand, diagnostics); 3023private BoundLiteral BindIntegralMinValConstants(PrefixUnaryExpressionSyntax node, BoundExpression operand, BindingDiagnosticBag diagnostics)
Binder\Binder_TupleOperators.cs (1)
101case BoundLiteral _:
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1617BoundLiteral intMaxValueLiteral = new BoundLiteral(syntaxNode, ConstantValue.Create(int.MaxValue), expectedAttributeType);
BoundTree\BoundNode_Source.cs (1)
221case BoundLiteral literal:
BoundTree\BoundTreeVisitors.cs (1)
98return VisitLiteral(node as BoundLiteral, arg);
Compilation\CSharpCompilation.cs (1)
2012var dumbInstance = new BoundLiteral(syntax, ConstantValue.Null, namedType);
Compiler\AnonymousTypeMethodBodySynthesizer.cs (1)
201BoundLiteral boundHashFactor = null;
Compiler\MethodBodySynthesizer.Lowered.cs (1)
356ref BoundLiteral? boundHashFactor,
FlowAnalysis\AbstractFlowPass.cs (1)
1558public override BoundNode VisitLiteral(BoundLiteral node)
FlowAnalysis\NullableWalker.cs (1)
10671public override BoundNode? VisitLiteral(BoundLiteral node)
Generated\BoundNodes.xml.Generated.cs (17)
4206public BoundLiteral Update(ConstantValue? constantValueOpt, TypeSymbol? type) 4210var result = new BoundLiteral(this.Syntax, constantValueOpt, type, this.HasErrors); 7594public BoundStringInsert(SyntaxNode syntax, BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall, bool hasErrors = false) 7609public BoundLiteral? Format { get; } 7615public BoundStringInsert Update(BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall) 8731return VisitLiteral((BoundLiteral)node, arg); 9078public virtual R VisitLiteral(BoundLiteral node, A arg) => this.DefaultVisit(node, arg); 9306public virtual BoundNode? VisitLiteral(BoundLiteral node) => this.DefaultVisit(node); 9870public override BoundNode? VisitLiteral(BoundLiteral node) => null; 11046public override BoundNode? VisitLiteral(BoundLiteral node) 11607BoundLiteral? format = (BoundLiteral?)this.Visit(node.Format); 13005public override BoundNode? VisitLiteral(BoundLiteral node) 13012BoundLiteral updatedNode = node.Update(node.ConstantValueOpt, infoAndType.Type); 14139BoundLiteral? format = (BoundLiteral?)this.Visit(node.Format); 15382public override TreeDumperNode VisitLiteral(BoundLiteral node, object? arg) => new TreeDumperNode("literal", null, new TreeDumperNode[]
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
484var literal = operand as BoundLiteral;
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (1)
291BoundLiteral result = this.F.Literal(!finished);
Lowering\LocalRewriter\LocalRewriter_Literal.cs (2)
17public override BoundNode VisitLiteral(BoundLiteral node) 23private BoundExpression MakeLiteral(SyntaxNode syntax, ConstantValue constantValue, TypeSymbol? type, BoundLiteral? oldNodeOpt = null)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
244Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue != null); 313Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue is not null);
Lowering\SyntheticBoundNodeFactory.cs (12)
670public BoundLiteral Literal(byte value) 675public BoundLiteral Literal(int value) 680public BoundLiteral Literal(StateMachineState value) 683public BoundLiteral Literal(uint value) 688public BoundLiteral Literal(ConstantValue value, TypeSymbol type) 1062public BoundLiteral Literal(Boolean value) 1067public BoundLiteral Literal(string? value) 1073public BoundLiteral StringLiteral(ConstantValue stringConst) 1079public BoundLiteral StringLiteral(String stringValue) 1084public BoundLiteral CharLiteral(ConstantValue charConst) 1090public BoundLiteral CharLiteral(Char charValue) 1734var whenNull = kind == BinaryOperatorKind.NullableNullEqual ? Literal(true) : null;
Operations\CSharpOperationFactory.cs (8)
58return CreateBoundLiteralOperation((BoundLiteral)boundNode); 671internal ILiteralOperation CreateBoundLiteralOperation(BoundLiteral boundLiteral, bool @implicit = false) 1011Debug.Assert(!forceOperandImplicitLiteral || boundConversion.Operand is BoundLiteral); 1126? CreateBoundLiteralOperation((BoundLiteral)correctedConversionNode.Operand, @implicit: true) 2169builder.Add(CreateBoundInterpolatedStringTextOperation((BoundLiteral)part)); 2237BoundLiteral l => CreateBoundLiteralOperation(l, @implicit: true), 2238BoundConversion { Operand: BoundLiteral } c => CreateBoundConversionOperation(c, forceOperandImplicitLiteral: true), 2292private IInterpolatedStringTextOperation CreateBoundInterpolatedStringTextOperation(BoundLiteral boundNode)
Symbols\ReducedExtensionMethodSymbol.cs (3)
139var thisArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, thisType) { WasCompilerGenerated = true }; 141var otherArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, otherArgumentType) { WasCompilerGenerated = true }; 148var argument = (i == 0) ? thisArgumentValue : otherArgumentValue;
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (1)
94BoundLiteral? boundHashFactor = null;
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (5)
Rewriters\LocalDeclarationRewriter.cs (2)
110var name = new BoundLiteral(syntax, ConstantValue.Create(local.Name), stringType); 159var lengthExpr = new BoundLiteral(syntax, ConstantValue.Create(numBytes), intType);
Symbols\ObjectAddressLocalSymbol.cs (1)
34var argument = new BoundLiteral(
Symbols\ObjectIdLocalSymbol.cs (1)
87var argument = new BoundLiteral(
Symbols\ReturnValueLocalSymbol.cs (1)
31var argument = new BoundLiteral(