OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / params.c
index 569ae47..04eff11 100644 (file)
@@ -1,5 +1,6 @@
 /* params.c - Run-time parameters.
-   Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008
+   Free Software Foundation, Inc.
    Written by Mark Mitchell <mark@codesourcery.com>.
 
 This file is part of GCC.
@@ -31,7 +32,6 @@ along with GCC; see the file COPYING3.  If not see
 param_info *compiler_params;
 
 /* The number of entries in the table.  */
-
 static size_t num_compiler_params;
 
 /* Add the N PARAMS to the current list of compiler parameters.  */
@@ -40,8 +40,8 @@ void
 add_params (const param_info params[], size_t n)
 {
   /* Allocate enough space for the new parameters.  */
-  compiler_params = xrealloc (compiler_params,
-                             (num_compiler_params + n) * sizeof (param_info));
+  compiler_params = XRESIZEVEC (param_info, compiler_params,
+                               num_compiler_params + n);
   /* Copy them into the table.  */
   memcpy (compiler_params + num_compiler_params,
          params,
@@ -84,3 +84,12 @@ set_param_value (const char *name, int value)
   /* If we didn't find this parameter, issue an error message.  */
   error ("invalid parameter %qs", name);
 }
+
+/* Return the current value of num_compiler_params, for the benefit of
+   plugins that use parameters as features.  */
+
+size_t
+get_num_compiler_params (void)
+{
+  return num_compiler_params;
+}