chapel-lang/chapel — pull request #667 by hildeth (2014-10-21 16:59:15+00:00)
Title: Make the use of FLAG_COMPILER_GENERATED uniform

The use of FLAG_COMPILER_GENERATED was overloaded: It was used in the parsing routines to mark break and continue labels so they were not included in the symbol table in the scopeResolve pass. The flag was later used to tag functions that are (you guessed it!) compiler-generated, so that user-defined versions are able to override these.

Some of the functions built in buildDefaultFunctions.cpp should have had the flag applied, but because of interaction with that symbol table filter the flag could not be applied. I left it as a todo after the assign-to-ref work earlier this year.

In this patch, I first split the flag in two and used the new FLAG_INVISIBLE_LABEL for the original purpose. Then I found that by making the symbol table filter pay attention only to that flag (and let all functions with FLAG_COMPILER_GENERATED populate the symbol table), the compiler still functioned correctly.

Then I added all of the missing FLAG_COMPILER_GENERATED in buildDefaultFunctions.cpp and ran a full test run. I ended up with 4 regressions. Addition of the flag to the generated user main function was overly aggressive so I backed that out, curing 3 tests. The final test I cured by adding an explicit pragma "compiler generated" to put the user getter function on equal footing with the compiler-generated ones.

Then, I found that the new FLAG_INVISIBLE_LABEL and two existing FLAG_LABEL_BREAK and FLAG_LABEL_CONTINUE were moot, so I removed them.