Cherry pick prefix mapping option fix from next
#10740
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: Add a new prefix mapping option format
-fdepscan-prefix-map <old> <new>
because the previous format could not handle paths including an equal sign. Made the old format driver-only so it gets translated to the new format when emitting the frontend command.Scope: This should not cause any backward compatibility issues since the old option format is still supported. Only some tests needed to change because they were searching the generated frontend command for the old flag format or they were directly running a frontend command with the old format.
Issues: rdar://129434789
Original PRs: New option format for prefix mapping #10723
Risk: Low, only adds a new flag.
Testing: I added a unit test to test the
transformPairs
function used to construct the prefix mapping objects, as well as a clang driver test to check that the ordering is handled correctly when using a mix of the old and new flag formats. Old tests have been updated to make sure they don't cause false positives with the old format being driver-only now.Reviewers: @akyrtzi @cachemeifyoucan @benlangmuir