GCC Middle and Back End API Reference
file-prefix-map.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "diagnostic.h"
#include "file-prefix-map.h"
Include dependency graph for file-prefix-map.cc:

Data Structures

struct  file_prefix_map
 

Functions

static void add_prefix_map (file_prefix_map *&maps, const char *arg, const char *opt)
 
static const char * remap_filename (file_prefix_map *maps, const char *filename)
 
void add_macro_prefix_map (const char *arg)
 
void add_debug_prefix_map (const char *arg)
 
void add_file_prefix_map (const char *arg)
 
void add_profile_prefix_map (const char *arg)
 
const char * remap_macro_filename (const char *filename)
 
const char * remap_debug_filename (const char *filename)
 
const char * remap_profile_filename (const char *filename)
 

Variables

static file_prefix_mapmacro_prefix_maps
 
static file_prefix_mapdebug_prefix_maps
 
static file_prefix_mapprofile_prefix_maps
 

Function Documentation

◆ add_debug_prefix_map()

void add_debug_prefix_map ( const char * arg)
Record a file prefix mapping for -fdebug-prefix-map.   

References add_prefix_map(), and debug_prefix_maps.

Referenced by handle_common_deferred_options().

◆ add_file_prefix_map()

void add_file_prefix_map ( const char * arg)
Record a file prefix mapping for all -f*-prefix-map.   

References add_prefix_map(), debug_prefix_maps, macro_prefix_maps, and profile_prefix_maps.

Referenced by handle_common_deferred_options().

◆ add_macro_prefix_map()

void add_macro_prefix_map ( const char * arg)
Record a file prefix mapping for -fmacro-prefix-map.   

References add_prefix_map(), and macro_prefix_maps.

◆ add_prefix_map()

static void add_prefix_map ( file_prefix_map *& maps,
const char * arg,
const char * opt )
static
Record a file prefix mapping in the specified map.  ARG is the argument to
-f*-prefix-map and must be of the form OLD=NEW.  OPT is the option name
for diagnostics.   

References error(), flag_canon_prefix_map, free(), and map.

Referenced by add_debug_prefix_map(), add_file_prefix_map(), add_macro_prefix_map(), and add_profile_prefix_map().

◆ add_profile_prefix_map()

void add_profile_prefix_map ( const char * arg)
Record a file prefix mapping for -fprofile-prefix-map.   

References add_prefix_map(), and profile_prefix_maps.

Referenced by handle_common_deferred_options().

◆ remap_debug_filename()

const char * remap_debug_filename ( const char * filename)
Remap using -fdebug-prefix-map.  Return the GC-allocated new name
corresponding to FILENAME or FILENAME if no remapping was performed.   

References debug_prefix_maps, and remap_filename().

Referenced by comp_dir_string(), lto_output_location_1(), output_file_directive(), and print_decl_identifier().

◆ remap_filename()

static const char * remap_filename ( file_prefix_map * maps,
const char * filename )
static
Perform user-specified mapping of filename prefixes.  Return the
GC-allocated new name corresponding to FILENAME or FILENAME if no
remapping was performed.   

References free(), ggc_alloc_atomic(), map, and NULL.

Referenced by remap_debug_filename(), remap_macro_filename(), and remap_profile_filename().

◆ remap_macro_filename()

const char * remap_macro_filename ( const char * filename)
Remap using -fmacro-prefix-map.  Return the GC-allocated new name
corresponding to FILENAME or FILENAME if no remapping was performed.   

References macro_prefix_maps, and remap_filename().

Referenced by fold_builtin_FILE().

◆ remap_profile_filename()

const char * remap_profile_filename ( const char * filename)
Remap using -fprofile-prefix-map.  Return the GC-allocated new name
corresponding to FILENAME or FILENAME if no remapping was performed.   

References profile_prefix_maps, and remap_filename().

Referenced by coverage_begin_function(), and output_location().

Variable Documentation

◆ debug_prefix_maps

◆ macro_prefix_maps

file_prefix_map* macro_prefix_maps
static
NOTE: if adding another -f*-prefix-map option then don't forget to
ignore it in DW_AT_producer (gen_command_line_string in opts.cc).   
Linked lists of file_prefix_map structures.   

Referenced by add_file_prefix_map(), add_macro_prefix_map(), and remap_macro_filename().

◆ profile_prefix_maps