- Notifications
You must be signed in to change notification settings - Fork14.5k
[flang] Main program symbol no longer conflicts with the other symbols#149169
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
... by making main program symbol names upper case.
|
eugeneepshteyn commentedJul 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm not using private e-mail address. |
Uh oh!
There was an error while loading.Please reload this page.
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
these twoif
statements could each be combined with the preceding local variable declarations.
413e71b
intollvm:mainUh oh!
There was an error while loading.Please reload this page.
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
|
eugeneepshteyn commentedJul 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Test modifications:#149508 |
Uh oh!
There was an error while loading.Please reload this page.
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.