aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-05 04:13:11 +0000
committerFangrui Song <i@maskray.me>2022-12-05 04:13:11 +0000
commit89fae41ef142892d8d6c20ead28465a34e12172b (patch)
tree95d80b9764e5d1d25bf8485a8426e6a409930b50 /llvm/lib/IR/ConstantFold.cpp
parent768cae4a5ab3a564b25ed36c379423f71b42d9d0 (diff)
downloadllvm-89fae41ef142892d8d6c20ead28465a34e12172b.zip
llvm-89fae41ef142892d8d6c20ead28465a34e12172b.tar.gz
llvm-89fae41ef142892d8d6c20ead28465a34e12172b.tar.bz2
[IR] llvm::Optional => std::optional
Many llvm/IR/* files have been migrated by other contributors. This migrates most remaining files.
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 1815bba..a487aa41 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -2022,7 +2022,7 @@ static Constant *foldGEPOfGEP(GEPOperator *GEP, Type *PointeeTy, bool InBounds,
// The combined GEP normally inherits its index inrange attribute from
// the inner GEP, but if the inner GEP's last index was adjusted by the
// outer GEP, any inbounds attribute on that index is invalidated.
- Optional<unsigned> IRIndex = GEP->getInRangeIndex();
+ std::optional<unsigned> IRIndex = GEP->getInRangeIndex();
if (IRIndex && *IRIndex == GEP->getNumIndices() - 1)
IRIndex = std::nullopt;
@@ -2033,7 +2033,7 @@ static Constant *foldGEPOfGEP(GEPOperator *GEP, Type *PointeeTy, bool InBounds,
Constant *llvm::ConstantFoldGetElementPtr(Type *PointeeTy, Constant *C,
bool InBounds,
- Optional<unsigned> InRangeIndex,
+ std::optional<unsigned> InRangeIndex,
ArrayRef<Value *> Idxs) {
if (Idxs.empty()) return C;