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]

Re: [PATCH V3]PR other/70268: map one directory name (old) to another (new) in __FILE__


On 03/18/2016 04:05 PM, Hongxu Jia wrote:

Please explain why you first alloca() and then strdup the result instead of XNEWVEC


BTW, I just refer the implement of -fdebug-prefix-map:

In gcc/final.c
----------------
const char *
remap_debug_filename (const char *filename)
----------------

//Hongxu

1. alloca - allocate memory that is automatically freed when the
    function remap_file_filename returns

2. XNEW - allocate memory for struct file_prefix_map

3. xstrdup - duplicate a string

//Hongxu



Thanks,


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