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)
commitb000bbdec22c555746686f7d937ce9b7c7fd77e9
tree32fafa3d02631f25aa940259cdc251a70b6032d3
parent9cd9a7e310933b147e22220cdcea4bd6263be5fb
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>
llvm-svn: 255123
llvm/include/llvm/IR/GlobalVariable.h
llvm/test/Transforms/GlobalOpt/available_externally_global_ctors.ll [new file with mode: 0644]