This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] add DECL_SOURCE_COLUMN to tree.h (trivial)


Hello,
I'm currently writing a plugin for GCC and I need to extract the column of a 
declaration. There exists DECL_SOURCE_FILE/LINE already and for consistency 
reasons and ease of use I've added a DECL_SOURCE_COLUMN macro.

The patch is extremely trivial and probably doesn't need copyright assignment. 
However I have signed copyright assignment for Emacs and maybe that will work 
too (not sure if this has to be signed for every project).

gcc/ChangeLog

2012-06-20  RÃdiger Sonderfeld  <ruediger@c-plusplus.de>

	* tree.h (DECL_SOURCE_COLUMN): New accessor

Regards,
RÃdiger
Index: gcc/tree.h
===================================================================
--- gcc/tree.h	(revision 188837)
+++ gcc/tree.h	(working copy)
@@ -2670,6 +2670,7 @@
   (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
 #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
 #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
+#define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
 #define DECL_IS_BUILTIN(DECL) \
   (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]