45 references to GetConstantValue
Microsoft.CodeAnalysis (43)
Operations\ControlFlowGraphBuilder.cs (41)
276
if (current.BranchValue.
GetConstantValue
() is { IsBoolean: true, BooleanValue: bool constant })
2106
return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2234
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2260
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
2455
semanticModel: null, binOp.Syntax, binOp.Type, binOp.
GetConstantValue
(), isImplicit: true);
2553
binOp.
GetConstantValue
(),
2643
binOp.
GetConstantValue
(), IsImplicit(binOp))));
2742
lastUnary.Type, lastUnary.
GetConstantValue
(), IsImplicit(lastUnary))
3238
constantValue: operation.
GetConstantValue
(),
3270
operation.Syntax, operation.Type, constantValue: operation.
GetConstantValue
(), isImplicit: true);
3317
ConstantValue? constantValue = operand.
GetConstantValue
() is { IsNull: var isNull }
4916
else if (!(operation.StepValue.
GetConstantValue
() is { IsBad: false }) &&
5089
else if (operation.StepValue.
GetConstantValue
() is { IsBad: false } value)
5448
return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.Type, underlying.
GetConstantValue
());
5990
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6099
assignmentOperation.Type, assignmentOperation.
GetConstantValue
(), IsImplicit(assignmentOperation));
6236
fieldReference.Syntax, fieldReference.Type, fieldReference.
GetConstantValue
(), IsImplicit(fieldReference));
6406
semanticModel: null, simpleAssignment.Syntax, simpleAssignment.Type, simpleAssignment.
GetConstantValue
(), IsImplicit(simpleAssignment));
6625
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
());
6785
return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6791
new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
6914
return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.Type, operation.
GetConstantValue
());
6995
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isInitialization: true);
7007
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
7020
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
7107
return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7122
Debug.Assert(operation.
GetConstantValue
() != null);
7123
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7128
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7139
operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7152
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7205
return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7215
return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7454
return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7459
return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7503
operation.
GetConstantValue
(), IsImplicit(operation));
7526
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(invalidOperation));
7533
invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(operation)));
8043
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
8064
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
8074
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
Operations\OperationCloner.cs (2)
21
return new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.
GetConstantValue
(), operation.IsImplicit);
47
return new InvalidOperation(VisitArray(((InvalidOperation)operation).Children), ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.
GetConstantValue
(), operation.IsImplicit);
Microsoft.CodeAnalysis.CSharp (2)
Compilation\CSharpCompilation.cs (1)
2425
ConstantValue? sourceConstantValue = source.
GetConstantValue
();
Operations\CSharpOperationFactory_Methods.cs (1)
467
var assignment = new SimpleAssignmentOperation(isRef, target, value, _semanticModel, assignmentSyntax, assignmentType, value.
GetConstantValue
(), isImplicitAssignment);