aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.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/Analysis/ConstantFolding.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/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index f2a56d6..f07113a 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -825,7 +825,7 @@ Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0, Constant *Op1,
/// If array indices are not pointer-sized integers, explicitly cast them so
/// that they aren't implicitly casted by the getelementptr.
Constant *CastGEPIndices(Type *SrcElemTy, ArrayRef<Constant *> Ops,
- Type *ResultTy, Optional<unsigned> InRangeIndex,
+ Type *ResultTy, std::optional<unsigned> InRangeIndex,
const DataLayout &DL, const TargetLibraryInfo *TLI) {
Type *IntIdxTy = DL.getIndexType(ResultTy);
Type *IntIdxScalarTy = IntIdxTy->getScalarType();
@@ -992,8 +992,8 @@ Constant *SymbolicallyEvaluateGEP(const GEPOperator *GEP,
// Preserve the inrange index from the innermost GEP if possible. We must
// have calculated the same indices up to and including the inrange index.
- Optional<unsigned> InRangeIndex;
- if (Optional<unsigned> LastIRIndex = InnermostGEP->getInRangeIndex())
+ std::optional<unsigned> InRangeIndex;
+ if (std::optional<unsigned> LastIRIndex = InnermostGEP->getInRangeIndex())
if (SrcElemTy == InnermostGEP->getSourceElementType() &&
NewIdxs.size() > *LastIRIndex) {
InRangeIndex = LastIRIndex;