This patch fixes the code gen failures which was a fallout from
not merging protocol properties into the classes which
use those protocols. With this patch, all my exceutable
test pass again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62030 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 218886f..637edf3 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -408,6 +408,7 @@
/// GetNameForMethod - Return a name for the given method.
/// \param[out] NameOut - The return value.
void GetNameForMethod(const ObjCMethodDecl *OMD,
+ const ObjCContainerDecl *CD,
std::string &NameOut);
public:
@@ -435,7 +436,8 @@
virtual llvm::Value *GetSelector(CGBuilderTy &Builder, Selector Sel);
- virtual llvm::Function *GenerateMethod(const ObjCMethodDecl *OMD);
+ virtual llvm::Function *GenerateMethod(const ObjCMethodDecl *OMD,
+ const ObjCContainerDecl *CD=0);
virtual void GenerateCategory(const ObjCCategoryImplDecl *CMD);
@@ -1434,9 +1436,10 @@
ObjCTypes.MethodListPtrTy);
}
-llvm::Function *CGObjCMac::GenerateMethod(const ObjCMethodDecl *OMD) {
+llvm::Function *CGObjCMac::GenerateMethod(const ObjCMethodDecl *OMD,
+ const ObjCContainerDecl *CD) {
std::string Name;
- GetNameForMethod(OMD, Name);
+ GetNameForMethod(OMD, CD, Name);
const llvm::FunctionType *MethodTy =
CGM.getTypes().GetFunctionType(CGFunctionInfo(OMD, CGM.getContext()));
@@ -2141,11 +2144,13 @@
}
void CGObjCMac::GetNameForMethod(const ObjCMethodDecl *D,
+ const ObjCContainerDecl *CD,
std::string &NameOut) {
// FIXME: Find the mangling GCC uses.
NameOut = (D->isInstanceMethod() ? "-" : "+");
NameOut += '[';
- NameOut += D->getClassInterface()->getNameAsString();
+ assert (CD && "Missing container decl in GetNameForMethod");
+ NameOut += CD->getNameAsString();
NameOut += ' ';
NameOut += D->getSelector().getAsString();
NameOut += ']';