diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -650,11 +650,11 @@ /// Address of the code/function that is executed before any other code in /// the binary. - Optional StartFunctionAddress; + std::optional StartFunctionAddress; /// Address of the code/function that is going to be executed right before /// the execution of the binary is completed. - Optional FiniFunctionAddress; + std::optional FiniFunctionAddress; /// Page alignment used for code layout. uint64_t PageAlign{HugePageSize}; diff --git a/bolt/lib/Rewrite/MachORewriteInstance.cpp b/bolt/lib/Rewrite/MachORewriteInstance.cpp --- a/bolt/lib/Rewrite/MachORewriteInstance.cpp +++ b/bolt/lib/Rewrite/MachORewriteInstance.cpp @@ -197,9 +197,9 @@ return DataInCode; } -Optional readStartAddress(const MachOObjectFile &O) { - Optional StartOffset; - Optional TextVMAddr; +std::optional readStartAddress(const MachOObjectFile &O) { + std::optional StartOffset; + std::optional TextVMAddr; for (const object::MachOObjectFile::LoadCommandInfo &LC : O.load_commands()) { switch (LC.C.cmd) { case MachO::LC_MAIN: { @@ -228,7 +228,7 @@ } } return (TextVMAddr && StartOffset) - ? Optional(*TextVMAddr + *StartOffset) + ? std::optional(*TextVMAddr + *StartOffset) : std::nullopt; } diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4762,7 +4762,7 @@ assert(SymbolName && "cannot get symbol name"); auto updateSymbolValue = [&](const StringRef Name, - Optional Value = std::nullopt) { + std::optional Value = std::nullopt) { NewSymbol.st_value = Value ? *Value : getNewValueForSymbol(Name); NewSymbol.st_shndx = ELF::SHN_ABS; outs() << "BOLT-INFO: setting " << Name << " to 0x"