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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 11 11:13:59 PDT 2025


================
@@ -7502,6 +7502,27 @@ attribute requires a string literal argument to identify the handle being releas
   }];
 }
 
+def zOSExportDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Use the _Export keyword with a function name or external variable to declare
+that it is to be exported (made available to other modules). You must define
+the object name in the same translation unit in which you use the _Export
+keyword. For example:
+
+.. code-block:: c
+
+  int _Export anthony(float);
+
+This statement exports the function anthony, if you define the function in the
+translation unit. The _Export keyword must immediately precede the object name.
+If you apply the _Export keyword to a class, the compiler automatically exports
+all static data members and member functions of the class. However, if you want
+it to apply to individual class members, then you must apply it to each member
+that can be referenced.
----------------
AaronBallman wrote:

```suggestion
This statement exports the function ``anthony``, if you define the function in the
translation unit. The ``_Export`` keyword must immediately precede the declaration name.
If you apply the ``_Export`` keyword to a class, the compiler automatically exports
all static data members and member functions of the class. However, if you want
it to apply to individual class members, then you must apply it to each member
that can be referenced.
```

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


More information about the cfe-commits mailing list