The legacy @PROCESS directive is supported in the IBM XLF compiler to allow specifying compiler option at the source level. This patch is to treat any line that starts with @process as a comment line. This allows code with the directive to be compiled without having syntax errors complaining it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
flang/docs/Extensions.md | ||
---|---|---|
366 | Please note here that the directive is accepted but ignored. | |
flang/lib/Parser/prescan.cpp | ||
780 | Capitalize, please. | |
781 | This should be static and it can be a char array, As coded, this will be a string potentially requiring dynamic allocation and deallocation on every call. static const char pAtProc[]{"process"}; | |
784 | You really need to have a loop limit here to make sure that you don't run off the end of the string. As coded, this loop can index past the end of the string. Use sizeof pAtProcess as the string size. | |
790 | Just return false; here. | |
829–833 | return IsAtProcess(p) ? p : nullptr; |
flang/lib/Parser/prescan.cpp | ||
---|---|---|
783 | The needless parentheses around ++p are more likely to confuse the reader of the code ("why is this parenthesized? what am I missing?") than to clarify matters. |
flang/lib/Parser/prescan.cpp | ||
---|---|---|
783 | I find it easier to read. Anyway, I will remove it. Thanks. |
Please note here that the directive is accepted but ignored.