From e3b557809604d036af6e00c60f012c2025b59a5e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 11 Feb 2023 13:38:04 +0100 Subject: Vendor import of llvm-project main llvmorg-16-init-18548-gb0daacf58f41, the last commit before the upstream release/17.x branch was created. --- llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp') diff --git a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp index e2a0cadb6348..6448adaa0ceb 100644 --- a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp +++ b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp @@ -102,14 +102,14 @@ private: CompileOnDemandLayer &Parent; }; -Optional +std::optional CompileOnDemandLayer::compileRequested(GlobalValueSet Requested) { return std::move(Requested); } -Optional +std::optional CompileOnDemandLayer::compileWholeModule(GlobalValueSet Requested) { - return None; + return std::nullopt; } CompileOnDemandLayer::CompileOnDemandLayer( @@ -237,7 +237,7 @@ void CompileOnDemandLayer::expandPartition(GlobalValueSet &Partition) { bool ContainsGlobalVariables = false; std::vector GVsToAdd; - for (auto *GV : Partition) + for (const auto *GV : Partition) if (isa(GV)) GVsToAdd.push_back( cast(cast(GV)->getAliasee())); @@ -252,7 +252,7 @@ void CompileOnDemandLayer::expandPartition(GlobalValueSet &Partition) { for (auto &G : M.globals()) GVsToAdd.push_back(&G); - for (auto *GV : GVsToAdd) + for (const auto *GV : GVsToAdd) Partition.insert(GV); } @@ -287,7 +287,7 @@ void CompileOnDemandLayer::emitPartition( // Take a 'None' partition to mean the whole module (as opposed to an empty // partition, which means "materialize nothing"). Emit the whole module // unmodified to the base layer. - if (GVsToExtract == None) { + if (GVsToExtract == std::nullopt) { Defs.clear(); BaseLayer.emit(std::move(R), std::move(TSM)); return; @@ -336,13 +336,13 @@ void CompileOnDemandLayer::emitPartition( { std::vector HashGVs; HashGVs.reserve(GVsToExtract->size()); - for (auto *GV : *GVsToExtract) + for (const auto *GV : *GVsToExtract) HashGVs.push_back(GV); llvm::sort(HashGVs, [](const GlobalValue *LHS, const GlobalValue *RHS) { return LHS->getName() < RHS->getName(); }); hash_code HC(0); - for (auto *GV : HashGVs) { + for (const auto *GV : HashGVs) { assert(GV->hasName() && "All GVs to extract should be named by now"); auto GVName = GV->getName(); HC = hash_combine(HC, hash_combine_range(GVName.begin(), GVName.end())); -- cgit v1.2.3