Skip to content

Commit 6260970

Browse files
committed
Replace llvm::Optional with std::optional
1 parent 312bd47 commit 6260970

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/Frontend/CompileJobCacheResult.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CompileJobCacheResult : public llvm::cas::ObjectProxy {
5050
Output getOutput(size_t I) const;
5151

5252
/// Retrieves a specific output specified by \p Kind, if it exists.
53-
llvm::Optional<Output> getOutput(file_types::ID Kind) const;
53+
std::optional<Output> getOutput(file_types::ID Kind) const;
5454

5555
/// Print this result to \p OS.
5656
llvm::Error print(llvm::raw_ostream &OS);

lib/Frontend/CompileJobCacheResult.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ CompileJobCacheResult::Output CompileJobCacheResult::getOutput(size_t I) const {
7474
return Output{getOutputObject(I), getOutputKind(I)};
7575
}
7676

77-
Optional<CompileJobCacheResult::Output>
77+
std::optional<CompileJobCacheResult::Output>
7878
CompileJobCacheResult::getOutput(file_types::ID Kind) const {
7979
size_t Count = getNumOutputs();
8080
for (size_t I = 0; I < Count; ++I) {
8181
file_types::ID K = getOutputKind(I);
8282
if (Kind == K)
8383
return Output{getOutputObject(I), Kind};
8484
}
85-
return None;
85+
return {};
8686
}
8787

8888
Error CompileJobCacheResult::print(llvm::raw_ostream &OS) {

0 commit comments

Comments
 (0)