Fix declaration of obc_enumerationMutation function, for GNU runtime.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 24 Jul 2009 07:40:24 +0000 (07:40 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 24 Jul 2009 07:40:24 +0000 (07:40 +0000)
llvm-svn: 76959

clang/lib/CodeGen/CGObjCGNU.cpp
clang/lib/CodeGen/CGObjCMac.cpp

index 9981bdb..a56c564 100644 (file)
@@ -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<const llvm::Type*> Params(1, IdTy);
-  return cast<llvm::Function>(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<QualType,16> 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,
index 88b27ea..4b4605e 100644 (file)
@@ -325,8 +325,7 @@ public:
     ASTContext &Ctx = CGM.getContext();
     // void objc_enumerationMutation (id)
     llvm::SmallVector<QualType,16> 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");