-/* Save the current INPUT_LOCATION on the top entry in the
- INPUT_FILE_STACK. Push a new entry for FILE and LINE, and set the
- INPUT_LOCATION accordingly. */
-
-void
-#ifdef USE_MAPPED_LOCATION
-push_srcloc (location_t fline)
-#else
-push_srcloc (const char *file, int line)
-#endif
-{
- struct file_stack *fs;
-
- gcc_assert (!input_file_stack_restored);
- if (input_file_stack_tick == (int) ((1U << INPUT_FILE_STACK_BITS) - 1))
- sorry ("GCC supports only %d input file changes", input_file_stack_tick);
-
- fs = XNEW (struct file_stack);
- fs->location = input_location;
- fs->next = input_file_stack;
-#ifdef USE_MAPPED_LOCATION
- input_location = fline;
-#else
- input_filename = file;
- input_line = line;
-#endif
- input_file_stack = fs;
- input_file_stack_tick++;
- VEC_safe_push (fs_p, heap, input_file_stack_history, input_file_stack);
-}
-
-/* Pop the top entry off the stack of presently open source files.
- Restore the INPUT_LOCATION from the new topmost entry on the
- stack. */
-
-void
-pop_srcloc (void)
-{
- struct file_stack *fs;
-
- gcc_assert (!input_file_stack_restored);
- if (input_file_stack_tick == (int) ((1U << INPUT_FILE_STACK_BITS) - 1))
- sorry ("GCC supports only %d input file changes", input_file_stack_tick);
-
- fs = input_file_stack;
- input_location = fs->location;
- input_file_stack = fs->next;
- input_file_stack_tick++;
- VEC_safe_push (fs_p, heap, input_file_stack_history, input_file_stack);
-}
-
-/* Restore the input file stack to its state as of TICK, for the sake
- of diagnostics after processing the whole input. Once this has
- been called, push_srcloc and pop_srcloc may no longer be
- called. */
-void
-restore_input_file_stack (int tick)
-{
- if (tick == 0)
- input_file_stack = NULL;
- else
- input_file_stack = VEC_index (fs_p, input_file_stack_history, tick - 1);
- input_file_stack_tick = tick;
- input_file_stack_restored = true;
-}
-