]> granicus.if.org Git - clang/commitdiff
NeXT: Emit lazy reference to Protocol class for forward protocol
authorDaniel Dunbar <daniel@zuster.org>
Thu, 4 Sep 2008 04:33:15 +0000 (04:33 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 4 Sep 2008 04:33:15 +0000 (04:33 +0000)
references (to match gcc).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55760 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCMac.cpp

index d1a165127712c28bbcfdd363df95c3420302e796..9638bc1430819eeecdfb11004ecc10fd39ad6774 100644 (file)
@@ -509,6 +509,11 @@ CodeGen::RValue CGObjCMac::EmitMessageSend(CodeGen::CodeGenFunction &CGF,
 
 llvm::Value *CGObjCMac::GenerateProtocolRef(llvm::IRBuilder<> &Builder, 
                                             const ObjCProtocolDecl *PD) {
+  // FIXME: I don't understand why gcc generates this, or where it is
+  // resolved. Investigate. Its also wasteful to look this up over and
+  // over.
+  LazySymbols.insert(&CGM.getContext().Idents.get("Protocol"));
+
   return llvm::ConstantExpr::getBitCast(GetProtocolRef(PD),
                                         ObjCTypes.ExternalProtocolPtrTy);
 }