[flang] Remove useless dummy return statements

I first added these because I had issues with return type deduction
in lambdas, but they are actually useless when the return type is
specified in the lambda signature.

Original-commit: flang-compiler/f18@5bcbbd8bdc
Tree-same-pre-rewrite: false
This commit is contained in:
Jean Perier 2019-03-29 04:30:35 -07:00
parent 54a3e9af38
commit 382aafad68
2 changed files with 1 additions and 4 deletions

View file

@ -394,7 +394,6 @@ Expr<Type<TypeCategory::Integer, KIND>> FoldOperation(FoldingContext &context,
return Fold(context, ConvertToType<T>(std::move(x)));
}
common::die("int() argument type not valid");
return Expr<T>{std::move(funcRef)}; // unreachable
},
std::move(args[0].value().value().u));
} else if (name == "kind") {
@ -621,7 +620,6 @@ Expr<Type<TypeCategory::Real, KIND>> FoldOperation(FoldingContext &context,
return Fold(context, ConvertToType<T>(std::move(x)));
}
common::die("real() argument type not valid");
return Expr<T>{std::move(funcRef)}; // unreachable
},
std::move(args[0].value().value().u));
}

View file

@ -73,9 +73,8 @@ template<typename TR, typename... ArgInfo> struct CallableHostWrapper {
hostFPE.CheckAndRestoreFloatingPointEnvironment(context);
return host::CastHostToFortran<TR>(res);
} else {
common::die("Internal error: Host does not supports this function types."
common::die("Internal error: Host does not supports this function type."
"This should not have been called for folding");
return Scalar<TR>{}; // unreachable
}
}
static constexpr inline auto MakeScalarCallable() { return &scalarCallable; }