r302588 - Fix CGObjCGNU::init bug introduced by r302572

Serge Guelton via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 14:19:45 PDT 2017


Author: serge_sans_paille
Date: Tue May  9 16:19:44 2017
New Revision: 302588

URL: http://llvm.org/viewvc/llvm-project?rev=302588&view=rev
Log:
Fix CGObjCGNU::init bug introduced by r302572

Modified:
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=302588&r1=302587&r2=302588&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Tue May  9 16:19:44 2017
@@ -63,8 +63,13 @@ public:
     CGM = Mod;
     FunctionName = name;
     Function = nullptr;
-    std::vector<llvm::Type *> ArgTys{{Types...}};
-    FTy = llvm::FunctionType::get(RetTy, ArgTys, false);
+    if(sizeof...(Tys)) {
+      SmallVector<llvm::Type *, 8> ArgTys({Types...});
+      FTy = llvm::FunctionType::get(RetTy, ArgTys, false);
+    }
+    else {
+      FTy = llvm::FunctionType::get(RetTy, None, false);
+    }
   }
 
   llvm::FunctionType *getType() { return FTy; }




More information about the cfe-commits mailing list