47 references to GetConstantValue
Microsoft.CodeAnalysis (43)
Operations\ControlFlowGraphBuilder.cs (41)
276
if (current.BranchValue.
GetConstantValue
() is { IsBoolean: true, BooleanValue: bool constant })
2098
return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2215
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
2241
semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
2436
semanticModel: null, binOp.Syntax, binOp.Type, binOp.
GetConstantValue
(), isImplicit: true);
2534
binOp.
GetConstantValue
(),
2624
binOp.
GetConstantValue
(), IsImplicit(binOp))));
2723
lastUnary.Type, lastUnary.
GetConstantValue
(), IsImplicit(lastUnary))
3219
constantValue: operation.
GetConstantValue
(),
3251
operation.Syntax, operation.Type, constantValue: operation.
GetConstantValue
(), isImplicit: true);
3298
ConstantValue? constantValue = operand.
GetConstantValue
() is { IsNull: var isNull }
4817
else if (!(operation.StepValue.
GetConstantValue
() is { IsBad: false }) &&
4990
else if (operation.StepValue.
GetConstantValue
() is { IsBad: false } value)
5349
return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.Type, underlying.
GetConstantValue
());
5891
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
5999
assignmentOperation.Type, assignmentOperation.
GetConstantValue
(), IsImplicit(assignmentOperation));
6121
fieldReference.Syntax, fieldReference.Type, fieldReference.
GetConstantValue
(), IsImplicit(fieldReference));
6205
semanticModel: null, simpleAssignment.Syntax, simpleAssignment.Type, simpleAssignment.
GetConstantValue
(), IsImplicit(simpleAssignment));
6363
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
());
6523
return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6529
new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation)));
6652
return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.Type, operation.
GetConstantValue
());
6733
return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isInitialization: true);
6745
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
6758
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), isImplicit: true);
6845
return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6860
Debug.Assert(operation.
GetConstantValue
() != null);
6861
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6866
return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6877
operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6890
operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6943
return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
6953
return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7186
return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7191
return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.Type, operation.
GetConstantValue
(), IsImplicit(operation));
7235
operation.
GetConstantValue
(), IsImplicit(operation));
7258
return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(invalidOperation));
7265
invalidOperation.Syntax, invalidOperation.Type, invalidOperation.
GetConstantValue
(), IsImplicit(operation)));
7747
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
7768
operation.Operand.Type, constantValue: operation.Operand.
GetConstantValue
());
7778
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)
2164
ConstantValue? sourceConstantValue = source.
GetConstantValue
();
Operations\CSharpOperationFactory_Methods.cs (1)
387
var assignment = new SimpleAssignmentOperation(isRef, target, value, _semanticModel, assignmentSyntax, assignmentType, value.
GetConstantValue
(), isImplicitAssignment);
Microsoft.CodeAnalysis.VisualBasic (2)
Compilation\VisualBasicCompilation.vb (1)
1899
Dim sourceConstantValue As ConstantValue = source.
GetConstantValue
()
Operations\VisualBasicOperationFactory_Methods.vb (1)
350
Dim constantValue As ConstantValue = value.
GetConstantValue
()