]> granicus.if.org Git - clang/commit
Merging r340386 and r344190:
authorTom Stellard <tstellar@redhat.com>
Fri, 7 Dec 2018 00:14:58 +0000 (00:14 +0000)
committerTom Stellard <tstellar@redhat.com>
Fri, 7 Dec 2018 00:14:58 +0000 (00:14 +0000)
commitfb468b647c68756bd60c843af15bac072b0eaa70
treef8881495a3bf6a02bdfb504ced1f73a3941dab34
parentb540402b6b6657877032791cfc6df4eb87b39318
Merging r340386 and r344190:

------------------------------------------------------------------------
r340386 | inouehrs | 2018-08-21 22:43:27 -0700 (Tue, 21 Aug 2018) | 10 lines

[AST] correct the behavior of -fvisibility-inlines-hidden option (don't make static local variables hidden)

The command line option -fvisibility-inlines-hidden makes inlined method hidden, but it is expected not to affect the visibility of static local variables in the function.
However, Clang makes the static local variables in the function also hidden as reported in PR37595. This problem causes LLVM bootstarp failure on Fedora 28 if configured with -DBUILD_SHARED_LIBS=ON.

This patch makes the behavior of -fvisibility-inlines-hidden option to be consistent with that of gcc; the option does not change the visibility of the static local variables if the containing function does not associated with explicit visibility attribute and becomes hidden due to this option.

Differential Revision: https://reviews.llvm.org/D50968

------------------------------------------------------------------------

------------------------------------------------------------------------
r344190 | rnk | 2018-10-10 14:59:56 -0700 (Wed, 10 Oct 2018) | 19 lines

[AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals

Summary:
In r340386 we added code to give static locals in inline functions
default visibility. Instead, we should use the "default" visibility
passed on the command line, which could be hidden or protected, as GCC
does.

Some code bases use both -fvisibility=hidden and
-fvisibility-inlines-hidden to hide inline functions of classes that are
explicitly marked with default visibility.

Fixes PR39236

Reviewers: hans, thakis

Subscribers: eraman, llvm-commits

Differential Revision: https://reviews.llvm.org/D53052
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_70@348554 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/Decl.cpp
test/CodeGenCXX/visibility-inlines-hidden-staticvar.cpp [new file with mode: 0644]