LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 38135 - Clang should add support for -fmacro-prefix-map and -ffile-prefix-map
Summary: Clang should add support for -fmacro-prefix-map and -ffile-prefix-map
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: trunk
Hardware: All All
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-11 09:25 PDT by Dan McGregor
Modified: 2019-11-26 18:30 PST (History)
4 users (show)

See Also:
Fixed By Commit(s): 6c92cdff72251a7d13ab3958b04fba72dfcaebb1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan McGregor 2018-07-11 09:25:31 PDT
Starting with GCC 8, GCC has added support for prefix remapping of the __FILE__ and __BASE_FILE__ macro similar to the handling of -fdebug-prefix-map.

It also adds support for -ffile-prefix-map, which is simply the union of -fdebug-prefix-map and -fmacro-prefix-map.
Comment 1 Dan McGregor 2018-07-11 09:28:51 PDT
A not unreasonable alternative is to have -fdebug-prefix-map also apply to the macros. That seems to be the approach taken by the Yocto project in its local patches to GCC.
Comment 2 Dan McGregor 2018-07-17 20:49:24 PDT
I created a review for this.

https://reviews.llvm.org/D49466
Comment 3 Peter Wu 2019-11-26 18:30:29 PST
This has finally landed, thanks Dan!

https://reviews.llvm.org/rG6c92cdff72251a7d13ab3958b04fba72dfcaebb1
If everything goes well, this should become a part of Clang 10.

@Dan would you mind writing a release note entry?