From 85956bd5522faed930d2ad70dd40b4311d66bc95 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 16 Dec 2022 22:38:57 -0800 Subject: [PATCH] [NVPTX] Use std::optional instead of llvm::Optional (NFC) This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 --- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 15 ++++++++------- llvm/lib/Target/NVPTX/NVPTXISelLowering.h | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp index 87b9f92..c7ed379 100644 --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -1318,8 +1318,8 @@ NVPTXTargetLowering::LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const { std::string NVPTXTargetLowering::getPrototype( const DataLayout &DL, Type *retTy, const ArgListTy &Args, const SmallVectorImpl &Outs, MaybeAlign retAlignment, - Optional> VAInfo, const CallBase &CB, - unsigned UniqueCallSite) const { + std::optional> VAInfo, + const CallBase &CB, unsigned UniqueCallSite) const { auto PtrVT = getPointerTy(DL); bool isABI = (STI.getSmVersion() >= 20); @@ -1812,11 +1812,12 @@ SDValue NVPTXTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, SDVTList ProtoVTs = DAG.getVTList(MVT::Other, MVT::Glue); std::string Proto = getPrototype( DL, RetTy, Args, Outs, retAlignment, - HasVAArgs ? Optional>(std::make_pair( - CLI.NumFixedArgs, - cast(VADeclareParam->getOperand(1)) - ->getAPIntValue())) - : std::nullopt, + HasVAArgs + ? std::optional>(std::make_pair( + CLI.NumFixedArgs, + cast(VADeclareParam->getOperand(1)) + ->getAPIntValue())) + : std::nullopt, *CB, UniqueCallSite); const char *ProtoStr = nvTM->getManagedStrPool()->getManagedString(Proto.c_str())->c_str(); diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.h b/llvm/lib/Target/NVPTX/NVPTXISelLowering.h index 3c08842..78d8231 100644 --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.h +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.h @@ -499,11 +499,11 @@ public: SDValue LowerCall(CallLoweringInfo &CLI, SmallVectorImpl &InVals) const override; - std::string getPrototype(const DataLayout &DL, Type *, const ArgListTy &, - const SmallVectorImpl &, - MaybeAlign retAlignment, - Optional> VAInfo, - const CallBase &CB, unsigned UniqueCallSite) const; + std::string + getPrototype(const DataLayout &DL, Type *, const ArgListTy &, + const SmallVectorImpl &, MaybeAlign retAlignment, + std::optional> VAInfo, + const CallBase &CB, unsigned UniqueCallSite) const; SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl &Outs, -- 2.7.4