This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH V3]PR other/70268: map one directory name (old) to another (new) in __FILE__
- From: Hongxu Jia <hongxu dot jia at windriver dot com>
- To: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>, Joseph Myers <joseph at codesourcery dot com>
- Cc: <jakub at gcc dot gnu dot org>, <rguenth at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>, <richard dot purdie at linuxfoundation dot org>
- Date: Fri, 18 Mar 2016 17:33:12 +0800
- Subject: Re: [PATCH V3]PR other/70268: map one directory name (old) to another (new) in __FILE__
- Authentication-results: sourceware.org; auth=none
- References: <1458205064-10251-1-git-send-email-hongxu dot jia at windriver dot com> <alpine dot DEB dot 2 dot 10 dot 1603172242460 dot 18027 at digraph dot polyomino dot org dot uk> <56EB5766 dot 7010109 at windriver dot com> <56EB8F3E dot 90901 at windriver dot com> <97BE5D73-0EDD-43ED-9B71-FB477D7E2701 at gmail dot com> <56EBB6DE dot 603 at windriver dot com>
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,