45 references to GetConstantValue
Microsoft.CodeAnalysis (43)
Operations\ControlFlowGraphBuilder.cs (41)
284
if (current.BranchValue.
GetConstantValue
() is { IsBoolean: true, BooleanValue: bool constant })
2114
return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2242
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2268
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
2463
semanticModel: null, binOp.Syntax, binOp.Type, binOp.
GetConstantValue
(), isImplicit: true);
2561
binOp.
GetConstantValue
(),
2651
binOp.
GetConstantValue
(), IsImplicit(binOp))));
2750
lastUnary.Type, lastUnary.
GetConstantValue
(), IsImplicit(lastUnary))
3246
constantValue: operation.
GetConstantValue
(),
3278
operation.Syntax, operation.Type, constantValue: operation.
GetConstantValue
(), isImplicit: true);
3325
ConstantValue? constantValue = operand.
GetConstantValue
() is { IsNull: var isNull }
4925
else if (!(operation.StepValue.
GetConstantValue
() is { IsBad: false }) &&
5098
else if (operation.StepValue.
GetConstantValue
() is { IsBad: false } value)
5457
return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.Type, underlying.
GetConstantValue
());
5999
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6108
assignmentOperation.Type, assignmentOperation.
GetConstantValue
(), IsImplicit(assignmentOperation));
6245
fieldReference.Syntax, fieldReference.Type, fieldReference.
GetConstantValue
(), IsImplicit(fieldReference));
6415
semanticModel: null, simpleAssignment.Syntax, simpleAssignment.Type, simpleAssignment.
GetConstantValue
(), IsImplicit(simpleAssignment));
6634
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
());
6794
return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6800
new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
6923
return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.Type, operation.
GetConstantValue
());
7004
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isInitialization: true);
7018
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
7032
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
7119
return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7134
Debug.Assert(operation.
GetConstantValue
() != null);
7135
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7140
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7151
operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7164
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7217
return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7227
return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7466
return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7471
return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7515
operation.
GetConstantValue
(), IsImplicit(operation));
7538
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(invalidOperation));
7545
invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(operation)));
8055
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
8076
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
8086
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)
2445
ConstantValue? sourceConstantValue = source.
GetConstantValue
();
Operations\CSharpOperationFactory_Methods.cs (1)
467
var assignment = new SimpleAssignmentOperation(isRef, target, value, _semanticModel, assignmentSyntax, assignmentType, value.
GetConstantValue
(), isImplicitAssignment);