This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] Add support for mapped locations in gimple_locus_empty_p
- From: "Diego Novillo" <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Oct 2007 21:36:12 -0400
- Subject: [tuples] Add support for mapped locations in gimple_locus_empty_p
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
}