Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remaining failures in expression semantics #871

Merged
merged 1 commit into from Dec 16, 2019
Merged

Conversation

klausler
Copy link
Collaborator

Apply implicit typing to names in COMMON that appear in specification expressions

Extend semantic analysis of expressions to catch missing cases

Fix statement function semantics, add degree trig intrinsics

Add GetUltimate to rewrite of bare namelist

Expression analysis must now succeed (barring previous fatal error) and will emit an internal error message when it fails that includes a dump of the expression's parse tree.

@@ -2279,10 +2273,12 @@ MaybeExpr ExpressionAnalyzer::ExprOrVariable(const PARSED &x) {
}

MaybeExpr ExpressionAnalyzer::Analyze(const parser::Expr &expr) {
auto save{GetContextualMessages().SetLocation(expr.source)};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You renamed a similar save variable to restorer in AnalyzeCall so I think that would be a better name here too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do here & everywhere else in lib/.

@@ -78,12 +78,15 @@ class SubprogramDetails {
const std::vector<Symbol *> &dummyArgs() const { return dummyArgs_; }
void add_dummyArg(Symbol &symbol) { dummyArgs_.push_back(&symbol); }
void add_alternateReturn() { dummyArgs_.push_back(nullptr); }
const MaybeExpr &stmtFunction() const { return stmtFunction_; }
void set_stmtFunction(SomeExpr &&expr) { stmtFunction_ = std::move(expr); }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used for anything yet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The CG will need it, though. And I suppose that folding could use it for statement functions in which each dummy argument appears at most once in the body (or whose actual argument can be safely re-evaluated).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the presence of the statement function's expression is the only distinguishing characteristic by which semantics could determine that a subprogram is a statement function, and exclude it from use in various circumstances (e.g., passing the statement function as an actual argument, using the statement function in a generic interface, using the statement function as the target of a pointer assignment, &c.) which I'm sure that we still need to do.

… expressions

Extend semantic analysis of expressions to catch missing cases

Fix statement function semantics, add degree trig intrinsics

Add GetUltimate to rewrite of bare namelist

Address review comments
Copy link
Collaborator

@psteinfeld psteinfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good.

swift-ci pushed a commit to apple/llvm-project that referenced this pull request Apr 9, 2020
…fication expressions

Extend semantic analysis of expressions to catch missing cases

Fix statement function semantics, add degree trig intrinsics

Add GetUltimate to rewrite of bare namelist

Address review comments

Original-commit: flang-compiler/f18@52ff319
Reviewed-on: flang-compiler/f18#871
swift-ci pushed a commit to apple/llvm-project that referenced this pull request Apr 9, 2020
…/pmk-fixes

Fix remaining failures in expression semantics

Original-commit: flang-compiler/f18@7473f0b
Reviewed-on: flang-compiler/f18#871
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
…fication expressions

Extend semantic analysis of expressions to catch missing cases

Fix statement function semantics, add degree trig intrinsics

Add GetUltimate to rewrite of bare namelist

Address review comments

Original-commit: flang-compiler/f18@52ff319
Reviewed-on: flang-compiler/f18#871
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants