aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/lex.c8
-rw-r--r--gcc/cp/parser.c6
3 files changed, 14 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 562c2a5..4c0d919 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-29 Tom Tromey <tromey@redhat.com>
+
+ * parser.c (struct cp_token) <input_file_stack_index>: Remove.
+ (cp_lexer_get_preprocessor_token): Update.
+ (cp_lexer_set_source_position_from_token): Don't call
+ restore_input_file_stack.
+ * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
+
2008-02-28 Richard Guenther <rguenther@suse.de>
Revert:
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 2558a78..0b2a372 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -372,6 +372,7 @@ bool statement_code_p[MAX_TREE_CODES];
bool
cxx_init (void)
{
+ location_t saved_loc;
unsigned int i;
static const enum tree_code stmt_codes[] = {
CTOR_INITIALIZER, TRY_BLOCK, HANDLER,
@@ -385,7 +386,8 @@ cxx_init (void)
for (i = 0; i < ARRAY_SIZE (stmt_codes); i++)
statement_code_p[stmt_codes[i]] = true;
- push_srcloc (BUILTINS_LOCATION);
+ saved_loc = input_location;
+ input_location = BUILTINS_LOCATION;
init_reswords ();
init_tree ();
@@ -413,7 +415,7 @@ cxx_init (void)
if (c_common_init () == false)
{
- pop_srcloc();
+ input_location = saved_loc;
return false;
}
@@ -421,7 +423,7 @@ cxx_init (void)
init_repo ();
- pop_srcloc();
+ input_location = saved_loc;
return true;
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 77542bf..458ab7b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -79,8 +79,6 @@ typedef struct cp_token GTY (())
KEYWORD is RID_MAX) iff this name was looked up and found to be
ambiguous. An error has already been reported. */
BOOL_BITFIELD ambiguous_p : 1;
- /* The input file stack index at which this token was found. */
- unsigned input_file_stack_index : INPUT_FILE_STACK_BITS;
/* The value associated with this token, if any. */
union cp_token_value {
/* Used for CPP_NESTED_NAME_SPECIFIER and CPP_TEMPLATE_ID. */
@@ -99,7 +97,7 @@ DEF_VEC_ALLOC_P (cp_token_position,heap);
static cp_token eof_token =
{
- CPP_EOF, RID_MAX, 0, PRAGMA_NONE, 0, 0, false, 0, { NULL },
+ CPP_EOF, RID_MAX, 0, PRAGMA_NONE, 0, false, 0, { NULL },
0
};
@@ -408,7 +406,6 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
token->type
= c_lex_with_flags (&token->u.value, &token->location, &token->flags,
lexer == NULL ? 0 : C_LEX_RAW_STRINGS);
- token->input_file_stack_index = input_file_stack_tick;
token->keyword = RID_MAX;
token->pragma_kind = PRAGMA_NONE;
token->in_system_header = in_system_header;
@@ -490,7 +487,6 @@ cp_lexer_set_source_position_from_token (cp_token *token)
{
input_location = token->location;
in_system_header = token->in_system_header;
- restore_input_file_stack (token->input_file_stack_index);
}
}