[flang] Main program symbol no longer conflicts with the other symbols#149169
[flang] Main program symbol no longer conflicts with the other symbols#149169eugeneepshteyn merged 15 commits intollvm:mainfrom
Conversation
... by making main program symbol names upper case.
|
|
I'm not using private e-mail address. |
| // Uppercase the name of the main program, so that its symbol name | ||
| // would be unique from similarly named non-main-program symbols. | ||
| auto upperCaseCharBlock = [](const parser::CharBlock &cb) { | ||
| char *ch = const_cast<char *>(cb.begin()); |
There was a problem hiding this comment.
Please always use braced initialization in the bits of flang-new that are modern C++.
| } | ||
| const parser::CharBlock *endName{GetStmtName( | ||
| std::get<parser::Statement<parser::EndProgramStmt>>(mainProgram.t))}; | ||
| if (endName) { |
There was a problem hiding this comment.
these two if statements could each be combined with the preceding local variable declarations.
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/34156 Here is the relevant piece of the build log for the reference |
Test modifications: #149508 |
|
Hi |
flang never preserved the original case of identifiers from the original source code, all identifiers were lower cased by default. Due to implementation specifics, it was necessary to make an exception for MAIN program name and upper case it. I don't expect this to be something that happens often. Would it be possible to change GDB tests to match? |
The following code is now accepted:
The PROGRAM name doesn't really have an effect on the compilation result, so it shouldn't result in symbol name conflicts.
This change makes the main program symbol name all uppercase in the cooked character stream. This makes it distinct from all other symbol names that are all lowercase in cooked character stream.
Modified the tests that were checking for lower case main program name.