aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-01-07 20:11:22 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-01-07 20:11:22 +0000
commitb0d27943e133f099a39abc26a49d1130b5a8f5af (patch)
tree4ffe4da2f7d3e31cab147d24d4428108ce0846e4 /lib/CodeGen/CGObjCMac.cpp
parent6b3945f4bc757bdadd3e443180cf32c2cccb52a0 (diff)
Another nasty code gen. bug with trivial fix. Calling class
method on 'super' receiver in a category implementation. Other simpler cases were working by accident. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index dd722458aa..03f7b78ec8 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1244,7 +1244,9 @@ llvm::Constant *CGObjCMac::EmitMetaClassRef(const ObjCInterfaceDecl *ID) {
// if know when we entered/exitted an implementation block.
// Check for an existing forward reference.
- if (llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name)) {
+ // Previously, metaclass with internal linkage may have been defined.
+ // pass 'true' as 2nd argument so it is returned.
+ if (llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name, true)) {
assert(GV->getType()->getElementType() == ObjCTypes.ClassTy &&
"Forward metaclass reference has incorrect type.");
return GV;