cpplib.h (struct cpp_reader): Remove references to string_pool and temp_string_pool.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Sun, 17 Dec 2000 22:40:32 +0000 (22:40 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Sun, 17 Dec 2000 22:40:32 +0000 (22:40 +0000)
        * cpplib.h (struct cpp_reader): Remove references to string_pool
        and temp_string_pool.
        * cppinit.c (cpp_create_reader, cpp_cleanup): Similarly; using
        ident_pool in place.
        * cpplex.c (parse_number, unescaped_terminator_p, parse_string,
        save_comment, cpp_token_as_text): Similarly.
        * cpplib.c (do_define, glue_header_name, parse_assertion): Similarly.
        * cppmacro.c (make_number_token, builtin_macro, lock_pools,
        unlock_pools, stringify_arg, paste_tokens): Similarly.

From-SVN: r38336

gcc/ChangeLog
gcc/cppinit.c
gcc/cpplex.c
gcc/cpplib.c
gcc/cpplib.h
gcc/cppmacro.c

index 2bb19befba34a1577f3fc4acd3c4c09733ed9936..31beacdb54165f0a82b2d39e95933538c06d543c 100644 (file)
@@ -1,3 +1,15 @@
+2000-12-17  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+        * cpplib.h (struct cpp_reader): Remove references to string_pool
+        and temp_string_pool.
+        * cppinit.c (cpp_create_reader, cpp_cleanup): Similarly; using
+        ident_pool in place.
+        * cpplex.c (parse_number, unescaped_terminator_p, parse_string,
+        save_comment, cpp_token_as_text): Similarly.
+        * cpplib.c (do_define, glue_header_name, parse_assertion): Similarly.
+        * cppmacro.c (make_number_token, builtin_macro, lock_pools,
+        unlock_pools, stringify_arg, paste_tokens): Similarly.
+
 Sun Dec 17 12:41:48 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * dwarf2out.c (loc_descriptor_from_tree, case NOP_EXPR): New case.
index 1ded3a353674eb2a54cc303efd7cebfc94572756..ea4bc6bc5192fdab7e71cbdc0511c665be139bc2 100644 (file)
@@ -513,18 +513,12 @@ cpp_create_reader (lang)
   /* Identifier pool initially 8K.  Unaligned, permanent pool.  */
   _cpp_init_pool (&pfile->ident_pool, 8 * 1024, 1, 0);
 
-  /* String and number pool initially 4K.  Unaligned, temporary pool.  */
-  _cpp_init_pool (&pfile->temp_string_pool, 4 * 1024, 1, 1);
-
   /* Argument pool initially 8K.  Aligned, temporary pool.  */
   _cpp_init_pool (&pfile->argument_pool, 8 * 1024, 0, 1);
 
   /* Macro pool initially 8K.  Aligned, permanent pool.  */
   _cpp_init_pool (&pfile->macro_pool, 8 * 1024, 0, 0);
 
-  /* Start with temporary pool.  */
-  pfile->string_pool = &pfile->temp_string_pool;
-
   _cpp_init_hashtable (pfile);
   _cpp_init_stacks (pfile);
   _cpp_init_includes (pfile);
@@ -568,7 +562,6 @@ cpp_cleanup (pfile)
   _cpp_free_lookaheads (pfile);
 
   _cpp_free_pool (&pfile->ident_pool);
-  _cpp_free_pool (&pfile->temp_string_pool);
   _cpp_free_pool (&pfile->macro_pool);
   _cpp_free_pool (&pfile->argument_pool);
 
index 2b5b85233a34fd5dc64b1461747f4e6d004597ce..1dc401e8f08204dedbcef8169f4ac22d2728367b 100644 (file)
@@ -539,7 +539,7 @@ parse_number (pfile, number, c, leading_period)
      int leading_period;
 {
   cpp_buffer *buffer = pfile->buffer;
-  cpp_pool *pool = pfile->string_pool;
+  cpp_pool *pool = &pfile->ident_pool;
   unsigned char *dest, *limit;
 
   dest = POOL_FRONT (pool);
@@ -618,7 +618,7 @@ unescaped_terminator_p (pfile, dest)
   if (pfile->state.angled_headers)
     return 1;
 
-  start = POOL_FRONT (pfile->string_pool);
+  start = POOL_FRONT (&pfile->ident_pool);
 
   /* An odd number of consecutive backslashes represents an escaped
      terminator.  */
@@ -640,7 +640,7 @@ parse_string (pfile, token, terminator)
      cppchar_t terminator;
 {
   cpp_buffer *buffer = pfile->buffer;
-  cpp_pool *pool = pfile->string_pool;
+  cpp_pool *pool = &pfile->ident_pool;
   unsigned char *dest, *limit;
   cppchar_t c;
   unsigned int nulls = 0;
@@ -738,7 +738,7 @@ save_comment (pfile, token, from)
      line, which we don't want to save in the comment.  */
   if (pfile->buffer->read_ahead != EOF)
     len--;
-  buffer = _cpp_pool_alloc (pfile->string_pool, len);
+  buffer = _cpp_pool_alloc (&pfile->ident_pool, len);
   
   token->type = CPP_COMMENT;
   token->val.str.len = len;
@@ -1378,7 +1378,7 @@ cpp_token_as_text (pfile, token)
      const cpp_token *token;
 {
   unsigned int len = cpp_token_len (token);
-  unsigned char *start = _cpp_pool_alloc (&pfile->temp_string_pool, len), *end;
+  unsigned char *start = _cpp_pool_alloc (&pfile->ident_pool, len), *end;
 
   end = cpp_spell_token (pfile, token, start);
   end[0] = '\0';
index a032f7be24d777aae98348ffe4ce0ebc697d0fa9..76d6cc3c58080fee84ae580e8e67764ebbc55068 100644 (file)
@@ -457,15 +457,9 @@ do_define (pfile)
 
   if (node)
     {
-      /* Use the permanent pool for storage.  */
-      pfile->string_pool = &pfile->ident_pool;
-
       if (_cpp_create_definition (pfile, node))
        if (pfile->cb.define)
          (*pfile->cb.define) (pfile, node);
-
-      /* Revert to the temporary pool.  */
-      pfile->string_pool = &pfile->temp_string_pool;
     }
 }
 
@@ -531,7 +525,7 @@ glue_header_name (pfile, header)
     cpp_error (pfile, "missing terminating > character");
   else
     {
-      token_mem = _cpp_pool_alloc (pfile->string_pool, total_len);
+      token_mem = _cpp_pool_alloc (&pfile->ident_pool, total_len);
       memcpy (token_mem, buffer, total_len);
 
       header->type = CPP_HEADER_NAME;
@@ -1487,9 +1481,6 @@ parse_assertion (pfile, answerp, type)
   /* We don't expand predicates or answers.  */
   pfile->state.prevent_expansion++;
 
-  /* Use the permanent pool for storage (for the answers).  */
-  pfile->string_pool = &pfile->ident_pool;
-
   *answerp = 0;
   cpp_get_token (pfile, &predicate);
   if (predicate.type == CPP_EOF)
@@ -1507,7 +1498,6 @@ parse_assertion (pfile, answerp, type)
       result = cpp_lookup (pfile, sym, len + 1);
     }
 
-  pfile->string_pool = &pfile->temp_string_pool;
   pfile->state.prevent_expansion--;
   return result;
 }
index 4c4b7e3a3200f52188141d346a3f6eeadcf41334..32ebb747db23ca0de66765914cf6eef54906782f 100644 (file)
@@ -512,10 +512,8 @@ struct cpp_reader
   /* Memory pools.  */
   cpp_pool ident_pool;         /* For all identifiers, and permanent
                                   numbers and strings.  */
-  cpp_pool temp_string_pool;   /* For temporary numbers and strings.   */
   cpp_pool macro_pool;         /* For macro definitions.  Permanent.  */
   cpp_pool argument_pool;      /* For macro arguments.  Temporary.   */
-  cpp_pool* string_pool;       /* Either temp_string_pool or ident_pool.   */
 
   /* Context stack.  */
   struct cpp_context base_context;
index 22900932e0ed6e3d6d36d7933f181c417f14e02e..8af9fab52ff3e11623e7117a7a14ad81e209dddd 100644 (file)
@@ -125,7 +125,7 @@ make_number_token (pfile, token, number)
      cpp_token *token;
      int number;
 {
-  unsigned char *buf = _cpp_pool_alloc (pfile->string_pool, 20);
+  unsigned char *buf = _cpp_pool_alloc (&pfile->ident_pool, 20);
 
   sprintf ((char *) buf, "%d", number);
   token->type = CPP_NUMBER;
@@ -162,7 +162,7 @@ builtin_macro (pfile, token)
            buffer = buffer->prev;
 
        name = buffer->nominal_fname;
-       make_string_token (pfile->string_pool, token,
+       make_string_token (&pfile->ident_pool, token,
                           (const unsigned char *) name, strlen (name));
       }
       break;
@@ -237,7 +237,6 @@ static void
 lock_pools (pfile)
      cpp_reader *pfile;
 {
-  _cpp_lock_pool (&pfile->temp_string_pool);
   _cpp_lock_pool (&pfile->argument_pool);
 }
 
@@ -245,7 +244,6 @@ static void
 unlock_pools (pfile)
      cpp_reader *pfile;
 {
-  _cpp_unlock_pool (&pfile->temp_string_pool);
   _cpp_unlock_pool (&pfile->argument_pool);
 }
 
@@ -288,7 +286,7 @@ stringify_arg (pfile, arg)
      cpp_reader *pfile;
      macro_arg *arg;
 {
-  cpp_pool *pool = pfile->string_pool;
+  cpp_pool *pool = &pfile->ident_pool;
   unsigned char *start = POOL_FRONT (pool);
   unsigned int i, escape_it, total_len = 0, backslash_count = 0;
 
@@ -397,10 +395,8 @@ paste_tokens (pfile, lhs, rhs)
     {
       unsigned int total_len = cpp_token_len (lhs) + cpp_token_len (rhs);
       unsigned char *result, *end;
-      cpp_pool *pool;
 
-      pool = type == CPP_NAME ? &pfile->ident_pool: pfile->string_pool;
-      result = _cpp_pool_alloc (pool, total_len + 1);
+      result = _cpp_pool_alloc (&pfile->ident_pool, total_len + 1);
 
       /* Paste the spellings and null terminate.  */
       end = cpp_spell_token (pfile, rhs, cpp_spell_token (pfile, lhs, result));