Move all Obj-C runtime interaction into CodeGenFunction.
 - Drop duplicate (and broken) code for sending messages.
 - Add EmitObjCProtocolExpr to CodeGenFunction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55024 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 2b4eb5b..5e4b958 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -23,6 +23,7 @@
 llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E) {
   std::string String(E->getString()->getStrData(), E->getString()->getByteLength());
   llvm::Constant *C = CGM.getObjCRuntime().GenerateConstantString(String);
+  // FIXME: This bitcast should just be made an invariant on the Runtime.
   return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType()));
 }
 
@@ -35,6 +36,10 @@
   return CGM.getObjCRuntime().GetSelector(Builder, E->getSelector());
 }
 
+llvm::Value *CodeGenFunction::EmitObjCProtocolExpr(const ObjCProtocolExpr *E) {
+  // FIXME: This should pass the Decl not the name.
+  return CGM.getObjCRuntime().GenerateProtocolRef(Builder, E->getProtocol());
+}
 
 
 llvm::Value *CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E) {