mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
[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
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -499,11 +499,11 @@ public:
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user