From: Kazu Hirata Date: Sat, 17 Dec 2022 06:38:57 +0000 (-0800) Subject: [NVPTX] Use std::optional instead of llvm::Optional (NFC) X-Git-Tag: upstream/17.0.6~23419 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85956bd5522faed930d2ad70dd40b4311d66bc95;p=platform%2Fupstream%2Fllvm.git [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 --- 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,