diff options
author | Reid Kleckner <rnk@google.com> | 2015-10-21 22:01:02 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2015-10-21 22:01:02 +0000 |
commit | 7737bd9f9fb5d9cfd5717f36791036fa08d57b95 (patch) | |
tree | bcf0b1cb3ad2bcee7078c277a068d354cb93b2db /clang/test/CodeGenCXX/visibility.cpp | |
parent | 9dfde98d272d1b178eb3c99f8fb758cc3e5a92b5 (diff) | |
download | bcm5719-llvm-7737bd9f9fb5d9cfd5717f36791036fa08d57b95.tar.gz bcm5719-llvm-7737bd9f9fb5d9cfd5717f36791036fa08d57b95.zip |
[Driver] Alias -fvisibility=internal to -fvisibility=hidden
The ELF symbol visibilities are:
- internal: Not visibile across DSOs, cannot pass address across DSOs
- hidden: Not visibile across DSOs, can be called indirectly
- default: Usually visible across DSOs, possibly interposable
- protected: Visible across DSOs, not interposable
LLVM only supports the latter 3 visibilities. Internal visibility is in
theory useful, as it allows you to assume that the caller is maintaining
a PIC register for you in %ebx, or in some other pre-arranged location.
As far as LLVM is concerned, this isn't worth the trouble. Using hidden
visibility is always correct, so we can just do that.
Resolves PR9183.
llvm-svn: 250954
Diffstat (limited to 'clang/test/CodeGenCXX/visibility.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/visibility.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp index 7239cbe0022..aff6554282c 100644 --- a/clang/test/CodeGenCXX/visibility.cpp +++ b/clang/test/CodeGenCXX/visibility.cpp @@ -1,5 +1,8 @@ // RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s // RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -fvisibility hidden -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-HIDDEN +// For clang, "internal" is just an alias for "hidden". We could use it for some +// optimization purposes on 32-bit x86, but it's not worth it. +// RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-apple-darwin10 -fvisibility internal -emit-llvm -o - | FileCheck %s -check-prefix=CHECK-HIDDEN #define HIDDEN __attribute__((visibility("hidden"))) #define PROTECTED __attribute__((visibility("protected"))) |