Use value instead of getValue (NFC)

This commit is contained in:
Kazu Hirata 2022-08-06 11:21:39 -07:00
parent 9750648cb4
commit c8e6ebd74e
13 changed files with 19 additions and 19 deletions

View File

@ -142,7 +142,7 @@ TEST_P(MCPlusBuilderTester, Annotation) {
// Round-trip encoding-decoding check for negative values // Round-trip encoding-decoding check for negative values
Optional<MCPlus::MCLandingPad> EHInfo = BC->MIB->getEHInfo(Inst); Optional<MCPlus::MCLandingPad> EHInfo = BC->MIB->getEHInfo(Inst);
ASSERT_TRUE(EHInfo.has_value()); ASSERT_TRUE(EHInfo.has_value());
MCPlus::MCLandingPad LP = EHInfo.getValue(); MCPlus::MCLandingPad LP = EHInfo.value();
uint64_t DecodedValue = LP.second; uint64_t DecodedValue = LP.second;
ASSERT_EQ(Value, DecodedValue); ASSERT_EQ(Value, DecodedValue);

View File

@ -581,7 +581,7 @@ void RVVEmitter::createRVVIntrinsics(
Name, SuffixStr, OverloadedName, OverloadedSuffixStr, IRName, Name, SuffixStr, OverloadedName, OverloadedSuffixStr, IRName,
/*IsMask=*/false, /*HasMaskedOffOperand=*/false, HasVL, /*IsMask=*/false, /*HasMaskedOffOperand=*/false, HasVL,
UnMaskedPolicyScheme, SupportOverloading, HasBuiltinAlias, UnMaskedPolicyScheme, SupportOverloading, HasBuiltinAlias,
ManualCodegen, PolicyTypes.getValue(), IntrinsicTypes, ManualCodegen, PolicyTypes.value(), IntrinsicTypes,
RequiredFeatures, NF, P, IsPrototypeDefaultTU)); RequiredFeatures, NF, P, IsPrototypeDefaultTU));
} }
if (!HasMasked) if (!HasMasked)
@ -593,7 +593,7 @@ void RVVEmitter::createRVVIntrinsics(
Name, SuffixStr, OverloadedName, OverloadedSuffixStr, MaskedIRName, Name, SuffixStr, OverloadedName, OverloadedSuffixStr, MaskedIRName,
/*IsMasked=*/true, HasMaskedOffOperand, HasVL, MaskedPolicyScheme, /*IsMasked=*/true, HasMaskedOffOperand, HasVL, MaskedPolicyScheme,
SupportOverloading, HasBuiltinAlias, MaskedManualCodegen, SupportOverloading, HasBuiltinAlias, MaskedManualCodegen,
MaskTypes.getValue(), IntrinsicTypes, RequiredFeatures, NF, MaskTypes.value(), IntrinsicTypes, RequiredFeatures, NF,
Policy::PolicyNone, IsPrototypeDefaultTU)); Policy::PolicyNone, IsPrototypeDefaultTU));
if (MaskedPolicyScheme == PolicyScheme::SchemeNone) if (MaskedPolicyScheme == PolicyScheme::SchemeNone)
continue; continue;
@ -608,7 +608,7 @@ void RVVEmitter::createRVVIntrinsics(
Name, SuffixStr, OverloadedName, OverloadedSuffixStr, Name, SuffixStr, OverloadedName, OverloadedSuffixStr,
MaskedIRName, /*IsMasked=*/true, HasMaskedOffOperand, HasVL, MaskedIRName, /*IsMasked=*/true, HasMaskedOffOperand, HasVL,
MaskedPolicyScheme, SupportOverloading, HasBuiltinAlias, MaskedPolicyScheme, SupportOverloading, HasBuiltinAlias,
MaskedManualCodegen, PolicyTypes.getValue(), IntrinsicTypes, MaskedManualCodegen, PolicyTypes.value(), IntrinsicTypes,
RequiredFeatures, NF, P, IsPrototypeDefaultTU)); RequiredFeatures, NF, P, IsPrototypeDefaultTU));
} }
} // End for Log2LMULList } // End for Log2LMULList

View File

@ -2181,10 +2181,10 @@ static Value *simplifyAndInst(Value *Op0, Value *Op1, const SimplifyQuery &Q,
} }
if (Optional<bool> Implied = isImpliedCondition(Op1, Op0, Q.DL)) { if (Optional<bool> Implied = isImpliedCondition(Op1, Op0, Q.DL)) {
// If Op1 is true implies Op0 is true, then Op1 is a subset of Op0. // If Op1 is true implies Op0 is true, then Op1 is a subset of Op0.
if (Implied.getValue()) if (Implied.value())
return Op1; return Op1;
// If Op1 is true implies Op0 is false, then they are not true together. // If Op1 is true implies Op0 is false, then they are not true together.
if (!Implied.getValue()) if (!Implied.value())
return ConstantInt::getFalse(Op1->getType()); return ConstantInt::getFalse(Op1->getType());
} }
} }

View File

@ -1504,7 +1504,7 @@ public:
OptionalParseResult result = parseOptionalAssignmentList(lhs, rhs); OptionalParseResult result = parseOptionalAssignmentList(lhs, rhs);
if (!result.has_value()) if (!result.has_value())
return emitError(getCurrentLocation(), "expected '('"); return emitError(getCurrentLocation(), "expected '('");
return result.getValue(); return result.value();
} }
virtual OptionalParseResult virtual OptionalParseResult

View File

@ -73,11 +73,11 @@ DataLayoutEntryAttr DataLayoutEntryAttr::parse(AsmParser &parser) {
std::string identifier; std::string identifier;
SMLoc idLoc = parser.getCurrentLocation(); SMLoc idLoc = parser.getCurrentLocation();
OptionalParseResult parsedType = parser.parseOptionalType(type); OptionalParseResult parsedType = parser.parseOptionalType(type);
if (parsedType.has_value() && failed(parsedType.getValue())) if (parsedType.has_value() && failed(parsedType.value()))
return {}; return {};
if (!parsedType.has_value()) { if (!parsedType.has_value()) {
OptionalParseResult parsedString = parser.parseOptionalString(&identifier); OptionalParseResult parsedString = parser.parseOptionalString(&identifier);
if (!parsedString.has_value() || failed(parsedString.getValue())) { if (!parsedString.has_value() || failed(parsedString.value())) {
parser.emitError(idLoc) << "expected a type or a quoted string"; parser.emitError(idLoc) << "expected a type or a quoted string";
return {}; return {};
} }

View File

@ -344,7 +344,7 @@ static ParseResult parseSwitchOpCases(
if (values.empty() && !integerParseResult.has_value()) if (values.empty() && !integerParseResult.has_value())
return success(); return success();
if (!integerParseResult.has_value() || integerParseResult.getValue()) if (!integerParseResult.has_value() || integerParseResult.value())
return failure(); return failure();
values.push_back(APInt(bitWidth, value)); values.push_back(APInt(bitWidth, value));
@ -542,7 +542,7 @@ parseGEPIndices(OpAsmParser &parser,
OptionalParseResult parsedInteger = OptionalParseResult parsedInteger =
parser.parseOptionalInteger(constantIndex); parser.parseOptionalInteger(constantIndex);
if (parsedInteger.has_value()) { if (parsedInteger.has_value()) {
if (failed(parsedInteger.getValue())) if (failed(parsedInteger.value()))
return failure(); return failure();
constantIndices.push_back(constantIndex); constantIndices.push_back(constantIndex);
return success(); return success();

View File

@ -442,7 +442,7 @@ static Type dispatchParse(AsmParser &parser, bool allowAny = true) {
Type type; Type type;
OptionalParseResult result = parser.parseOptionalType(type); OptionalParseResult result = parser.parseOptionalType(type);
if (result.has_value()) { if (result.has_value()) {
if (failed(result.getValue())) if (failed(result.value()))
return nullptr; return nullptr;
if (!allowAny) { if (!allowAny) {
parser.emitError(keyLoc) << "unexpected type, expected keyword"; parser.emitError(keyLoc) << "unexpected type, expected keyword";

View File

@ -2613,7 +2613,7 @@ ParseResult scf::WhileOp::parse(OpAsmParser &parser, OperationState &result) {
OptionalParseResult listResult = OptionalParseResult listResult =
parser.parseOptionalAssignmentList(regionArgs, operands); parser.parseOptionalAssignmentList(regionArgs, operands);
if (listResult.has_value() && failed(listResult.getValue())) if (listResult.has_value() && failed(listResult.value()))
return failure(); return failure();
FunctionType functionType; FunctionType functionType;

View File

@ -42,7 +42,7 @@ parseFunctionArgumentList(OpAsmParser &parser, bool allowVariadic,
auto argPresent = parser.parseOptionalArgument( auto argPresent = parser.parseOptionalArgument(
argument, /*allowType=*/true, /*allowAttrs=*/true); argument, /*allowType=*/true, /*allowAttrs=*/true);
if (argPresent.has_value()) { if (argPresent.has_value()) {
if (failed(argPresent.getValue())) if (failed(argPresent.value()))
return failure(); // Present but malformed. return failure(); // Present but malformed.
// Reject this if the preceding argument was missing a name. // Reject this if the preceding argument was missing a name.

View File

@ -121,7 +121,7 @@ static ParseResult parseOperandsOrIntegersImpl(
while (true) { while (true) {
OpAsmParser::UnresolvedOperand operand; OpAsmParser::UnresolvedOperand operand;
auto res = parser.parseOptionalOperand(operand); auto res = parser.parseOptionalOperand(operand);
if (res.has_value() && succeeded(res.getValue())) { if (res.has_value() && succeeded(res.value())) {
values.push_back(operand); values.push_back(operand);
attrVals.push_back(dynVal); attrVals.push_back(dynVal);
} else { } else {

View File

@ -419,7 +419,7 @@ Type TestDialect::parseTestType(AsmParser &parser,
Type dynType; Type dynType;
auto parseResult = parseOptionalDynamicType(typeTag, parser, dynType); auto parseResult = parseOptionalDynamicType(typeTag, parser, dynType);
if (parseResult.has_value()) { if (parseResult.has_value()) {
if (succeeded(parseResult.getValue())) if (succeeded(parseResult.value()))
return dynType; return dynType;
return Type(); return Type();
} }

View File

@ -55,9 +55,9 @@ public:
if (!result.has_value()) if (!result.has_value())
return success(); return success();
if (result.getValue().succeeded()) if (result.value().succeeded())
state.addAttribute("message", message); state.addAttribute("message", message);
return result.getValue(); return result.value();
} }
void print(OpAsmPrinter &printer) { void print(OpAsmPrinter &printer) {

View File

@ -683,7 +683,7 @@ static const char *const dialectDynamicAttrParserDispatch = R"(
::mlir::Attribute genAttr; ::mlir::Attribute genAttr;
auto parseResult = parseOptionalDynamicAttr(attrTag, parser, genAttr); auto parseResult = parseOptionalDynamicAttr(attrTag, parser, genAttr);
if (parseResult.has_value()) { if (parseResult.has_value()) {
if (::mlir::succeeded(parseResult.getValue())) if (::mlir::succeeded(parseResult.value()))
return genAttr; return genAttr;
return Attribute(); return Attribute();
} }