[llvm] 85956bd - [NVPTX] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 23:07:27 PST 2022
Author: Kazu Hirata
Date: 2022-12-16T23:04:23-08:00
New Revision: 85956bd5522faed930d2ad70dd40b4311d66bc95
URL: https://github.com/llvm/llvm-project/commit/85956bd5522faed930d2ad70dd40b4311d66bc95
DIFF: https://github.com/llvm/llvm-project/commit/85956bd5522faed930d2ad70dd40b4311d66bc95.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
llvm/lib/Target/NVPTX/NVPTXISelLowering.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index 87b9f92a11e8..c7ed3797b0ea 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<ISD::OutputArg> &Outs, MaybeAlign retAlignment,
- Optional<std::pair<unsigned, const APInt &>> VAInfo, const CallBase &CB,
- unsigned UniqueCallSite) const {
+ std::optional<std::pair<unsigned, const APInt &>> 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::pair<unsigned, const APInt &>>(std::make_pair(
- CLI.NumFixedArgs,
- cast<ConstantSDNode>(VADeclareParam->getOperand(1))
- ->getAPIntValue()))
- : std::nullopt,
+ HasVAArgs
+ ? std::optional<std::pair<unsigned, const APInt &>>(std::make_pair(
+ CLI.NumFixedArgs,
+ cast<ConstantSDNode>(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 3c088428718b..78d82315fbf6 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.h
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.h
@@ -499,11 +499,11 @@ class NVPTXTargetLowering : public TargetLowering {
SDValue LowerCall(CallLoweringInfo &CLI,
SmallVectorImpl<SDValue> &InVals) const override;
- std::string getPrototype(const DataLayout &DL, Type *, const ArgListTy &,
- const SmallVectorImpl<ISD::OutputArg> &,
- MaybeAlign retAlignment,
- Optional<std::pair<unsigned, const APInt &>> VAInfo,
- const CallBase &CB, unsigned UniqueCallSite) const;
+ std::string
+ getPrototype(const DataLayout &DL, Type *, const ArgListTy &,
+ const SmallVectorImpl<ISD::OutputArg> &, MaybeAlign retAlignment,
+ std::optional<std::pair<unsigned, const APInt &>> VAInfo,
+ const CallBase &CB, unsigned UniqueCallSite) const;
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
const SmallVectorImpl<ISD::OutputArg> &Outs,
More information about the llvm-commits
mailing list