rnk added a comment.

This seems pretty inconsistent with how -fvisibility=hidden behaves with 
normal, user written declarations. Consider this code:

  void foo();
  void bar() { foo(); }

We get this IR:

  $ clang -S -emit-llvm --target=x86_64-linux t.c -o - -fvisibility=hidden
  ...
  define hidden void @bar() #0 {
  entry:
    call void @foo()
    ret void
  }
  declare dso_local void @foo() #1

Basically, declarations are never marked hidden, only definitions are. This is 
because system headers are not explicitly marked with default visibility 
annotations, and you still want to be able to call libc from code compiled with 
-fvisibility=hidden.

I'm... kind of surprised we have code to explicitly mark these declarations 
with default visibility attributes.


Repository:
  rC Clang

https://reviews.llvm.org/D53787



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to