D87451 added -mignore-xcoff-visibility for AIX targets and made it the default (which mimicked the behaviour of the XL 16.1 compiler on AIX). However, ignoring hidden visibility has unwanted side effects and some libraries depend on visibility to hide non-ABI facing entities from user headers and reserve the right to change these implementation details based on this (https://libcxx.llvm.org/DesignDocs/VisibilityMacros.html). This forces us to use internal linkage fallbacks for these cases on AIX and creates an unwanted divergence in implementations on the plaform. For these reasons, it's preferable to not add -mignore-xcoff-visibility by default, which is what this patch does. Reviewed By: DiggerLin Differential Revision: https://reviews.llvm.org/D125141
38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
// RUN: %clang_cc1 -triple powerpc-unknown-aix -mcmodel=large -emit-llvm -o - -x c++ %s | \
|
|
// RUN: FileCheck -check-prefix=VISIBILITY-IR %s
|
|
|
|
// RUN: %clang_cc1 -triple powerpc-unknown-aix -mcmodel=large \
|
|
// RUN: -fvisibility-inlines-hidden -emit-llvm -o - -x c++ %s | \
|
|
// RUN: FileCheck -check-prefixes=VISIBILITY-IR,HIDDENINLINE-IR %s
|
|
|
|
// RUN: %clang_cc1 -triple powerpc-unknown-aix -mcmodel=large -fvisibility-inlines-hidden \
|
|
// RUN: -fvisibility default -emit-llvm -o - -x c++ %s | \
|
|
// RUN: FileCheck -check-prefixes=VISIBILITY-IR,HIDDENINLINE-IR %s
|
|
|
|
// RUN: %clang_cc1 -triple powerpc-unknown-aix -mcmodel=large -mignore-xcoff-visibility -emit-llvm \
|
|
// RUN: -fvisibility-inlines-hidden -fvisibility default -o - -x c++ %s | \
|
|
// RUN: FileCheck -check-prefix=NOVISIBILITY-IR %s
|
|
|
|
int x = 66;
|
|
__attribute__((__noinline__)) inline void f() {
|
|
x = 55;
|
|
}
|
|
|
|
#pragma GCC visibility push(hidden)
|
|
__attribute__((__noinline__)) inline void foo() {
|
|
x = 55;
|
|
}
|
|
#pragma GCC visibility pop
|
|
|
|
int bar() {
|
|
f();
|
|
foo();
|
|
return x;
|
|
}
|
|
|
|
// HIDDENINLINE-IR: define linkonce_odr hidden void @_Z1fv()
|
|
// NOVISIBILITY-IR: define linkonce_odr void @_Z1fv()
|
|
|
|
// VISIBILITY-IR: define linkonce_odr hidden void @_Z3foov()
|
|
// NOVISIBILITY-IR: define linkonce_odr void @_Z3foov()
|