OSDN Git Service

* line-map.h (source_location): New typedef.
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Dec 2003 20:52:39 +0000 (20:52 +0000)
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Dec 2003 20:52:39 +0000 (20:52 +0000)
(fileline):  Redefined as source_location.
(struct line_map, linemap_add, linemap_lookup):  Replace filefile
by source_location.
* line-map.c (linemap_add, linemap_lookup):  Use source_location.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74344 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/line-map.c
gcc/line-map.h

index 9d91798..eaaff18 100644 (file)
@@ -1,3 +1,11 @@
+2003-12-05  Per Bothner  <pbothner@apple.com>
+
+       * line-map.h (source_location):  New typedef.
+       (fileline):  Redefined as source_location.
+       (struct line_map, linemap_add, linemap_lookup):  Replace filefile
+       by source_location.
+       * line-map.c (linemap_add, linemap_lookup):  Use source_location.
+
 2003-12-05  Richard Henderson  <rth@redhat.com>
 
        * config/alpha/alpha.c (alpha_build_builtin_va_list): Add dummy
        PR target/12467
        * config/rs6000/altivec.md (altivec_vmsummbm): Fix typo.
 
+>>>>>>> 2.1930
 2003-12-04  Stuart Hastings  <stuart@apple.com>
 
         * rs6000.c (output_call, macho_branch_islands,
index f04350d..521c4e5 100644 (file)
@@ -1,5 +1,5 @@
 /* Map logical line numbers to (source file, line number) pairs.
-   Copyright (C) 2001
+   Copyright (C) 2001, 2003
    Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@ linemap_free (struct line_maps *set)
 
 const struct line_map *
 linemap_add (struct line_maps *set, enum lc_reason reason,
-            unsigned int sysp, unsigned int from_line,
+            unsigned int sysp, source_location from_line,
             const char *to_file, unsigned int to_line)
 {
   struct line_map *map;
@@ -166,7 +166,7 @@ linemap_add (struct line_maps *set, enum lc_reason reason,
    the list is sorted and we can use a binary search.  */
 
 const struct line_map *
-linemap_lookup (struct line_maps *set, unsigned int line)
+linemap_lookup (struct line_maps *set, source_location line)
 {
   unsigned int md, mn = 0, mx = set->used;
 
index b53f5e0..c57f51a 100644 (file)
@@ -1,5 +1,5 @@
 /* Map logical line numbers to (source file, line number) pairs.
-   Copyright (C) 2001
+   Copyright (C) 2001, 2003
    Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify it
@@ -32,8 +32,9 @@ enum lc_reason {LC_ENTER = 0, LC_LEAVE, LC_RENAME};
 
 /* A logical line number, i,e, an "index" into a line_map.  */
 /* Long-term, we want to use this to replace struct location_s (in input.h),
-   and effectively typedef fileline location_t.  */
-typedef unsigned int fileline;
+   and effectively typedef source_location location_t.  */
+typedef unsigned int source_location;
+typedef source_location fileline; /* deprecated name */
 
 /* The logical line FROM_LINE maps to physical source file TO_FILE at
    line TO_LINE, and subsequently one-to-one until the next line_map
@@ -47,7 +48,7 @@ struct line_map
 {
   const char *to_file;
   unsigned int to_line;
-  fileline from_line;
+  source_location from_line;
   int included_from;
   ENUM_BITFIELD (lc_reason) reason : CHAR_BIT;
   unsigned char sysp;
@@ -92,11 +93,12 @@ extern void linemap_free (struct line_maps *);
    maps, so any stored line_map pointers should not be used.  */
 extern const struct line_map *linemap_add
   (struct line_maps *, enum lc_reason, unsigned int sysp,
-   fileline from_line, const char *to_file, unsigned int to_line);
+   source_location from_line, const char *to_file, unsigned int to_line);
 
 /* Given a logical line, returns the map from which the corresponding
    (source file, line) pair can be deduced.  */
-extern const struct line_map *linemap_lookup (struct line_maps *, fileline);
+extern const struct line_map *linemap_lookup
+  (struct line_maps *, source_location);
 
 /* Print the file names and line numbers of the #include commands
    which led to the map MAP, if any, to stderr.  Nothing is output if