aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-11-25 12:06:20 -0800
committerKazu Hirata <kazu@google.com>2022-11-25 12:06:20 -0800
commit5672b714fad68dd5e589254e0f5f1ce61eb31c5b (patch)
tree52d506600c0a22c236e43dc7cfdf01ff6562af2f /llvm/lib/IR/Module.cpp
parent171b749dc130bd01ab5c716417c120918c4e6372 (diff)
downloadllvm-5672b714fad68dd5e589254e0f5f1ce61eb31c5b.zip
llvm-5672b714fad68dd5e589254e0f5f1ce61eb31c5b.tar.gz
llvm-5672b714fad68dd5e589254e0f5f1ce61eb31c5b.tar.bz2
[IR] Use std::optional in Module.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
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 5dd114c..33d71fb 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -49,6 +49,7 @@
#include <cassert>
#include <cstdint>
#include <memory>
+#include <optional>
#include <utility>
#include <vector>
@@ -775,7 +776,7 @@ static VersionTuple getSDKVersionMD(Metadata *MD) {
auto *Arr = dyn_cast_or_null<ConstantDataArray>(CM->getValue());
if (!Arr)
return {};
- auto getVersionComponent = [&](unsigned Index) -> Optional<unsigned> {
+ auto getVersionComponent = [&](unsigned Index) -> std::optional<unsigned> {
if (Index >= Arr->getNumElements())
return None;
return (unsigned)Arr->getElementAsInteger(Index);