CallInst *CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes,
FunctionCallee ActualCallee,
ArrayRef<Value *> CallArgs,
- Optional<ArrayRef<Value *>> DeoptArgs,
+ std::optional<ArrayRef<Value *>> DeoptArgs,
ArrayRef<Value *> GCArgs,
const Twine &Name = "");
CallInst *CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes,
FunctionCallee ActualCallee, uint32_t Flags,
ArrayRef<Value *> CallArgs,
- Optional<ArrayRef<Use>> TransitionArgs,
- Optional<ArrayRef<Use>> DeoptArgs,
+ std::optional<ArrayRef<Use>> TransitionArgs,
+ std::optional<ArrayRef<Use>> DeoptArgs,
ArrayRef<Value *> GCArgs,
const Twine &Name = "");
CallInst *CreateGCStatepointCall(uint64_t ID, uint32_t NumPatchBytes,
FunctionCallee ActualCallee,
ArrayRef<Use> CallArgs,
- Optional<ArrayRef<Value *>> DeoptArgs,
+ std::optional<ArrayRef<Value *>> DeoptArgs,
ArrayRef<Value *> GCArgs,
const Twine &Name = "");
CreateGCStatepointInvoke(uint64_t ID, uint32_t NumPatchBytes,
FunctionCallee ActualInvokee, BasicBlock *NormalDest,
BasicBlock *UnwindDest, ArrayRef<Value *> InvokeArgs,
- Optional<ArrayRef<Value *>> DeoptArgs,
+ std::optional<ArrayRef<Value *>> DeoptArgs,
ArrayRef<Value *> GCArgs, const Twine &Name = "");
/// Create an invoke to the experimental.gc.statepoint intrinsic to
InvokeInst *CreateGCStatepointInvoke(
uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualInvokee,
BasicBlock *NormalDest, BasicBlock *UnwindDest, uint32_t Flags,
- ArrayRef<Value *> InvokeArgs, Optional<ArrayRef<Use>> TransitionArgs,
- Optional<ArrayRef<Use>> DeoptArgs, ArrayRef<Value *> GCArgs,
+ ArrayRef<Value *> InvokeArgs, std::optional<ArrayRef<Use>> TransitionArgs,
+ std::optional<ArrayRef<Use>> DeoptArgs, ArrayRef<Value *> GCArgs,
const Twine &Name = "");
// Convenience function for the common case when CallArgs are filled in using
CreateGCStatepointInvoke(uint64_t ID, uint32_t NumPatchBytes,
FunctionCallee ActualInvokee, BasicBlock *NormalDest,
BasicBlock *UnwindDest, ArrayRef<Use> InvokeArgs,
- Optional<ArrayRef<Value *>> DeoptArgs,
+ std::optional<ArrayRef<Value *>> DeoptArgs,
ArrayRef<Value *> GCArgs, const Twine &Name = "");
/// Create a call to the experimental.gc.result intrinsic to extract
return I;
}
- Value *getConstrainedFPRounding(Optional<RoundingMode> Rounding) {
+ Value *getConstrainedFPRounding(std::optional<RoundingMode> Rounding) {
RoundingMode UseRounding = DefaultConstrainedRounding;
if (Rounding)
return MetadataAsValue::get(Context, RoundingMDS);
}
- Value *getConstrainedFPExcept(Optional<fp::ExceptionBehavior> Except) {
+ Value *getConstrainedFPExcept(std::optional<fp::ExceptionBehavior> Except) {
fp::ExceptionBehavior UseExcept = DefaultConstrainedExcept;
if (Except)
CallInst *CreateConstrainedFPBinOp(
Intrinsic::ID ID, Value *L, Value *R, Instruction *FMFSource = nullptr,
const Twine &Name = "", MDNode *FPMathTag = nullptr,
- Optional<RoundingMode> Rounding = std::nullopt,
- Optional<fp::ExceptionBehavior> Except = std::nullopt);
+ std::optional<RoundingMode> Rounding = std::nullopt,
+ std::optional<fp::ExceptionBehavior> Except = std::nullopt);
Value *CreateNeg(Value *V, const Twine &Name = "", bool HasNUW = false,
bool HasNSW = false) {
Intrinsic::ID ID, Value *V, Type *DestTy,
Instruction *FMFSource = nullptr, const Twine &Name = "",
MDNode *FPMathTag = nullptr,
- Optional<RoundingMode> Rounding = std::nullopt,
- Optional<fp::ExceptionBehavior> Except = std::nullopt);
+ std::optional<RoundingMode> Rounding = std::nullopt,
+ std::optional<fp::ExceptionBehavior> Except = std::nullopt);
// Provided to resolve 'CreateIntCast(Ptr, Ptr, "...")', giving a
// compile time error, instead of converting the string to bool for the
bool IsSignaling);
public:
- CallInst *
- CreateConstrainedFPCmp(Intrinsic::ID ID, CmpInst::Predicate P, Value *L,
- Value *R, const Twine &Name = "",
- Optional<fp::ExceptionBehavior> Except = std::nullopt);
+ CallInst *CreateConstrainedFPCmp(
+ Intrinsic::ID ID, CmpInst::Predicate P, Value *L, Value *R,
+ const Twine &Name = "",
+ std::optional<fp::ExceptionBehavior> Except = std::nullopt);
//===--------------------------------------------------------------------===//
// Instruction creation methods: Other Instructions
CallInst *CreateConstrainedFPCall(
Function *Callee, ArrayRef<Value *> Args, const Twine &Name = "",
- Optional<RoundingMode> Rounding = std::nullopt,
- Optional<fp::ExceptionBehavior> Except = std::nullopt);
+ std::optional<RoundingMode> Rounding = std::nullopt,
+ std::optional<fp::ExceptionBehavior> Except = std::nullopt);
Value *CreateSelect(Value *C, Value *True, Value *False,
const Twine &Name = "", Instruction *MDFrom = nullptr);
#include "llvm/Support/Casting.h"
#include <cassert>
#include <cstdint>
+#include <optional>
#include <vector>
using namespace llvm;
template<typename T1, typename T2, typename T3>
static std::vector<OperandBundleDef>
-getStatepointBundles(Optional<ArrayRef<T1>> TransitionArgs,
- Optional<ArrayRef<T2>> DeoptArgs,
+getStatepointBundles(std::optional<ArrayRef<T1>> TransitionArgs,
+ std::optional<ArrayRef<T2>> DeoptArgs,
ArrayRef<T3> GCArgs) {
std::vector<OperandBundleDef> Rval;
if (DeoptArgs) {
static CallInst *CreateGCStatepointCallCommon(
IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes,
FunctionCallee ActualCallee, uint32_t Flags, ArrayRef<T0> CallArgs,
- Optional<ArrayRef<T1>> TransitionArgs, Optional<ArrayRef<T2>> DeoptArgs,
- ArrayRef<T3> GCArgs, const Twine &Name) {
+ std::optional<ArrayRef<T1>> TransitionArgs,
+ std::optional<ArrayRef<T2>> DeoptArgs, ArrayRef<T3> GCArgs,
+ const Twine &Name) {
Module *M = Builder->GetInsertBlock()->getParent()->getParent();
// Fill in the one generic type'd argument (the function is also vararg)
Function *FnStatepoint =
CallInst *IRBuilderBase::CreateGCStatepointCall(
uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualCallee,
- ArrayRef<Value *> CallArgs, Optional<ArrayRef<Value *>> DeoptArgs,
+ ArrayRef<Value *> CallArgs, std::optional<ArrayRef<Value *>> DeoptArgs,
ArrayRef<Value *> GCArgs, const Twine &Name) {
return CreateGCStatepointCallCommon<Value *, Value *, Value *, Value *>(
this, ID, NumPatchBytes, ActualCallee, uint32_t(StatepointFlags::None),
CallInst *IRBuilderBase::CreateGCStatepointCall(
uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualCallee,
uint32_t Flags, ArrayRef<Value *> CallArgs,
- Optional<ArrayRef<Use>> TransitionArgs, Optional<ArrayRef<Use>> DeoptArgs,
- ArrayRef<Value *> GCArgs, const Twine &Name) {
+ std::optional<ArrayRef<Use>> TransitionArgs,
+ std::optional<ArrayRef<Use>> DeoptArgs, ArrayRef<Value *> GCArgs,
+ const Twine &Name) {
return CreateGCStatepointCallCommon<Value *, Use, Use, Value *>(
this, ID, NumPatchBytes, ActualCallee, Flags, CallArgs, TransitionArgs,
DeoptArgs, GCArgs, Name);
CallInst *IRBuilderBase::CreateGCStatepointCall(
uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualCallee,
- ArrayRef<Use> CallArgs, Optional<ArrayRef<Value *>> DeoptArgs,
+ ArrayRef<Use> CallArgs, std::optional<ArrayRef<Value *>> DeoptArgs,
ArrayRef<Value *> GCArgs, const Twine &Name) {
return CreateGCStatepointCallCommon<Use, Value *, Value *, Value *>(
this, ID, NumPatchBytes, ActualCallee, uint32_t(StatepointFlags::None),
IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes,
FunctionCallee ActualInvokee, BasicBlock *NormalDest,
BasicBlock *UnwindDest, uint32_t Flags, ArrayRef<T0> InvokeArgs,
- Optional<ArrayRef<T1>> TransitionArgs, Optional<ArrayRef<T2>> DeoptArgs,
- ArrayRef<T3> GCArgs, const Twine &Name) {
+ std::optional<ArrayRef<T1>> TransitionArgs,
+ std::optional<ArrayRef<T2>> DeoptArgs, ArrayRef<T3> GCArgs,
+ const Twine &Name) {
Module *M = Builder->GetInsertBlock()->getParent()->getParent();
// Fill in the one generic type'd argument (the function is also vararg)
Function *FnStatepoint =
InvokeInst *IRBuilderBase::CreateGCStatepointInvoke(
uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualInvokee,
BasicBlock *NormalDest, BasicBlock *UnwindDest,
- ArrayRef<Value *> InvokeArgs, Optional<ArrayRef<Value *>> DeoptArgs,
+ ArrayRef<Value *> InvokeArgs, std::optional<ArrayRef<Value *>> DeoptArgs,
ArrayRef<Value *> GCArgs, const Twine &Name) {
return CreateGCStatepointInvokeCommon<Value *, Value *, Value *, Value *>(
this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
InvokeInst *IRBuilderBase::CreateGCStatepointInvoke(
uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualInvokee,
BasicBlock *NormalDest, BasicBlock *UnwindDest, uint32_t Flags,
- ArrayRef<Value *> InvokeArgs, Optional<ArrayRef<Use>> TransitionArgs,
- Optional<ArrayRef<Use>> DeoptArgs, ArrayRef<Value *> GCArgs,
+ ArrayRef<Value *> InvokeArgs, std::optional<ArrayRef<Use>> TransitionArgs,
+ std::optional<ArrayRef<Use>> DeoptArgs, ArrayRef<Value *> GCArgs,
const Twine &Name) {
return CreateGCStatepointInvokeCommon<Value *, Use, Use, Value *>(
this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest, Flags,
InvokeInst *IRBuilderBase::CreateGCStatepointInvoke(
uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualInvokee,
BasicBlock *NormalDest, BasicBlock *UnwindDest, ArrayRef<Use> InvokeArgs,
- Optional<ArrayRef<Value *>> DeoptArgs, ArrayRef<Value *> GCArgs,
+ std::optional<ArrayRef<Value *>> DeoptArgs, ArrayRef<Value *> GCArgs,
const Twine &Name) {
return CreateGCStatepointInvokeCommon<Use, Value *, Value *, Value *>(
this, ID, NumPatchBytes, ActualInvokee, NormalDest, UnwindDest,
CallInst *IRBuilderBase::CreateConstrainedFPBinOp(
Intrinsic::ID ID, Value *L, Value *R, Instruction *FMFSource,
const Twine &Name, MDNode *FPMathTag,
- Optional<RoundingMode> Rounding,
- Optional<fp::ExceptionBehavior> Except) {
+ std::optional<RoundingMode> Rounding,
+ std::optional<fp::ExceptionBehavior> Except) {
Value *RoundingV = getConstrainedFPRounding(Rounding);
Value *ExceptV = getConstrainedFPExcept(Except);
CallInst *IRBuilderBase::CreateConstrainedFPCast(
Intrinsic::ID ID, Value *V, Type *DestTy,
Instruction *FMFSource, const Twine &Name, MDNode *FPMathTag,
- Optional<RoundingMode> Rounding,
- Optional<fp::ExceptionBehavior> Except) {
+ std::optional<RoundingMode> Rounding,
+ std::optional<fp::ExceptionBehavior> Except) {
Value *ExceptV = getConstrainedFPExcept(Except);
FastMathFlags UseFMF = FMF;
CallInst *IRBuilderBase::CreateConstrainedFPCmp(
Intrinsic::ID ID, CmpInst::Predicate P, Value *L, Value *R,
- const Twine &Name, Optional<fp::ExceptionBehavior> Except) {
+ const Twine &Name, std::optional<fp::ExceptionBehavior> Except) {
Value *PredicateV = getConstrainedFPPredicate(P);
Value *ExceptV = getConstrainedFPExcept(Except);
CallInst *IRBuilderBase::CreateConstrainedFPCall(
Function *Callee, ArrayRef<Value *> Args, const Twine &Name,
- Optional<RoundingMode> Rounding,
- Optional<fp::ExceptionBehavior> Except) {
+ std::optional<RoundingMode> Rounding,
+ std::optional<fp::ExceptionBehavior> Except) {
llvm::SmallVector<Value *, 6> UseArgs;
append_range(UseArgs, Args);