Skip to content
Snippets Groups Projects
  • Dodji Seketeli's avatar
    c468587a
    Support location tracking for built-in macro tokens · c468587a
    Dodji Seketeli authored
    
    When a built-in macro is expanded, the location of the token in the
    epansion list is the location of the expansion point of the built-in
    macro.
    
    This patch creates a virtual location for that token instead,
    effectively tracking locations of tokens resulting from built-in macro
    tokens.
    
    libcpp/
    	* include/line-map.h (line_maps::builtin_location): New data
    	member.
    	(line_map_init): Add a new parameter to initialize the new
    	line_maps::builtin_location data member.
    	* line-map.c (linemap_init): Initialize the
    	line_maps::builtin_location data member.
    	* macro.c (builtin_macro): Create a macro map and track the token
    	resulting from the expansion of a built-in macro.
    gcc/
    	* input.h (is_location_from_builtin_token): New function
    	declaration.
    	* input.c (is_location_from_builtin_token): New function
    	definition.
    	* toplev.c (general_init): Tell libcpp what the pre-defined
    	spelling location for built-in tokens is.
    
    Signed-off-by: default avatarDodji Seketeli <dodji@redhat.com>
    
    From-SVN: r212637
    c468587a
    History
    Support location tracking for built-in macro tokens
    Dodji Seketeli authored
    
    When a built-in macro is expanded, the location of the token in the
    epansion list is the location of the expansion point of the built-in
    macro.
    
    This patch creates a virtual location for that token instead,
    effectively tracking locations of tokens resulting from built-in macro
    tokens.
    
    libcpp/
    	* include/line-map.h (line_maps::builtin_location): New data
    	member.
    	(line_map_init): Add a new parameter to initialize the new
    	line_maps::builtin_location data member.
    	* line-map.c (linemap_init): Initialize the
    	line_maps::builtin_location data member.
    	* macro.c (builtin_macro): Create a macro map and track the token
    	resulting from the expansion of a built-in macro.
    gcc/
    	* input.h (is_location_from_builtin_token): New function
    	declaration.
    	* input.c (is_location_from_builtin_token): New function
    	definition.
    	* toplev.c (general_init): Tell libcpp what the pre-defined
    	spelling location for built-in tokens is.
    
    Signed-off-by: default avatarDodji Seketeli <dodji@redhat.com>
    
    From-SVN: r212637