[llvm] 79e3e65 - [ExecutionEngine] llvm::Optional => std::optional
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 14 02:18:15 PST 2022
Author: Fangrui Song
Date: 2022-12-14T10:18:08Z
New Revision: 79e3e65b2649073b00df495b76835ee714db7e91
URL: https://github.com/llvm/llvm-project/commit/79e3e65b2649073b00df495b76835ee714db7e91
DIFF: https://github.com/llvm/llvm-project/commit/79e3e65b2649073b00df495b76835ee714db7e91.diff
LOG: [ExecutionEngine] llvm::Optional => std::optional
Added:
Modified:
llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
llvm/lib/ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp
llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
llvm/lib/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h
llvm/tools/lli/lli.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index a356b813150f3..0f0fa6cae3162 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -15,7 +15,6 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
-#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
@@ -29,6 +28,7 @@
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
+#include <optional>
#include <map>
#include <string>
@@ -1071,7 +1071,7 @@ class LinkGraph {
}
/// Cache type for the splitBlock function.
- using SplitBlockCache = Optional<SmallVector<Symbol *, 8>>;
+ using SplitBlockCache = std::optional<SmallVector<Symbol *, 8>>;
/// Splits block B at the given index which must be greater than zero.
/// If SplitIndex == B.getSize() then this function is a no-op and returns B.
@@ -1302,9 +1302,10 @@ class LinkGraph {
/// given offset) of the size of the new block.
///
/// All other symbol attributes are unchanged.
- void transferDefinedSymbol(Symbol &Sym, Block &DestBlock,
- orc::ExecutorAddrDiff NewOffset,
- Optional<orc::ExecutorAddrDiff> ExplicitNewSize) {
+ void
+ transferDefinedSymbol(Symbol &Sym, Block &DestBlock,
+ orc::ExecutorAddrDiff NewOffset,
+ std::optional<orc::ExecutorAddrDiff> ExplicitNewSize) {
auto &OldSection = Sym.getBlock().getSection();
Sym.setBlock(DestBlock);
Sym.setOffset(NewOffset);
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
index 6dc561b5f633f..79358ab5db764 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
@@ -44,7 +44,7 @@ class COFFPlatform : public Platform {
JITDylib &PlatformJD, const char *OrcRuntimePath,
LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime = false,
const char *VCRuntimePath = nullptr,
- Optional<SymbolAliasMap> RuntimeAliases = std::nullopt);
+ std::optional<SymbolAliasMap> RuntimeAliases = std::nullopt);
ExecutionSession &getExecutionSession() const { return ES; }
ObjectLinkingLayer &getObjectLinkingLayer() const { return ObjLinkingLayer; }
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
index 89bcc6e8f0db3..0d234e421149d 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
@@ -15,15 +15,14 @@
#define LLVM_EXECUTIONENGINE_ORC_COMPILEONDEMANDLAYER_H
#include "llvm/ADT/APInt.h"
-#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"
#include "llvm/ExecutionEngine/Orc/Layer.h"
#include "llvm/ExecutionEngine/Orc/LazyReexports.h"
-#include "llvm/ExecutionEngine/Orc/Speculation.h"
#include "llvm/ExecutionEngine/Orc/Shared/OrcError.h"
+#include "llvm/ExecutionEngine/Orc/Speculation.h"
#include "llvm/ExecutionEngine/RuntimeDyld.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constant.h"
@@ -45,6 +44,7 @@
#include <iterator>
#include <list>
#include <memory>
+#include <optional>
#include <set>
#include <utility>
#include <vector>
@@ -64,15 +64,17 @@ class CompileOnDemandLayer : public IRLayer {
/// Partitioning function.
using PartitionFunction =
- std::function<Optional<GlobalValueSet>(GlobalValueSet Requested)>;
+ std::function<std::optional<GlobalValueSet>(GlobalValueSet Requested)>;
/// Off-the-shelf partitioning which compiles all requested symbols (usually
/// a single function at a time).
- static Optional<GlobalValueSet> compileRequested(GlobalValueSet Requested);
+ static std::optional<GlobalValueSet>
+ compileRequested(GlobalValueSet Requested);
/// Off-the-shelf partitioning which compiles whole modules whenever any
/// symbol in them is requested.
- static Optional<GlobalValueSet> compileWholeModule(GlobalValueSet Requested);
+ static std::optional<GlobalValueSet>
+ compileWholeModule(GlobalValueSet Requested);
/// Construct a CompileOnDemandLayer.
CompileOnDemandLayer(ExecutionSession &ES, IRLayer &BaseLayer,
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
index 890c9673eeb1e..3fcacde3644ed 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
@@ -95,7 +95,7 @@ class ELFNixPlatform : public Platform {
static Expected<std::unique_ptr<ELFNixPlatform>>
Create(ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD, const char *OrcRuntimePath,
- Optional<SymbolAliasMap> RuntimeAliases = std::nullopt);
+ std::optional<SymbolAliasMap> RuntimeAliases = std::nullopt);
ExecutionSession &getExecutionSession() const { return ES; }
ObjectLinkingLayer &getObjectLinkingLayer() const { return ObjLinkingLayer; }
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
index 7ae2d604d340b..8bd762460dd27 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
@@ -58,7 +58,7 @@ class EPCDebugObjectRegistrar : public DebugObjectRegistrar {
/// loaded to find the registration functions.
Expected<std::unique_ptr<EPCDebugObjectRegistrar>> createJITLoaderGDBRegistrar(
ExecutionSession &ES,
- Optional<ExecutorAddr> RegistrationFunctionDylib = std::nullopt);
+ std::optional<ExecutorAddr> RegistrationFunctionDylib = std::nullopt);
} // end namespace orc
} // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
index 648224184a7d0..0494705b462de 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
@@ -34,7 +34,7 @@ class EPCEHFrameRegistrar : public jitlink::EHFrameRegistrar {
/// will be loaded to find the registration functions.
static Expected<std::unique_ptr<EPCEHFrameRegistrar>>
Create(ExecutionSession &ES,
- Optional<ExecutorAddr> RegistrationFunctionsDylib = std::nullopt);
+ std::optional<ExecutorAddr> RegistrationFunctionsDylib = std::nullopt);
/// Create a EPCEHFrameRegistrar with the given ExecutorProcessControl
/// object and registration/deregistration function addresses.
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
index dc6854756381b..2982a7af09b05 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
@@ -262,8 +262,8 @@ class LLJITBuilderState {
std::unique_ptr<ExecutorProcessControl> EPC;
std::unique_ptr<ExecutionSession> ES;
- Optional<JITTargetMachineBuilder> JTMB;
- Optional<DataLayout> DL;
+ std::optional<JITTargetMachineBuilder> JTMB;
+ std::optional<DataLayout> DL;
ObjectLinkingLayerCreator CreateObjectLinkingLayer;
CompileFunctionCreator CreateCompileFunction;
PlatformSetupFunction SetUpPlatform;
@@ -305,13 +305,13 @@ class LLJITBuilderSetters {
/// Return a reference to the JITTargetMachineBuilder.
///
- Optional<JITTargetMachineBuilder> &getJITTargetMachineBuilder() {
+ std::optional<JITTargetMachineBuilder> &getJITTargetMachineBuilder() {
return impl().JTMB;
}
/// Set a DataLayout for this instance. If no data layout is specified then
/// the target's default data layout will be used.
- SetterImpl &setDataLayout(Optional<DataLayout> DL) {
+ SetterImpl &setDataLayout(std::optional<DataLayout> DL) {
impl().DL = std::move(DL);
return impl();
}
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
index cf0517b2b1ad6..6ca47d1c9a2ac 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
@@ -80,7 +80,7 @@ class MachOPlatform : public Platform {
static Expected<std::unique_ptr<MachOPlatform>>
Create(ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD, const char *OrcRuntimePath,
- Optional<SymbolAliasMap> RuntimeAliases = std::nullopt);
+ std::optional<SymbolAliasMap> RuntimeAliases = std::nullopt);
ExecutionSession &getExecutionSession() const { return ES; }
ObjectLinkingLayer &getObjectLinkingLayer() const { return ObjLinkingLayer; }
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
index 2db6e1772ad18..b518d89dd7d4a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
@@ -31,7 +31,7 @@ class SpeculateQuery {
bool isStraightLine(const Function &F);
public:
- using ResultTy = Optional<DenseMap<StringRef, DenseSet<StringRef>>>;
+ using ResultTy = std::optional<DenseMap<StringRef, DenseSet<StringRef>>>;
};
// Direct calls in high frequency basic blocks are extracted.
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h b/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
index fa29aca3e1405..b555669906c9a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
@@ -44,7 +44,7 @@ class ImplSymbolMap {
private:
// FIX ME: find a right way to distinguish the pre-compile Symbols, and update
// the callsite
- Optional<AliaseeDetails> getImplFor(const SymbolStringPtr &StubSymbol) {
+ std::optional<AliaseeDetails> getImplFor(const SymbolStringPtr &StubSymbol) {
std::lock_guard<std::mutex> Lockit(ConcurrentAccess);
auto Position = Maps.find(StubSymbol);
if (Position != Maps.end())
@@ -171,7 +171,8 @@ class Speculator {
class IRSpeculationLayer : public IRLayer {
public:
- using IRlikiesStrRef = Optional<DenseMap<StringRef, DenseSet<StringRef>>>;
+ using IRlikiesStrRef =
+ std::optional<DenseMap<StringRef, DenseSet<StringRef>>>;
using ResultEval = std::function<IRlikiesStrRef(Function &)>;
using TargetAndLikelies = DenseMap<SymbolStringPtr, SymbolNameSet>;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
index cb867986177dd..7ef09fdce8a44 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
@@ -30,7 +30,7 @@ namespace orc {
/// many main functions will expect a name argument at least, and will fail
/// if none is provided.
int runAsMain(int (*Main)(int, char *[]), ArrayRef<std::string> Args,
- Optional<StringRef> ProgramName = std::nullopt);
+ std::optional<StringRef> ProgramName = std::nullopt);
int runAsVoidFunction(int (*Func)(void));
int runAsIntFunction(int (*Func)(int), int Arg);
diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
index 37fe44d5fa69e..f094c02e86f34 100644
--- a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
@@ -10,9 +10,9 @@
#define LLVM_EXECUTIONENGINE_RUNTIMEDYLDCHECKER_H
#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/Support/Endian.h"
+#include <optional>
#include <cstdint>
#include <memory>
@@ -173,7 +173,7 @@ class RuntimeDyldChecker {
/// If there is a section at the given local address, return its load
/// address, otherwise return none.
- Optional<uint64_t> getSectionLoadAddress(void *LocalAddress) const;
+ std::optional<uint64_t> getSectionLoadAddress(void *LocalAddress) const;
private:
std::unique_ptr<RuntimeDyldCheckerImpl> Impl;
diff --git a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
index 58c8341c07c95..0c0a1a536deb0 100644
--- a/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
+++ b/llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.h
@@ -115,7 +115,7 @@ class COFFLinkGraphBuilder {
jitlink::Linkage Linkage;
orc::ExecutorAddrDiff Size;
};
- std::vector<Optional<ComdatExportRequest>> PendingComdatExports;
+ std::vector<std::optional<ComdatExportRequest>> PendingComdatExports;
// This represents a pending request to create a weak external symbol with a
// name.
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
index 7cbc9f33b182c..ba6cfaf8aa947 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
+++ b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
@@ -37,8 +37,9 @@ class MachOLinkGraphBuilder {
friend class MachOLinkGraphBuilder;
private:
- NormalizedSymbol(Optional<StringRef> Name, uint64_t Value, uint8_t Type,
- uint8_t Sect, uint16_t Desc, Linkage L, Scope S)
+ NormalizedSymbol(std::optional<StringRef> Name, uint64_t Value,
+ uint8_t Type, uint8_t Sect, uint16_t Desc, Linkage L,
+ Scope S)
: Name(Name), Value(Value), Type(Type), Sect(Sect), Desc(Desc), L(L),
S(S) {
assert((!Name || !Name->empty()) && "Name must be none or non-empty");
@@ -50,7 +51,7 @@ class MachOLinkGraphBuilder {
NormalizedSymbol(NormalizedSymbol &&) = delete;
NormalizedSymbol &operator=(NormalizedSymbol &&) = delete;
- Optional<StringRef> Name;
+ std::optional<StringRef> Name;
uint64_t Value = 0;
uint8_t Type = 0;
uint8_t Sect = 0;
diff --git a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
index 642aa74bd4849..40716a7f9b611 100644
--- a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
@@ -164,7 +164,7 @@ COFFPlatform::Create(ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD, const char *OrcRuntimePath,
LoadDynamicLibrary LoadDynLibrary, bool StaticVCRuntime,
const char *VCRuntimePath,
- Optional<SymbolAliasMap> RuntimeAliases) {
+ std::optional<SymbolAliasMap> RuntimeAliases) {
auto &EPC = ES.getExecutorProcessControl();
// If the target is not supported then bail out immediately.
diff --git a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
index 9386a03795041..6448adaa0ceb3 100644
--- a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
@@ -102,12 +102,12 @@ class PartitioningIRMaterializationUnit : public IRMaterializationUnit {
CompileOnDemandLayer &Parent;
};
-Optional<CompileOnDemandLayer::GlobalValueSet>
+std::optional<CompileOnDemandLayer::GlobalValueSet>
CompileOnDemandLayer::compileRequested(GlobalValueSet Requested) {
return std::move(Requested);
}
-Optional<CompileOnDemandLayer::GlobalValueSet>
+std::optional<CompileOnDemandLayer::GlobalValueSet>
CompileOnDemandLayer::compileWholeModule(GlobalValueSet Requested) {
return std::nullopt;
}
diff --git a/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
index eb24221b0c16e..00032e4dca3fe 100644
--- a/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
@@ -111,7 +111,7 @@ Expected<std::unique_ptr<ELFNixPlatform>>
ELFNixPlatform::Create(ExecutionSession &ES,
ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD, const char *OrcRuntimePath,
- Optional<SymbolAliasMap> RuntimeAliases) {
+ std::optional<SymbolAliasMap> RuntimeAliases) {
auto &EPC = ES.getExecutorProcessControl();
diff --git a/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp b/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
index b980b5055cc65..30d641ee00cf8 100644
--- a/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/EPCDebugObjectRegistrar.cpp
@@ -16,9 +16,9 @@
namespace llvm {
namespace orc {
-Expected<std::unique_ptr<EPCDebugObjectRegistrar>>
-createJITLoaderGDBRegistrar(ExecutionSession &ES,
- Optional<ExecutorAddr> RegistrationFunctionDylib) {
+Expected<std::unique_ptr<EPCDebugObjectRegistrar>> createJITLoaderGDBRegistrar(
+ ExecutionSession &ES,
+ std::optional<ExecutorAddr> RegistrationFunctionDylib) {
auto &EPC = ES.getExecutorProcessControl();
if (!RegistrationFunctionDylib) {
diff --git a/llvm/lib/ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp b/llvm/lib/ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp
index 37dea5ca056a4..3aa94a7f43e2e 100644
--- a/llvm/lib/ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp
@@ -16,9 +16,9 @@ using namespace llvm::orc::shared;
namespace llvm {
namespace orc {
-Expected<std::unique_ptr<EPCEHFrameRegistrar>>
-EPCEHFrameRegistrar::Create(ExecutionSession &ES,
- Optional<ExecutorAddr> RegistrationFunctionsDylib) {
+Expected<std::unique_ptr<EPCEHFrameRegistrar>> EPCEHFrameRegistrar::Create(
+ ExecutionSession &ES,
+ std::optional<ExecutorAddr> RegistrationFunctionsDylib) {
// FIXME: Proper mangling here -- we really need to decouple linker mangling
// from DataLayout.
diff --git a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
index fb458c288c1b5..7ba03869d8304 100644
--- a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
@@ -190,7 +190,7 @@ namespace orc {
Expected<std::unique_ptr<MachOPlatform>>
MachOPlatform::Create(ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD, const char *OrcRuntimePath,
- Optional<SymbolAliasMap> RuntimeAliases) {
+ std::optional<SymbolAliasMap> RuntimeAliases) {
auto &EPC = ES.getExecutorProcessControl();
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.cpp
index b76b745cee9bc..7546b3f8d0fa5 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.cpp
@@ -14,7 +14,7 @@ namespace llvm {
namespace orc {
int runAsMain(int (*Main)(int, char *[]), ArrayRef<std::string> Args,
- Optional<StringRef> ProgramName) {
+ std::optional<StringRef> ProgramName) {
std::vector<std::unique_ptr<char[]>> ArgVStorage;
std::vector<char *> ArgV;
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h
index ac9d4d4602174..f564b0035bffd 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCheckerImpl.h
@@ -57,7 +57,7 @@ class RuntimeDyldCheckerImpl {
getStubOrGOTAddrFor(StringRef StubContainerName, StringRef Symbol,
bool IsInsideLoad, bool IsStubAddr) const;
- Optional<uint64_t> getSectionLoadAddress(void *LocalAddr) const;
+ std::optional<uint64_t> getSectionLoadAddress(void *LocalAddr) const;
IsSymbolValidFunction IsSymbolValid;
GetSymbolInfoFunction GetSymbolInfo;
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 59e7bda3b1015..aee6f20246f74 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -846,7 +846,7 @@ int runOrcJIT(const char *ProgName) {
// Get TargetTriple and DataLayout from the main module if they're explicitly
// set.
std::optional<Triple> TT;
- Optional<DataLayout> DL;
+ std::optional<DataLayout> DL;
MainModule.withModuleDo([&](Module &M) {
if (!M.getTargetTriple().empty())
TT = Triple(M.getTargetTriple());
More information about the llvm-commits
mailing list