Skip to content

Commit

Permalink
[flang] Make not yet implemented messages more consistent
Browse files Browse the repository at this point in the history
To make it easier to find things that are not yet implemented, I'm changing the
messages that appear in the compiler's output to all have the string "not yet
implemented:".

These changes apply to files in the front end.  I have another set of changes
to files in the lowering code.

Differential Revision: https://reviews.llvm.org/D122355
  • Loading branch information
psteinfeld committed Mar 24, 2022
1 parent 826e661 commit df209b8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
44 changes: 23 additions & 21 deletions flang/lib/Semantics/expression.cpp
Expand Up @@ -1835,7 +1835,7 @@ static std::optional<parser::CharBlock> GetPassName(
static int GetPassIndex(const Symbol &proc) {
CHECK(!proc.attrs().test(semantics::Attr::NOPASS));
std::optional<parser::CharBlock> passName{GetPassName(proc)};
const auto *interface{semantics::FindInterface(proc)};
const auto *interface { semantics::FindInterface(proc) };
if (!passName || !interface) {
return 0; // first argument is passed-object
}
Expand Down Expand Up @@ -3215,26 +3215,28 @@ void ArgumentAnalyzer::Analyze(
// be detected and represented (they're not expressions).
// TODO: C1534: Don't allow a "restricted" specific intrinsic to be passed.
std::optional<ActualArgument> actual;
std::visit(common::visitors{
[&](const common::Indirection<parser::Expr> &x) {
actual = AnalyzeExpr(x.value());
SetArgSourceLocation(actual, x.value().source);
},
[&](const parser::AltReturnSpec &label) {
if (!isSubroutine) {
context_.Say(
"alternate return specification may not appear on"
" function reference"_err_en_US);
}
actual = ActualArgument(label.v);
},
[&](const parser::ActualArg::PercentRef &) {
context_.Say("TODO: %REF() argument"_err_en_US);
},
[&](const parser::ActualArg::PercentVal &) {
context_.Say("TODO: %VAL() argument"_err_en_US);
},
},
std::visit(
common::visitors{
[&](const common::Indirection<parser::Expr> &x) {
actual = AnalyzeExpr(x.value());
SetArgSourceLocation(actual, x.value().source);
},
[&](const parser::AltReturnSpec &label) {
if (!isSubroutine) {
context_.Say("alternate return specification may not appear on"
" function reference"_err_en_US);
}
actual = ActualArgument(label.v);
},
[&](const parser::ActualArg::PercentRef &) {
context_.Say(
"not yet implemented: %REF() intrinsic for arguments"_err_en_US);
},
[&](const parser::ActualArg::PercentVal &) {
context_.Say(
"not yet implemetned: %VAL() intrinsic for arguments"_err_en_US);
},
},
std::get<parser::ActualArg>(arg.t).u);
if (actual) {
if (const auto &argKW{std::get<std::optional<parser::Keyword>>(arg.t)}) {
Expand Down
2 changes: 1 addition & 1 deletion flang/lib/Semantics/resolve-names.cpp
Expand Up @@ -4721,7 +4721,7 @@ bool DeclarationVisitor::Pre(const parser::StructureDef &def) {
}

bool DeclarationVisitor::Pre(const parser::Union::UnionStmt &) {
Say("UNION is not yet supported"_err_en_US); // TODO
Say("not yet implemented: support for UNION"_err_en_US); // TODO
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion flang/runtime/edit-output.cpp
Expand Up @@ -411,7 +411,7 @@ bool RealOutputEditing<binaryPrecision>::EditListDirectedOutput(
template <int binaryPrecision>
bool RealOutputEditing<binaryPrecision>::EditEXOutput(const DataEdit &) {
io_.GetIoErrorHandler().Crash(
"EX output editing is not yet implemented"); // TODO
"not yet implemented: EX output editing"); // TODO
}

template <int KIND> bool RealOutputEditing<KIND>::Edit(const DataEdit &edit) {
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Semantics/struct01.f90
Expand Up @@ -6,7 +6,7 @@ program main
structure /s/
!ERROR: /s/ is not a known STRUCTURE
record /s/ attemptToRecurse
!ERROR: UNION is not yet supported
!ERROR: not yet implemented: support for UNION
union
map
integer j
Expand Down

0 comments on commit df209b8

Please sign in to comment.