[clang] [SystemZ][z/OS] Implement #pragma export (PR #141671)
Sean Perry via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 26 12:43:12 PDT 2025
perry-ca wrote:
> I only made it through the first bit of hte implementation, but parsing doesn't seem right to me, it doesn't recovery nicely as far as I can tell.
>
> AS far as the design here, it isn't clear to me how this manages all of the C++ lookup/scoping/etc, and I don't see how the data structure provided would fix that.
>
> Also, you seem to be doing some sort of parse during statement parsing, but no tests that show what this does/how this works when the scope isn't the local one? Or when this is in a function definition/etc.
>
> ALSO: I don't see any template instantiation code, which this would need for statement/decl level declaration.
This pragma isn't meant to be able to accept all valid C++ declarations. It only accept two forms in the XL C/C++ compiler. These are:
- just an identifier. This will match a variable or an function declared as extern "C" (eg. `foo`)
- an identifier + an argument list. This will match a basic function declarator. The intent is to accept something like `sin(double)` and no more. This is to match the XL C/C++ behaviour. The system header have pragmas in this form.
I am going to remove the code to handle the second form from this PR and focus on providing just the basic identifier form. I'll update the description to reflect this.
https://github.com/llvm/llvm-project/pull/141671
More information about the cfe-commits
mailing list