[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-31 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D53787#1282995, @mcgrathr wrote: > In https://reviews.llvm.org/D53787#1282975, @rsmith wrote: > > > Other symbols must have exactly one definition (modulo the permission for > > duplicate identical definitions for some cases), but these ones ha

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-31 Thread Roland McGrath via Phabricator via cfe-commits
mcgrathr added a comment. In https://reviews.llvm.org/D53787#1282975, @rsmith wrote: > These symbols really are special. Other symbols are introduced explicitly by > a declaration, whereas these are declared implicitly by the compiler. The implicit declaration is the only difference that actua

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-31 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D53787#1282930, @mcgrathr wrote: > In https://reviews.llvm.org/D53787#1279899, @rsmith wrote: > > > Replacing the global new and delete is supposed to be a whole-program > > operation (you only get one global allocator). Otherwise you couldn't

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-31 Thread Roland McGrath via Phabricator via cfe-commits
mcgrathr added a comment. In https://reviews.llvm.org/D53787#1279899, @rsmith wrote: > Replacing the global new and delete is supposed to be a whole-program > operation (you only get one global allocator). Otherwise you couldn't > allocate memory in one DSO and deallocate it in another. (And no

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D53787#1279913, @phosek wrote: > In https://reviews.llvm.org/D53787#1279899, @rsmith wrote: > > > Replacing the global new and delete is supposed to be a whole-program > > operation (you only get one global allocator). Otherwise you couldn't >

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-29 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. In https://reviews.llvm.org/D53787#1279899, @rsmith wrote: > Replacing the global new and delete is supposed to be a whole-program > operation (you only get one global allocator). Otherwise you couldn't > allocate memory in one DSO and deallocate it in another. (And nor

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-29 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith requested changes to this revision. rsmith added a comment. This revision now requires changes to proceed. Replacing the global new and delete is supposed to be a whole-program operation (you only get one global allocator). Otherwise you couldn't allocate memory in one DSO and deallocate

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-29 Thread Reid Kleckner via Phabricator via cfe-commits
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 h

[PATCH] D53787: [Sema] Use proper visibility for global new and delete declarations

2018-10-26 Thread Petr Hosek via Phabricator via cfe-commits
phosek created this revision. phosek added reviewers: rsmith, rnk. Herald added a subscriber: cfe-commits. When the global new and delete operators aren't declared, Clang provides and implicit declaration, but this declaration currently always uses the default visibility. This is a problem when th