preprocessor: simplify read_main

Message ID 44798992-dd12-d150-6b63-3b5241335aa2@acm.org
State New
Headers show
Series
  • preprocessor: simplify read_main
Related show

Commit Message

Nathan Sidwell July 28, 2020, 12:52 p.m.
We can always use the final map to get the return value, rather than 
conditionally only when there was an immediate line directive.

             libcpp/
             * init.c (cpp_read_main_file): Always use the last map for
             the return value.

pushed
-- 
Nathan Sidwell

Patch

diff --git i/libcpp/init.c w/libcpp/init.c
index 0aac5acd0a3..f9f1fb204f0 100644
--- i/libcpp/init.c
+++ w/libcpp/init.c
@@ -683,12 +683,9 @@  cpp_read_main_file (cpp_reader *pfile, const char *fname, bool injecting)
   /* For foo.i, read the original filename foo.c now, for the benefit
      of the front ends.  */
   if (CPP_OPTION (pfile, preprocessed))
-    {
-      read_original_filename (pfile);
-      fname = (ORDINARY_MAP_FILE_NAME
-	       ((LINEMAPS_LAST_ORDINARY_MAP (pfile->line_table))));
-    }
-  return fname;
+    read_original_filename (pfile);
+
+  return ORDINARY_MAP_FILE_NAME (LINEMAPS_LAST_ORDINARY_MAP (pfile->line_table));
 }
 
 /* For preprocessed files, if the first tokens are of the form # NUM.