diff options
author | Anders Carlsson <andersca@mac.com> | 2008-08-31 04:05:03 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2008-08-31 04:05:03 +0000 |
commit | 2abd89c039e835e84519a4cd8a7495899a70153d (patch) | |
tree | d0f14f41d42c5eb75f43e04428bf5d37d56d0c24 /lib/CodeGen/CGObjCMac.cpp | |
parent | f484c31f4d6934f56070c2942d4dfdf3fee84074 (diff) |
Handle mutation while enumerating correctly. Fix some bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index ef4196e11f..798c9d3c4b 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -130,6 +130,7 @@ public: /// MethodListPtrTy - LLVM type for struct objc_method_list *. const llvm::Type *MethodListPtrTy; + llvm::Function *EnumerationMutationFn; public: ObjCTypesHelper(CodeGen::CodeGenModule &cgm); ~ObjCTypesHelper(); @@ -370,6 +371,7 @@ public: virtual void GenerateProtocol(const ObjCProtocolDecl *PD); virtual llvm::Function *ModuleInitFunction(); + virtual llvm::Function *EnumerationMutationFunction(); }; } // end anonymous namespace @@ -1379,6 +1381,11 @@ llvm::Function *CGObjCMac::ModuleInitFunction() { return NULL; } +llvm::Function *CGObjCMac::EnumerationMutationFunction() +{ + return ObjCTypes.EnumerationMutationFn; +} + /* *** Private Interface *** */ /// EmitImageInfo - Emit the image info marker used to encode some module @@ -1934,6 +1941,18 @@ ObjCTypesHelper::ObjCTypesHelper(CodeGen::CodeGenModule &cgm) llvm::Function::ExternalLinkage, "objc_msgSendSuper_stret", &CGM.getModule()); + + // Enumeration mutation. + + Params.clear(); + Params.push_back(ObjectPtrTy); + EnumerationMutationFn = + llvm::Function::Create(llvm::FunctionType::get(llvm::Type::VoidTy, + Params, + false), + llvm::Function::ExternalLinkage, + "objc_enumerationMutation", + &CGM.getModule()); } ObjCTypesHelper::~ObjCTypesHelper() { |