45 references to GetConstantValue
Microsoft.CodeAnalysis (43)
Operations\ControlFlowGraphBuilder.cs (41)
276
if (current.BranchValue.
GetConstantValue
() is { IsBoolean: true, BooleanValue: bool constant })
2104
return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2232
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2258
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
2453
semanticModel: null, binOp.Syntax, binOp.Type, binOp.
GetConstantValue
(), isImplicit: true);
2551
binOp.
GetConstantValue
(),
2641
binOp.
GetConstantValue
(), IsImplicit(binOp))));
2740
lastUnary.Type, lastUnary.
GetConstantValue
(), IsImplicit(lastUnary))
3236
constantValue: operation.
GetConstantValue
(),
3268
operation.Syntax, operation.Type, constantValue: operation.
GetConstantValue
(), isImplicit: true);
3315
ConstantValue? constantValue = operand.
GetConstantValue
() is { IsNull: var isNull }
4914
else if (!(operation.StepValue.
GetConstantValue
() is { IsBad: false }) &&
5087
else if (operation.StepValue.
GetConstantValue
() is { IsBad: false } value)
5446
return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.Type, underlying.
GetConstantValue
());
5988
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6097
assignmentOperation.Type, assignmentOperation.
GetConstantValue
(), IsImplicit(assignmentOperation));
6234
fieldReference.Syntax, fieldReference.Type, fieldReference.
GetConstantValue
(), IsImplicit(fieldReference));
6404
semanticModel: null, simpleAssignment.Syntax, simpleAssignment.Type, simpleAssignment.
GetConstantValue
(), IsImplicit(simpleAssignment));
6601
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
());
6761
return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6767
new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
6890
return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.Type, operation.
GetConstantValue
());
6971
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isInitialization: true);
6983
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
6996
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
7083
return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7098
Debug.Assert(operation.
GetConstantValue
() != null);
7099
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7104
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7115
operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7128
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7181
return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7191
return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7424
return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7429
return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7473
operation.
GetConstantValue
(), IsImplicit(operation));
7496
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(invalidOperation));
7503
invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(operation)));
8013
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
8034
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
8044
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)
2366
ConstantValue? sourceConstantValue = source.
GetConstantValue
();
Operations\CSharpOperationFactory_Methods.cs (1)
467
var assignment = new SimpleAssignmentOperation(isRef, target, value, _semanticModel, assignmentSyntax, assignmentType, value.
GetConstantValue
(), isImplicitAssignment);