]> granicus.if.org Git - clang/commit
Refactor linkage computation in CGObjCMac.cpp.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 26 Feb 2014 22:25:45 +0000 (22:25 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 26 Feb 2014 22:25:45 +0000 (22:25 +0000)
commit98cafc64641be338090ca73ad69ba59702dcbc50
tree70e3327a4b6e1191636619883b6eaf7a9ec51396
parentb57e967568a258ac00884522fe439fbbbcfb2d20
Refactor linkage computation in CGObjCMac.cpp.

Before this patch the globals were created with the wrong linkage and patched
afterwards. From the comments it looks like something would complain about
having an internal GV with no initializer. At least in clang the verifier will
only run way after we set the initializer, so that is not a problem.

This patch should be a nop. It just figures out the linkage earlier and
converts the old calls to setLinkage to asserts. The only case where that is
not possible is when we first see a weak import that is then implemented. In
that case we have to change the linkage, but that is the only setLinkage left.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202305 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGObjCGNU.cpp
lib/CodeGen/CGObjCMac.cpp
lib/CodeGen/CGObjCRuntime.h