diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-25 21:42:52 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-25 21:42:52 -0700 |
commit | a7938c74f16379704fbd38a3d82dfcb9345651ab (patch) | |
tree | c60b0dce73b749e64ab20d51ef00abfbc547857f /llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | |
parent | 77295c5486e48a4319efcfc4ac262304c7e7025c (diff) | |
download | llvm-a7938c74f16379704fbd38a3d82dfcb9345651ab.zip llvm-a7938c74f16379704fbd38a3d82dfcb9345651ab.tar.gz llvm-a7938c74f16379704fbd38a3d82dfcb9345651ab.tar.bz2 |
[llvm] Don't use Optional::hasValue (NFC)
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index b318c2a..19a52fd 100644 --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -196,10 +196,10 @@ static Optional<int> findPreviousSpillSlot(const Value *Val, for (auto &IncomingValue : Phi->incoming_values()) { Optional<int> SpillSlot = findPreviousSpillSlot(IncomingValue, Builder, LookUpDepth - 1); - if (!SpillSlot.hasValue()) + if (!SpillSlot) return None; - if (MergedResult.hasValue() && *MergedResult != *SpillSlot) + if (MergedResult && *MergedResult != *SpillSlot) return None; MergedResult = SpillSlot; @@ -530,14 +530,14 @@ lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops, GCStrategy &S = GFI->getStrategy(); for (const Value *V : SI.Bases) { auto Opt = S.isGCManagedPointer(V->getType()->getScalarType()); - if (Opt.hasValue()) { + if (Opt) { assert(Opt.getValue() && "non gc managed base pointer found in statepoint"); } } for (const Value *V : SI.Ptrs) { auto Opt = S.isGCManagedPointer(V->getType()->getScalarType()); - if (Opt.hasValue()) { + if (Opt) { assert(Opt.getValue() && "non gc managed derived pointer found in statepoint"); } |