[llvm] 54ea422 - [Orc] Use std::optional in ObjectFileInterface.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 15:24:39 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T15:24:34-08:00
New Revision: 54ea422d9f7ac59a6dbddbd01dc3ca8b925419da
URL: https://github.com/llvm/llvm-project/commit/54ea422d9f7ac59a6dbddbd01dc3ca8b925419da
DIFF: https://github.com/llvm/llvm-project/commit/54ea422d9f7ac59a6dbddbd01dc3ca8b925419da.diff
LOG: [Orc] Use std::optional in ObjectFileInterface.cpp (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
index 597030091f11..f3f0b7db03c7 100644
--- a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
@@ -15,6 +15,7 @@
#include "llvm/Object/MachO.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Debug.h"
+#include <optional>
#define DEBUG_TYPE "orc"
@@ -151,7 +152,7 @@ static Expected<MaterializationUnit::Interface>
getCOFFObjectFileSymbolInfo(ExecutionSession &ES,
const object::COFFObjectFile &Obj) {
MaterializationUnit::Interface I;
- std::vector<Optional<object::coff_aux_section_definition>> ComdatDefs(
+ std::vector<std::optional<object::coff_aux_section_definition>> ComdatDefs(
Obj.getNumberOfSections() + 1);
for (auto &Sym : Obj.symbols()) {
Expected<uint32_t> SymFlagsOrErr = Sym.getFlags();
More information about the llvm-commits
mailing list