diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-10 21:06:09 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-10 21:06:09 +0000 |
commit | 0196a1cd2bbf86e63d5965fb4d8ed5a857b5c426 (patch) | |
tree | 802a7aa35246954977447a56899695b6433de695 /clang/lib/CodeGen/CGObjCMac.cpp | |
parent | 8e7d88b91620200021c168d30a802a9d7073910a (diff) | |
download | bcm5719-llvm-0196a1cd2bbf86e63d5965fb4d8ed5a857b5c426.tar.gz bcm5719-llvm-0196a1cd2bbf86e63d5965fb4d8ed5a857b5c426.zip |
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.
llvm-svn: 62030
Diffstat (limited to 'clang/lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 218886fec73..637edf3feae 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -408,6 +408,7 @@ private: /// 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 @@ public: 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 @@ llvm::Constant *CGObjCMac::EmitMethodList(const std::string &Name, 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 @@ llvm::Constant *CGObjCMac::GetPropertyTypeString(const ObjCPropertyDecl *PD, } 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 += ']'; |