diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-03 18:50:29 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-03 18:50:29 -0800 |
commit | 043aa1dbba158dd99edbc4fa878e338c4ab5c34a (patch) | |
tree | d3d108419e8a3e5c8ae344fe9b646a220dbef87c /polly | |
parent | 1a36588ec64ae8576e531e6f0b49eadb90ab0b11 (diff) | |
download | llvm-043aa1dbba158dd99edbc4fa878e338c4ab5c34a.zip llvm-043aa1dbba158dd99edbc4fa878e338c4ab5c34a.tar.gz llvm-043aa1dbba158dd99edbc4fa878e338c4ab5c34a.tar.bz2 |
[polly] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
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
Diffstat (limited to 'polly')
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 2 | ||||
-rw-r--r-- | polly/lib/Support/ScopHelper.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index bbbb177..210f816 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -1599,7 +1599,7 @@ Scop::Scop(Region &R, ScalarEvolution &ScalarEvolution, LoopInfo &LI, DominatorTree &DT, ScopDetection::DetectionContext &DC, OptimizationRemarkEmitter &ORE, int ID) : IslCtx(isl_ctx_alloc(), isl_ctx_free), SE(&ScalarEvolution), DT(&DT), - R(R), name(None), HasSingleExitEdge(R.getExitingBlock()), DC(DC), + R(R), name(std::nullopt), HasSingleExitEdge(R.getExitingBlock()), DC(DC), ORE(ORE), Affinator(this, LI), ID(ID) { // Options defaults that are different from ISL's. diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp index f9dbdb9..ec9155e 100644 --- a/polly/lib/Support/ScopHelper.cpp +++ b/polly/lib/Support/ScopHelper.cpp @@ -703,7 +703,7 @@ static Optional<const MDOperand *> findNamedMetadataArg(MDNode *LoopID, StringRef Name) { MDNode *MD = findNamedMetadataNode(LoopID, Name); if (!MD) - return None; + return std::nullopt; switch (MD->getNumOperands()) { case 1: return nullptr; @@ -718,7 +718,7 @@ Optional<Metadata *> polly::findMetadataOperand(MDNode *LoopMD, StringRef Name) { MDNode *MD = findNamedMetadataNode(LoopMD, Name); if (!MD) - return None; + return std::nullopt; switch (MD->getNumOperands()) { case 1: return nullptr; @@ -733,7 +733,7 @@ static Optional<bool> getOptionalBoolLoopAttribute(MDNode *LoopID, StringRef Name) { MDNode *MD = findNamedMetadataNode(LoopID, Name); if (!MD) - return None; + return std::nullopt; switch (MD->getNumOperands()) { case 1: return true; @@ -755,11 +755,11 @@ llvm::Optional<int> polly::getOptionalIntLoopAttribute(MDNode *LoopID, const MDOperand *AttrMD = findNamedMetadataArg(LoopID, Name).value_or(nullptr); if (!AttrMD) - return None; + return std::nullopt; ConstantInt *IntMD = mdconst::extract_or_null<ConstantInt>(AttrMD->get()); if (!IntMD) - return None; + return std::nullopt; return IntMD->getSExtValue(); } |