OSDN Git Service

2011-08-19 Andrew Stubbs <ams@codesourcery.com>
[pf3gnuchains/gcc-fork.git] / gcc / gengtype-parse.c
index 0f2e0c6..89f14e8 100644 (file)
@@ -1,5 +1,5 @@
 /* Process source files and output type information.
-   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
 
    This file is part of GCC.
 
    along with GCC; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
+#ifdef GENERATOR_FILE
 #include "bconfig.h"
+#else
+#include "config.h"
+#endif
 #include "system.h"
 #include "gengtype.h"
 
@@ -372,7 +376,7 @@ str_optvalue_opt (options_p prev)
       value = string_seq ();
       require (')');
     }
-  return create_option (prev, name, value);
+  return create_string_option (prev, name, value);
 }
 
 /* absdecl: type '*'*
@@ -410,7 +414,7 @@ type_optvalue (options_p prev, const char *name)
   require ('(');
   ty = absdecl ();
   require (')');
-  return create_option (prev, name, ty);
+  return create_type_option (prev, name, ty);
 }
 
 /* Nested pointer data: '(' type '*'* ',' string_seq ',' string_seq ')' */
@@ -459,7 +463,7 @@ option (options_p prev)
     default:
       parse_error ("expected an option keyword, have %s", print_cur_token ());
       advance ();
-      return create_option (prev, "", "");
+      return create_string_option (prev, "", "");
     }
 }
 
@@ -751,7 +755,9 @@ type (options_p *optsp, bool nested)
        if (token () == ID)
          s = advance ();
        else
-         s = xasprintf ("anonymous:%s:%d", lexer_line.file, lexer_line.line);
+         s = xasprintf ("anonymous:%s:%d",
+                        get_input_file_name (lexer_line.file),
+                        lexer_line.line);
 
        /* Unfortunately above GTY_TOKEN check does not capture the
           typedef struct_type GTY case.  */
@@ -788,7 +794,9 @@ type (options_p *optsp, bool nested)
       if (token () == ID)
        s = advance ();
       else
-       s = xasprintf ("anonymous:%s:%d", lexer_line.file, lexer_line.line);
+       s = xasprintf ("anonymous:%s:%d",
+                      get_input_file_name (lexer_line.file),
+                      lexer_line.line);
 
       if (token () == '{')
        consume_balanced ('{', '}');