forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add opt-in mode to resolve concrete functions (chapel-lang#24036)
When generating a .dyno file, we need to resolve and code-generate the concrete functions for separate compilation to make sense. Additionally, it is sometimes useful to resolve concrete functions as a way to ensuring the quality of one's library. So, this PR adds an experimental opt-in flag `--resolve-concrete-fns` to enable resolving concrete functions. Having this behavior be on by default is discussed in issue chapel-lang#10276 but I don't need it to be on-by-default for my purposes. The implementation is based upon earlier work by @bradcray in the branch from PR chapel-lang#10449. Some functions are overloads that exist to give an error message; e.g. a function containing only a `compilerError` call. I think that the ideal case for such functions would be for the compiler to resolve them but still produce the error message at call sites. This will require some attention with the separate compilation. However, such behavior is difficult to implement with the production resolver and I opted to leave it alone for now & I plan to revisit when we have the new resolver online. So, this PR uses a workaround for such functions by marking them with a new pragma to disable their resolution under `--resolve-concrete-fns`. This is also a difference from @bradcray's previous effort, which resolved such functions but instructed the compiler to hide the errors and warnings. I am concerned that this hiding strategy would hide real errors. Additionally, this PR removes a few deprecated features rather than updating them with the pragma. It removes `CHPL_AUX_FILESYS` and `file.localesForRegion`. Lastly, this PR updates some module code to address bugs that were revealed by compiling simple programs with `--resolve-concrete-fns`. Reviewed by @DanilaFe - thanks! - [x] full comm=none testing
- Loading branch information
Showing
33 changed files
with
169 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
proc foo() { | ||
var x: int = "hello"; | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--resolve-concrete-fns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resolve-concrete-fns.chpl:1: In function 'foo': | ||
resolve-concrete-fns.chpl:2: error: cannot initialize 'x' of type 'int(64)' from '"hello"' |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.