diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-02 22:10:37 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-02 22:10:37 -0800 |
commit | b6a01caa64aaac2e5db8d7953a81cbe1a139b81f (patch) | |
tree | 1e03e63b8c985d3b1ca515ac811a87e31e6afef0 /llvm/unittests/ADT/APIntTest.cpp | |
parent | b25362816d731ca2283b3b21ca7343a64c05d85c (diff) | |
download | llvm-b6a01caa64aaac2e5db8d7953a81cbe1a139b81f.zip llvm-b6a01caa64aaac2e5db8d7953a81cbe1a139b81f.tar.gz llvm-b6a01caa64aaac2e5db8d7953a81cbe1a139b81f.tar.bz2 |
[llvm/unittests] 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 'llvm/unittests/ADT/APIntTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/APIntTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp index 3dba0fa..c5a9859 100644 --- a/llvm/unittests/ADT/APIntTest.cpp +++ b/llvm/unittests/ADT/APIntTest.cpp @@ -2932,10 +2932,10 @@ TEST(APIntTest, MultiplicativeInverseExaustive) { TEST(APIntTest, GetMostSignificantDifferentBit) { EXPECT_EQ(APIntOps::GetMostSignificantDifferentBit(APInt(8, 0), APInt(8, 0)), - llvm::None); + std::nullopt); EXPECT_EQ( APIntOps::GetMostSignificantDifferentBit(APInt(8, 42), APInt(8, 42)), - llvm::None); + std::nullopt); EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 0), APInt(8, 1)), 0u); EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 0), APInt(8, 2)), @@ -2945,7 +2945,7 @@ TEST(APIntTest, GetMostSignificantDifferentBit) { EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 0)), 0u); EXPECT_EQ(APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 1)), - llvm::None); + std::nullopt); EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 2)), 1u); EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 3)), @@ -2960,7 +2960,7 @@ TEST(APIntTest, GetMostSignificantDifferentBitExaustive) { [](const APInt &V0, const APInt &V1) -> llvm::Optional<unsigned> { assert(V0.getBitWidth() == V1.getBitWidth() && "Must have same bitwidth"); if (V0 == V1) - return llvm::None; // Bitwise identical. + return std::nullopt; // Bitwise identical. // There is a mismatch. Let's find the most significant different bit. for (int Bit = V0.getBitWidth() - 1; Bit >= 0; --Bit) { if (V0[Bit] == V1[Bit]) |