mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also clang-format to fix up all the renamed #includes.
This commit is contained in:
@@ -1753,7 +1753,7 @@ static bool performCompileStepsPostSILGen(CompilerInstance &Instance,
|
||||
const ASTContext &Context = Instance.getASTContext();
|
||||
const IRGenOptions &IRGenOpts = Invocation.getIRGenOptions();
|
||||
|
||||
llvm::Optional<BufferIndirectlyCausingDiagnosticRAII> ricd;
|
||||
std::optional<BufferIndirectlyCausingDiagnosticRAII> ricd;
|
||||
if (auto *SF = MSF.dyn_cast<SourceFile *>())
|
||||
ricd.emplace(*SF);
|
||||
|
||||
@@ -2252,12 +2252,12 @@ int swift::performFrontend(ArrayRef<const char *> Args,
|
||||
// dynamically-sized array of optional PrettyStackTraces, which get
|
||||
// initialized by iterating over the buffers we collected above.
|
||||
auto configurationFileStackTraces =
|
||||
std::make_unique<llvm::Optional<PrettyStackTraceFileContents>[]>(
|
||||
std::make_unique<std::optional<PrettyStackTraceFileContents>[]>(
|
||||
configurationFileBuffers.size());
|
||||
for_each(configurationFileBuffers.begin(), configurationFileBuffers.end(),
|
||||
&configurationFileStackTraces[0],
|
||||
[](const std::unique_ptr<llvm::MemoryBuffer> &buffer,
|
||||
llvm::Optional<PrettyStackTraceFileContents> &trace) {
|
||||
std::optional<PrettyStackTraceFileContents> &trace) {
|
||||
trace.emplace(*buffer);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user