From 309a4368cd299cff30ab22709e2b772cf8059e45 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 24 Jul 2009 07:40:24 +0000 Subject: [PATCH] Fix declaration of obc_enumerationMutation function, for GNU runtime. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76959 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGObjCGNU.cpp | 16 ++++++++++------ lib/CodeGen/CGObjCMac.cpp | 3 +-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 9981bdb011..a56c564072 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -142,7 +142,7 @@ public: virtual llvm::Function *ModuleInitFunction(); virtual llvm::Function *GetPropertyGetFunction(); virtual llvm::Function *GetPropertySetFunction(); - virtual llvm::Function *EnumerationMutationFunction(); + virtual llvm::Constant *EnumerationMutationFunction(); virtual void EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, const Stmt &S); @@ -1243,11 +1243,15 @@ llvm::Function *CGObjCGNU::GetPropertySetFunction() { "objc_setProperty")); } -llvm::Function *CGObjCGNU::EnumerationMutationFunction() { - std::vector Params(1, IdTy); - return cast(CGM.CreateRuntimeFunction( - VMContext.getFunctionType(llvm::Type::VoidTy, Params, true), - "objc_enumerationMutation")); +llvm::Constant *CGObjCGNU::EnumerationMutationFunction() { + CodeGen::CodeGenTypes &Types = CGM.getTypes(); + ASTContext &Ctx = CGM.getContext(); + // void objc_enumerationMutation (id) + llvm::SmallVector Params; + Params.push_back(Ctx.getObjCIdType()); + const llvm::FunctionType *FTy = + Types.GetFunctionType(Types.getFunctionInfo(Ctx.VoidTy, Params), false); + return CGM.CreateRuntimeFunction(FTy, "objc_enumerationMutation"); } void CGObjCGNU::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 88b27eaf92..4b4605ef76 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -325,8 +325,7 @@ public: ASTContext &Ctx = CGM.getContext(); // void objc_enumerationMutation (id) llvm::SmallVector Params; - QualType IdType = Ctx.getObjCIdType(); - Params.push_back(IdType); + Params.push_back(Ctx.getObjCIdType()); const llvm::FunctionType *FTy = Types.GetFunctionType(Types.getFunctionInfo(Ctx.VoidTy, Params), false); return CGM.CreateRuntimeFunction(FTy, "objc_enumerationMutation"); -- 2.40.0