diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-26 22:25:45 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-26 22:25:45 +0000 |
commit | 554256ca569a8e3d9e76a91fbad35db325df4282 (patch) | |
tree | 8625ce54d7d5c0aab37256e0de385809685dd4f5 /clang/lib/CodeGen/CGObjCGNU.cpp | |
parent | 52a00936b4862096ae073c8c9391a3bae44c2e8a (diff) | |
download | bcm5719-llvm-554256ca569a8e3d9e76a91fbad35db325df4282.tar.gz bcm5719-llvm-554256ca569a8e3d9e76a91fbad35db325df4282.zip |
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.
llvm-svn: 202305
Diffstat (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjCGNU.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index 9504d7dd116..ec4a2f1409d 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/lib/CodeGen/CGObjCGNU.cpp @@ -573,8 +573,9 @@ public: QualType T) { return NULLPtr; } - - virtual llvm::GlobalVariable *GetClassGlobal(const std::string &Name) { + + llvm::GlobalVariable *GetClassGlobal(const std::string &Name, + bool Weak = false) LLVM_OVERRIDE { return 0; } }; |