[llvm-commits] [llvm-gcc-4.2] r45365 - /llvm-gcc-4.2/trunk/gcc/fortran/trans-decl.c

Anton Korobeynikov asl at math.spbu.ru
Thu Dec 27 08:55:24 PST 2007


Author: asl
Date: Thu Dec 27 10:55:23 2007
New Revision: 45365

URL: http://llvm.org/viewvc/llvm-project?rev=45365&view=rev
Log:
Enable us to build pure varargs intrinsics

Modified:
    llvm-gcc-4.2/trunk/gcc/fortran/trans-decl.c

Modified: llvm-gcc-4.2/trunk/gcc/fortran/trans-decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/fortran/trans-decl.c?rev=45365&r1=45364&r2=45365&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/fortran/trans-decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/fortran/trans-decl.c Thu Dec 27 10:55:23 2007
@@ -1913,7 +1913,8 @@
 
 
 /* Builds a function decl.  The remaining parameters are the types of the
-   function arguments.  Negative nargs indicates a varargs function.  */
+   function arguments.  Negative nargs indicates a varargs function (and this
+   number *includes* an ellipsis) */
 
 tree
 gfc_build_library_function_decl (tree name, tree rettype, int nargs, ...)
@@ -1932,7 +1933,9 @@
 
 
   /* Create a list of the argument types.  */
-  for (arglist = NULL_TREE, n = abs (nargs); n > 0; n--)
+  /* LLVM local begin */
+  for (arglist = NULL_TREE, n = (nargs >= 0 ? nargs : -nargs - 1); n > 0; n--)
+   /* LLVM local end */
     {
       argtype = va_arg (p, tree);
       arglist = gfc_chainon_list (arglist, argtype);
@@ -2309,7 +2312,8 @@
 
   gfor_fndecl_select_string =
     gfc_build_library_function_decl (get_identifier (PREFIX("select_string")),
-                                     pvoid_type_node, 0);
+             pvoid_type_node, 5, pvoid_type_node, gfc_c_int_type_node,
+                       pvoid_type_node, pchar_type_node, gfc_c_int_type_node);
 
   gfor_fndecl_runtime_error =
     gfc_build_library_function_decl (get_identifier (PREFIX("runtime_error")),
@@ -2347,7 +2351,7 @@
 
   gfor_fndecl_in_unpack = gfc_build_library_function_decl (
         get_identifier (PREFIX("internal_unpack")),
-        pvoid_type_node, 1, pvoid_type_node);
+        pvoid_type_node, 2, pvoid_type_node, pvoid_type_node);
 
   gfor_fndecl_associated =
     gfc_build_library_function_decl (





More information about the llvm-commits mailing list