45 references to GetConstantValue
Microsoft.CodeAnalysis (43)
Operations\ControlFlowGraphBuilder.cs (41)
276if (current.BranchValue.GetConstantValue() is { IsBoolean: true, BooleanValue: bool constant }) 2106return PopStackFrame(frame, new SimpleAssignmentOperation(operation.IsRef, PopOperand(), value, null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation))); 2234semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation))); 2260semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 2455semanticModel: null, binOp.Syntax, binOp.Type, binOp.GetConstantValue(), isImplicit: true); 2553binOp.GetConstantValue(), 2643binOp.GetConstantValue(), IsImplicit(binOp)))); 2742lastUnary.Type, lastUnary.GetConstantValue(), IsImplicit(lastUnary)) 3238constantValue: operation.GetConstantValue(), 3270operation.Syntax, operation.Type, constantValue: operation.GetConstantValue(), isImplicit: true); 3317ConstantValue? constantValue = operand.GetConstantValue() is { IsNull: var isNull } 4916else if (!(operation.StepValue.GetConstantValue() is { IsBad: false }) && 5089else if (operation.StepValue.GetConstantValue() is { IsBad: false } value) 5448return new FlowCaptureReferenceOperation(id, underlying.Syntax, underlying.Type, underlying.GetConstantValue()); 5990operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 6099assignmentOperation.Type, assignmentOperation.GetConstantValue(), IsImplicit(assignmentOperation)); 6236fieldReference.Syntax, fieldReference.Type, fieldReference.GetConstantValue(), IsImplicit(fieldReference)); 6406semanticModel: null, simpleAssignment.Syntax, simpleAssignment.Type, simpleAssignment.GetConstantValue(), IsImplicit(simpleAssignment)); 6625return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.HandlerPlaceholder, operation.Syntax, operation.Type, operation.GetConstantValue()); 6785return new NoneOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 6791new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation))); 6914return new FlowCaptureReferenceOperation(handlerCaptureId, operation.Syntax, operation.Type, operation.GetConstantValue()); 6995return new FlowCaptureReferenceOperation(_currentInterpolatedStringHandlerCreationContext.OutPlaceholder, operation.Syntax, operation.Type, operation.GetConstantValue(), isInitialization: true); 7009return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), isImplicit: true); 7023return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), isImplicit: true); 7110return new InterpolatedStringOperation(partsBuilder.ToImmutableAndFree(), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7125Debug.Assert(operation.GetConstantValue() != null); 7126return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7131return new LiteralOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7142operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7155operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7208return new ParenthesizedOperation(VisitRequired(operation.Operand), semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7218return new SizeOfOperation(operation.TypeOperand, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7457return new ConversionOperation(VisitRequired(operation.Operand), ((ConversionOperation)operation).ConversionConvertible, operation.IsTryCast, operation.IsChecked, semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7462return new DefaultValueOperation(semanticModel: null, operation.Syntax, operation.Type, operation.GetConstantValue(), IsImplicit(operation)); 7506operation.GetConstantValue(), IsImplicit(operation)); 7529return new InvalidOperation(ImmutableArray<IOperation>.Empty, semanticModel: null, invalidOperation.Syntax, invalidOperation.Type, invalidOperation.GetConstantValue(), IsImplicit(invalidOperation)); 7536invalidOperation.Syntax, invalidOperation.Type, invalidOperation.GetConstantValue(), IsImplicit(operation))); 8046operation.Operand.Type, constantValue: operation.Operand.GetConstantValue()); 8067operation.Operand.Type, constantValue: operation.Operand.GetConstantValue()); 8077operation.Operand.Type, constantValue: operation.Operand.GetConstantValue());
Operations\OperationCloner.cs (2)
21return new NoneOperation(VisitArray(((Operation)operation).ChildOperations.ToImmutableArray()), ((Operation)operation).OwningSemanticModel, operation.Syntax, operation.Type, operation.GetConstantValue(), operation.IsImplicit); 47return 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)
2425ConstantValue? sourceConstantValue = source.GetConstantValue();
Operations\CSharpOperationFactory_Methods.cs (1)
467var assignment = new SimpleAssignmentOperation(isRef, target, value, _semanticModel, assignmentSyntax, assignmentType, value.GetConstantValue(), isImplicitAssignment);