Replace llvm::Optional with std::optional

This commit is contained in:
Evan Wilde
2023-10-16 23:17:26 -07:00
parent 312bd47f4c
commit 6260970db6
2 changed files with 3 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ public:
Output getOutput(size_t I) const;
/// Retrieves a specific output specified by \p Kind, if it exists.
llvm::Optional<Output> getOutput(file_types::ID Kind) const;
std::optional<Output> getOutput(file_types::ID Kind) const;
/// Print this result to \p OS.
llvm::Error print(llvm::raw_ostream &OS);

View File

@@ -74,7 +74,7 @@ CompileJobCacheResult::Output CompileJobCacheResult::getOutput(size_t I) const {
return Output{getOutputObject(I), getOutputKind(I)};
}
Optional<CompileJobCacheResult::Output>
std::optional<CompileJobCacheResult::Output>
CompileJobCacheResult::getOutput(file_types::ID Kind) const {
size_t Count = getNumOutputs();
for (size_t I = 0; I < Count; ++I) {
@@ -82,7 +82,7 @@ CompileJobCacheResult::getOutput(file_types::ID Kind) const {
if (Kind == K)
return Output{getOutputObject(I), Kind};
}
return None;
return {};
}
Error CompileJobCacheResult::print(llvm::raw_ostream &OS) {