scott.linder added a comment.
That's my understanding, at least.
Take for example:
$ cat foo.c
static void foo() { }
void bar() { }
void baz() { bar(); foo(); }
$ clang -fvisibility=protected -O0 -S -emit-llvm foo.c -o -
...
; Function Attrs: noinline nounwind optnone uwtable
define protected void @bar() #0 {
entry:
ret void
}
; Function Attrs: noinline nounwind optnone uwtable
define protected void @baz() #0 {
entry:
call void @bar()
call void @foo()
ret void
}
; Function Attrs: noinline nounwind optnone uwtable
define internal void @foo() #0 {
entry:
ret void
}
...
Here `foo` has default visibility, while the user asked for protected. I still
do not completely understand the interaction between linkage and visibility, as
Clang gives default visibility to any symbol with internal linkage.
https://reviews.llvm.org/D53153
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits