Change hasUniqueInitializer() to call isStrongDefinitionForLinker() instead of !isWea...
authorMehdi Amini <mehdi.amini@apple.com>
Wed, 9 Dec 2015 16:17:07 +0000 (16:17 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Wed, 9 Dec 2015 16:17:07 +0000 (16:17 +0000)
commit13f632f17efc05fca61e9cb188f51a54bfc440ed
tree87fcba463b3735aad0294757a62e103cce42f542
parent90f6cd579a7dd1d91b8931bb38a271723749f326
Change hasUniqueInitializer() to call isStrongDefinitionForLinker() instead of !isWeakForLinker()

Summary:
Available_externally global variable with initializer were considered "hasInitializer()",
while obviously it can't match the description:

    Whether the global variable has an initializer, and any changes made to the
    initializer will turn up in the final executable.

since modifying the initializer of an externally available variable does not make sense.

Reviewers: pcc, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15351

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255123 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/GlobalVariable.h
test/Transforms/GlobalOpt/available_externally_global_ctors.ll [new file with mode: 0644]