diff options
author | Fangrui Song <i@maskray.me> | 2022-12-17 06:37:59 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-17 06:37:59 +0000 |
commit | 53e5cd4d3e39dad47312a48d4c6c71318bb2c283 (patch) | |
tree | 808d8a35b84061021fe7896084ece92bb470ba2a /clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | |
parent | 40ba0942e2ab1107f83aa5a0ee5ae2980bf47b1a (diff) | |
download | llvm-53e5cd4d3e39dad47312a48d4c6c71318bb2c283.zip llvm-53e5cd4d3e39dad47312a48d4c6c71318bb2c283.tar.gz llvm-53e5cd4d3e39dad47312a48d4c6c71318bb2c283.tar.bz2 |
llvm::Optional::value => operator*/operator->
std::optional::value() has undesired exception checking semantics and is
unavailable in older Xcode (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). The
call sites block std::optional migration.
This makes `ninja clang` work in the absence of llvm::Optional::value.
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp')
-rw-r--r-- | clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp index 9122d49..5c7ab65 100644 --- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -39,14 +39,14 @@ namespace { /// at position \p Key. void serializeObject(Object &Paren, StringRef Key, Optional<Object> Obj) { if (Obj) - Paren[Key] = std::move(Obj.value()); + Paren[Key] = std::move(*Obj); } /// Helper function to inject a JSON array \p Array into object \p Paren at /// position \p Key. void serializeArray(Object &Paren, StringRef Key, Optional<Array> Array) { if (Array) - Paren[Key] = std::move(Array.value()); + Paren[Key] = std::move(*Array); } /// Serialize a \c VersionTuple \p V with the Symbol Graph semantic version |