-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[Flang] Add parsing and attribute registration for SIMPLE specifier #161285
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -265,6 +265,7 @@ class AttrsVisitor : public virtual BaseVisitor { | |
| HANDLE_ATTR_CLASS(PrefixSpec::Non_Recursive, NON_RECURSIVE) | ||
| HANDLE_ATTR_CLASS(PrefixSpec::Pure, PURE) | ||
| HANDLE_ATTR_CLASS(PrefixSpec::Recursive, RECURSIVE) | ||
| HANDLE_ATTR_CLASS(PrefixSpec::Simple, SIMPLE) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can a procedure be both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because all SIMPLE procedures are also PURE, an explicit SIMPLE attribute should also set the PURE attribute. There is a mechanism whereby one can mark a symbol with an attribute and note that it is implicit. |
||
| HANDLE_ATTR_CLASS(TypeAttrSpec::BindC, BIND_C) | ||
| HANDLE_ATTR_CLASS(BindAttr::Deferred, DEFERRED) | ||
| HANDLE_ATTR_CLASS(BindAttr::Non_Overridable, NON_OVERRIDABLE) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ! RUN: %flang_fc1 -fdebug-unparse-no-sema %s 2>&1 | FileCheck %s | ||
|
|
||
| ! Test that SIMPLE function specifier is recognized | ||
| ! by the parser and the unparser. This test does not | ||
| ! exercise semantic checks. | ||
|
|
||
| simple function foo() | ||
| return | ||
| end function | ||
|
|
||
| ! CHECK: SIMPLE FUNCTION foo() | ||
| ! CHECK-NEXT: RETURN | ||
| ! CHECK-NEXT: END FUNCTION | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ! RUN: %flang_fc1 -fdebug-dump-parse-tree %s | FileCheck %s | ||
|
|
||
| ! Check that SIMPLE is recognized in the parse tree | ||
|
|
||
| simple function foo() | ||
| return | ||
| end function | ||
|
|
||
| ! CHECK: Simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new functions are just checking for the
SIMPLEattribute. But see the implementation ofIsPureProcedureimmediately above -- it's probably not so easy. And you'll want to extendIsPureProcedureso that it exploits the fact thatSIMPLEalso impliesPURE.