From c67876d6886219983881e1304a761b113ae1aec0 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 4 Sep 2008 04:33:15 +0000 Subject: [PATCH] NeXT: Emit lazy reference to Protocol class for forward protocol 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index d1a1651277..9638bc1430 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -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); } -- 2.40.0