bool hasName(const std::string &FunctionName) const {
auto Res =
forEachName([&](StringRef Name) { return Name == FunctionName; });
- return Res.hasValue();
+ return Res.has_value();
}
/// Check if any of function names matches the given regex.
AttrOffset = AttrVal->Offset;
Value = AttrVal->V;
const Optional<uint64_t> Result = Value.getAsAddress();
- if (Result.hasValue()) {
+ if (Result) {
const uint64_t Address = *Result;
uint64_t NewAddress = 0;
if (const BinaryFunction *Function =
Function.forEachName([&ForceFunctionsNR](StringRef Name) {
return ForceFunctionsNR.count(Name.str());
});
- return Match.hasValue();
+ return Match.has_value();
}
for (std::string &Name : opts::SkipFunctionNames)
Optional<uint64_t> BaseAddress =
BC->getBaseAddressForMapping(0x7f13f5556000, 0x10e8c000);
- ASSERT_TRUE(BaseAddress.hasValue());
+ ASSERT_TRUE(BaseAddress.has_value());
ASSERT_EQ(*BaseAddress, 0x7f13e46c9000ULL);
BaseAddress = BC->getBaseAddressForMapping(0x7f13f5556000, 0x137a000);
- ASSERT_FALSE(BaseAddress.hasValue());
+ ASSERT_FALSE(BaseAddress.has_value());
}
BC->MIB->addEHInfo(Inst, MCPlus::MCLandingPad(LPSymbol, Value));
// Round-trip encoding-decoding check for negative values
Optional<MCPlus::MCLandingPad> EHInfo = BC->MIB->getEHInfo(Inst);
- ASSERT_TRUE(EHInfo.hasValue());
+ ASSERT_TRUE(EHInfo.has_value());
MCPlus::MCLandingPad LP = EHInfo.getValue();
uint64_t DecodedValue = LP.second;
ASSERT_EQ(Value, DecodedValue);
Optional<StringRef> OptionalCurBundleID = *CurBundleIDOrErr;
// No device code in this child, skip.
- if (!OptionalCurBundleID.hasValue())
+ if (!OptionalCurBundleID)
continue;
StringRef CodeObject = *OptionalCurBundleID;
: ExprAST(Expr_Return, std::move(loc)), expr(std::move(expr)) {}
llvm::Optional<ExprAST *> getExpr() {
- if (expr.hasValue())
+ if (expr.has_value())
return expr->get();
return llvm::None;
}
void ASTDumper::dump(ReturnExprAST *node) {
INDENT();
llvm::errs() << "Return\n";
- if (node->getExpr().hasValue())
+ if (node->getExpr().has_value())
return dump(*node->getExpr());
{
INDENT();
: ExprAST(Expr_Return, std::move(loc)), expr(std::move(expr)) {}
llvm::Optional<ExprAST *> getExpr() {
- if (expr.hasValue())
+ if (expr.has_value())
return expr->get();
return llvm::None;
}
// 'return' takes an optional expression, handle that case here.
mlir::Value expr = nullptr;
- if (ret.getExpr().hasValue()) {
+ if (ret.getExpr().has_value()) {
if (!(expr = mlirGen(*ret.getExpr().value())))
return mlir::failure();
}
void ASTDumper::dump(ReturnExprAST *node) {
INDENT();
llvm::errs() << "Return\n";
- if (node->getExpr().hasValue())
+ if (node->getExpr().has_value())
return dump(*node->getExpr());
{
INDENT();
: ExprAST(Expr_Return, std::move(loc)), expr(std::move(expr)) {}
llvm::Optional<ExprAST *> getExpr() {
- if (expr.hasValue())
+ if (expr.has_value())
return expr->get();
return llvm::None;
}
// 'return' takes an optional expression, handle that case here.
mlir::Value expr = nullptr;
- if (ret.getExpr().hasValue()) {
+ if (ret.getExpr().has_value()) {
if (!(expr = mlirGen(*ret.getExpr().value())))
return mlir::failure();
}
void ASTDumper::dump(ReturnExprAST *node) {
INDENT();
llvm::errs() << "Return\n";
- if (node->getExpr().hasValue())
+ if (node->getExpr().has_value())
return dump(*node->getExpr());
{
INDENT();
: ExprAST(Expr_Return, std::move(loc)), expr(std::move(expr)) {}
llvm::Optional<ExprAST *> getExpr() {
- if (expr.hasValue())
+ if (expr.has_value())
return expr->get();
return llvm::None;
}
// 'return' takes an optional expression, handle that case here.
mlir::Value expr = nullptr;
- if (ret.getExpr().hasValue()) {
+ if (ret.getExpr().has_value()) {
if (!(expr = mlirGen(*ret.getExpr().value())))
return mlir::failure();
}
void ASTDumper::dump(ReturnExprAST *node) {
INDENT();
llvm::errs() << "Return\n";
- if (node->getExpr().hasValue())
+ if (node->getExpr().has_value())
return dump(*node->getExpr());
{
INDENT();
: ExprAST(Expr_Return, std::move(loc)), expr(std::move(expr)) {}
llvm::Optional<ExprAST *> getExpr() {
- if (expr.hasValue())
+ if (expr.has_value())
return expr->get();
return llvm::None;
}
// 'return' takes an optional expression, handle that case here.
mlir::Value expr = nullptr;
- if (ret.getExpr().hasValue()) {
+ if (ret.getExpr().has_value()) {
if (!(expr = mlirGen(*ret.getExpr().value())))
return mlir::failure();
}
void ASTDumper::dump(ReturnExprAST *node) {
INDENT();
llvm::errs() << "Return\n";
- if (node->getExpr().hasValue())
+ if (node->getExpr().has_value())
return dump(*node->getExpr());
{
INDENT();
: ExprAST(Expr_Return, std::move(loc)), expr(std::move(expr)) {}
llvm::Optional<ExprAST *> getExpr() {
- if (expr.hasValue())
+ if (expr.has_value())
return expr->get();
return llvm::None;
}
// 'return' takes an optional expression, handle that case here.
mlir::Value expr = nullptr;
- if (ret.getExpr().hasValue()) {
+ if (ret.getExpr().has_value()) {
if (!(expr = mlirGen(*ret.getExpr().value())))
return mlir::failure();
}
void ASTDumper::dump(ReturnExprAST *node) {
INDENT();
llvm::errs() << "Return\n";
- if (node->getExpr().hasValue())
+ if (node->getExpr().has_value())
return dump(*node->getExpr());
{
INDENT();
: ExprAST(Expr_Return, std::move(loc)), expr(std::move(expr)) {}
llvm::Optional<ExprAST *> getExpr() {
- if (expr.hasValue())
+ if (expr.has_value())
return expr->get();
return llvm::None;
}
// 'return' takes an optional expression, handle that case here.
mlir::Value expr = nullptr;
- if (ret.getExpr().hasValue()) {
+ if (ret.getExpr().has_value()) {
if (!(expr = mlirGen(*ret.getExpr().value())))
return mlir::failure();
}
void ASTDumper::dump(ReturnExprAST *node) {
INDENT();
llvm::errs() << "Return\n";
- if (node->getExpr().hasValue())
+ if (node->getExpr().has_value())
return dump(*node->getExpr());
{
INDENT();