[clang] [SystemZ][z/OS] Add visibility features for z/OS (eg. _Export, pragma export) (PR #111035)

Sean Perry via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 20:12:55 PDT 2025


================
@@ -4456,6 +4456,12 @@ void Parser::ParseDeclarationSpecifiers(
       isInvalid = DS.setFunctionSpecNoreturn(Loc, PrevSpec, DiagID);
       break;
 
+    case tok::kw__Export:
+      // If we find kw__Export, it is being applied to a var or function
+      // This will be handled in ParseDeclaratorInternal()
----------------
perry-ca wrote:

The _Export keyword is part of the declarator.  This code is to stop the declspec parsing.  For example, in `int _Export x,y;` only `x` is exported.  The flag was added to the DeclSpec class to handle the case of `class _Export A`.  That is later passed on to the Decl for the class.  If there is a better way to do this, I'd be interested.  We do have to match the existing XL compiler for backwards compatibility.

https://github.com/llvm/llvm-project/pull/111035


More information about the cfe-commits mailing list