aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-02 20:36:04 -0800
committerKazu Hirata <kazu@google.com>2022-12-02 20:36:05 -0800
commite9e64f7c9e8af778faa62d1b412f190bb3e85f3c (patch)
treeb7f32a0c08dbc857f275e93a005b276bdd294c54 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parente842c06c2d52ae1d60db7ed528ea3f4215a0aad6 (diff)
downloadllvm-e9e64f7c9e8af778faa62d1b412f190bb3e85f3c.zip
llvm-e9e64f7c9e8af778faa62d1b412f190bb3e85f3c.tar.gz
llvm-e9e64f7c9e8af778faa62d1b412f190bb3e85f3c.tar.bz2
[Bitcode] 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/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index bed9d6d..ff64435 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -528,7 +528,7 @@ private:
Optional<unsigned> getValueId(GlobalValue::GUID ValGUID) {
auto VMI = GUIDToValueIdMap.find(ValGUID);
if (VMI == GUIDToValueIdMap.end())
- return None;
+ return std::nullopt;
return VMI->second;
}
@@ -4431,7 +4431,7 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
auto GetValueId = [&](const ValueInfo &VI) -> Optional<unsigned> {
if (!VI)
- return None;
+ return std::nullopt;
return getValueId(VI.getGUID());
};