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/Object/ELFObjectFileTest.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/Object/ELFObjectFileTest.cpp')
-rw-r--r-- | llvm/unittests/Object/ELFObjectFileTest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/unittests/Object/ELFObjectFileTest.cpp b/llvm/unittests/Object/ELFObjectFileTest.cpp index 877a140..2c8585bf 100644 --- a/llvm/unittests/Object/ELFObjectFileTest.cpp +++ b/llvm/unittests/Object/ELFObjectFileTest.cpp @@ -703,7 +703,8 @@ Sections: }; // Check that we can retrieve the data in the normal case. - DoCheckSucceeds(CommonYamlString, /*TextSectionIndex=*/None, AllBBAddrMaps); + DoCheckSucceeds(CommonYamlString, /*TextSectionIndex=*/std::nullopt, + AllBBAddrMaps); DoCheckSucceeds(CommonYamlString, /*TextSectionIndex=*/0, Section0BBAddrMaps); DoCheckSucceeds(CommonYamlString, /*TextSectionIndex=*/1, Section1BBAddrMaps); // Check that when no bb-address-map section is found for a text section, @@ -723,7 +724,7 @@ Sections: "index: 10"); // Linked sections are not checked when we don't target a specific text // section. - DoCheckSucceeds(InvalidLinkedYamlString, /*TextSectionIndex=*/None, + DoCheckSucceeds(InvalidLinkedYamlString, /*TextSectionIndex=*/std::nullopt, AllBBAddrMaps); // Check that we can detect when bb-address-map decoding fails. @@ -732,7 +733,7 @@ Sections: ShSize: 0x8 )"; - DoCheckFails(TruncatedYamlString, /*TextSectionIndex=*/None, + DoCheckFails(TruncatedYamlString, /*TextSectionIndex=*/std::nullopt, "unable to read SHT_LLVM_BB_ADDR_MAP_V0 section with index 3: " "unable to decode LEB128 at offset 0x00000008: malformed " "uleb128, extends past end"); |