diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-07 20:11:22 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-07 20:11:22 +0000 |
commit | 475831bd6e3f6e96751e744951750f0d94220434 (patch) | |
tree | 4e743935e42326654d330bc3d4fa233758a408f5 /clang/lib | |
parent | 0bcf08584558980c08773f3d01eac54c50fceae0 (diff) | |
download | bcm5719-llvm-475831bd6e3f6e96751e744951750f0d94220434.tar.gz bcm5719-llvm-475831bd6e3f6e96751e744951750f0d94220434.zip |
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.
llvm-svn: 61880
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index dd722458aaa..03f7b78ec8e 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/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; |