[tuples] Add support for mapped locations in gimple_locus_empty_p

Diego Novillo dnovillo@google.com
Tue Oct 30 05:10:00 GMT 2007


Thanks to Tom for providing the code and checking the other functions
dealing with locus_t.

Tested on x86_64.  Committed.


Diego.

2007-10-29  Diego Novillo  <dnovillo@google.com>
            Tom Tromey  <tromey@redhat.com>

        * gimple.h (gimple_locus): Update comment.
        (gimple_set_locus): Likewise.
        (gimple_locus_empty_p): Add support for mapped locations.

Index: gimple.h
===================================================================
--- gimple.h    (revision 129739)
+++ gimple.h    (working copy)
@@ -543,8 +543,7 @@ gimple_set_block (gimple g, tree block)
 }


-/* Return locus information for statement G.  FIXME tuples, fix for
-   mapped location support.  */
+/* Return locus information for statement G.  */

 static inline location_t
 gimple_locus (const_gimple g)
@@ -553,8 +552,7 @@ gimple_locus (const_gimple g)
 }


-/* Set locus information for statement G.  FIXME tuples, fix for
-   mapped location support.  */
+/* Set locus information for statement G.  */

 static inline void
 gimple_set_locus (gimple g, location_t locus)
@@ -568,7 +566,11 @@ gimple_set_locus (gimple g, location_t l
 static inline bool
 gimple_locus_empty_p (const_gimple g)
 {
+#ifdef USE_MAPPED_LOCATION
+  return gimple_locus (g) == UNKNOWN_LOCATION;
+#else
   return gimple_locus (g).file == NULL && gimple_locus (g).line == 0;
+#endif
 }



More information about the Gcc-patches mailing list