aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-18 23:07:11 -0700
committerKazu Hirata <kazu@google.com>2022-06-18 23:07:11 -0700
commit129b531c9c67fc50ef9dcb7d28d7081546213ac1 (patch)
treea8b4769c0d461caddac853ce26db0058acc710df /llvm/lib/IR/Attributes.cpp
parent1e556f459b44dd0ca4073e932f66ecb6f40fe31a (diff)
downloadllvm-129b531c9c67fc50ef9dcb7d28d7081546213ac1.zip
llvm-129b531c9c67fc50ef9dcb7d28d7081546213ac1.tar.gz
llvm-129b531c9c67fc50ef9dcb7d28d7081546213ac1.tar.bz2
[llvm] Use value_or instead of getValueOr (NFC)
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 2006d2f..fa6638f 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -60,7 +60,7 @@ static uint64_t packAllocSizeArgs(unsigned ElemSizeArg,
"Attempting to pack a reserved value");
return uint64_t(ElemSizeArg) << 32 |
- NumElemsArg.getValueOr(AllocSizeNumElemsNotPresent);
+ NumElemsArg.value_or(AllocSizeNumElemsNotPresent);
}
static std::pair<unsigned, Optional<unsigned>>
@@ -76,7 +76,7 @@ unpackAllocSizeArgs(uint64_t Num) {
static uint64_t packVScaleRangeArgs(unsigned MinValue,
Optional<unsigned> MaxValue) {
- return uint64_t(MinValue) << 32 | MaxValue.getValueOr(0);
+ return uint64_t(MinValue) << 32 | MaxValue.value_or(0);
}
static std::pair<unsigned, Optional<unsigned>>
@@ -438,7 +438,7 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
unsigned MinValue = getVScaleRangeMin();
Optional<unsigned> MaxValue = getVScaleRangeMax();
return ("vscale_range(" + Twine(MinValue) + "," +
- Twine(MaxValue.getValueOr(0)) + ")")
+ Twine(MaxValue.value_or(0)) + ")")
.str();
}