aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ValueMapper.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-04 17:12:44 -0800
committerKazu Hirata <kazu@google.com>2022-12-04 17:12:44 -0800
commit3c09ed006ab35dd8faac03311b14f0857b01949c (patch)
treee23c93098eb6bdafea2936c2107c89159ba13bdd /llvm/lib/Transforms/Utils/ValueMapper.cpp
parent4b7428e1516e073bf7ae8044519c5327b356e268 (diff)
downloadllvm-3c09ed006ab35dd8faac03311b14f0857b01949c.zip
llvm-3c09ed006ab35dd8faac03311b14f0857b01949c.tar.gz
llvm-3c09ed006ab35dd8faac03311b14f0857b01949c.tar.bz2
[llvm] Use std::nullopt instead of None in comments (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
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index 3d9fd56..074af66 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -270,8 +270,8 @@ private:
/// MDNode, compute and return the mapping. If it's a distinct \a MDNode,
/// return the result of \a mapDistinctNode().
///
- /// \return None if \c Op is an unmapped uniqued \a MDNode.
- /// \post getMappedOp(Op) only returns None if this returns None.
+ /// \return std::nullopt if \c Op is an unmapped uniqued \a MDNode.
+ /// \post getMappedOp(Op) only returns std::nullopt if this returns None.
Optional<Metadata *> tryToMapOperand(const Metadata *Op);
/// Map a distinct node.
@@ -317,11 +317,10 @@ private:
/// This visits all the nodes in \c G in post-order, using the identity
/// mapping or creating a new node depending on \a Data::HasChanged.
///
- /// \pre \a getMappedOp() returns None for nodes in \c G, but not for any of
- /// their operands outside of \c G.
- /// \pre \a Data::HasChanged is true for a node in \c G iff any of its
- /// operands have changed.
- /// \post \a getMappedOp() returns the mapped node for every node in \c G.
+ /// \pre \a getMappedOp() returns std::nullopt for nodes in \c G, but not for
+ /// any of their operands outside of \c G. \pre \a Data::HasChanged is true
+ /// for a node in \c G iff any of its operands have changed. \post \a
+ /// getMappedOp() returns the mapped node for every node in \c G.
void mapNodesInPOT(UniquedGraph &G);
/// Remap a node's operands using the given functor.