mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
Unbreak private_extern, which apparently we had zero tests for.
llvm-svn: 118034
This commit is contained in:
parent
3bcbf84235
commit
23032653d7
@ -278,11 +278,12 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
|
||||
LV.mergeVisibility(TypeLV.second);
|
||||
}
|
||||
|
||||
if (Var->getStorageClass() == SC_PrivateExtern)
|
||||
LV.setVisibility(HiddenVisibility, true);
|
||||
|
||||
if (!Context.getLangOptions().CPlusPlus &&
|
||||
(Var->getStorageClass() == SC_Extern ||
|
||||
Var->getStorageClass() == SC_PrivateExtern)) {
|
||||
if (Var->getStorageClass() == SC_PrivateExtern)
|
||||
LV.setVisibility(HiddenVisibility, true);
|
||||
|
||||
// C99 6.2.2p4:
|
||||
// For an identifier declared with the storage-class specifier
|
||||
@ -307,6 +308,9 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
|
||||
// for justification). In practice, GCC doesn't do this, so it's
|
||||
// just too painful to make work.
|
||||
|
||||
if (Function->getStorageClass() == SC_PrivateExtern)
|
||||
LV.setVisibility(HiddenVisibility, true);
|
||||
|
||||
// C99 6.2.2p5:
|
||||
// If the declaration of an identifier for a function has no
|
||||
// storage-class specifier, its linkage is determined exactly
|
||||
|
@ -19,6 +19,10 @@ int g_def = 0;
|
||||
extern int g_ext;
|
||||
static char g_deferred[] = "hello";
|
||||
|
||||
// CHECK-DEFAULT: @test4 = hidden global i32 10
|
||||
// CHECK-PROTECTED: @test4 = hidden global i32 10
|
||||
// CHECK-HIDDEN: @test4 = hidden global i32 10
|
||||
|
||||
// CHECK-DEFAULT: define i32 @f_def()
|
||||
// CHECK-DEFAULT: declare void @f_ext()
|
||||
// CHECK-DEFAULT: define internal void @f_deferred()
|
||||
@ -53,3 +57,13 @@ void __attribute__((visibility("default"))) test1(struct Test1 *v) { }
|
||||
// CHECK-HIDDEN: define void @test2()
|
||||
void test2(void);
|
||||
void __attribute__((visibility("default"))) test2(void) {}
|
||||
|
||||
// CHECK-DEFAULT: define hidden void @test3()
|
||||
// CHECK-PROTECTED: define hidden void @test3()
|
||||
// CHECK-HIDDEN: define hidden void @test3()
|
||||
extern void test3(void);
|
||||
__private_extern__ void test3(void) {}
|
||||
|
||||
// Top of file.
|
||||
extern int test4;
|
||||
__private_extern__ int test4 = 10;
|
||||
|
Loading…
Reference in New Issue
Block a user