[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
Tue Apr 15 15:06:39 PDT 2025
================
@@ -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:
My concern here is that you have code scattered in multiple places to control the visibility; you have two different places you add a visibility attribute, and then you override the visibility in codegen. Having overlapping ways of specifying the visibility will likely lead to weird bugs in edge cases.
https://github.com/llvm/llvm-project/pull/111035
More information about the cfe-commits
mailing list