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

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 11:36:06 PDT 2024


================
@@ -5087,6 +5087,19 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
   assert(EllipsisLoc.isInvalid() &&
          "Friend ellipsis but not friend-specified?");
 
+  if (DS.isExportSpecified()) {
+    VisibilityAttr *existingAttr = TagD->getAttr<VisibilityAttr>();
+    if (existingAttr) {
+      VisibilityAttr::VisibilityType existingValue =
+          existingAttr->getVisibility();
+      if (existingValue != VisibilityAttr::Default)
+        Diag(DS.getExportSpecLoc(), diag::err_mismatched_visibility);
+    } else {
+      Tag->addAttr(
----------------
efriedma-quic wrote:

Not sure adding implicit attributes is necessary?

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


More information about the cfe-commits mailing list