Repository navigation
[clang] preserve arguments after filtered response-file options - #2339
Merged
Merged
Conversation
When a removed option still needs its value, filtering consumed the next response-file token as that value and discarded all the file's remaining arguments. Expand the file first, then remove only the actual value. Preserve pending values across file boundaries. Track active response files to prevent recursion while allowing later occurrences to be filtered. Ignore blank lines without discarding quoted empty arguments. Unchanged response files retain their original command-line tokens. ```sh # options.rsp: -mllvm # values.rsp: -inline-threshold=7, -DKEEP=1, -std=c++17 (one argument per line) clang++ @options.rsp @values.rsp -c example.cpp # previously lost the define and language flags from values.rsp ``` Limitations: response files retain the existing format of one argument per line with simple quote stripping. ## Test plan Twelve argument tests plus existing Clang unit tests; compiler-validated end-to-end capture matrix including direct, forwarded, nested, repeated and blank-line response files; unchanged-command argv comparison; full regression suite and fourteen-project report, trace, summary and cost comparison.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a removed option still needs its value, filtering consumed the next response-file token as that
value and discarded all the file's remaining arguments. Expand the file first, then remove only the
actual value. Preserve pending values across file boundaries.
Track active response files to prevent recursion while allowing later occurrences to be filtered.
Ignore blank lines without discarding quoted empty arguments. Unchanged response files retain their
original command-line tokens.
Limitations: response files retain the existing format of one argument per line with simple quote
stripping.
Test plan
Twelve argument tests plus existing Clang unit tests; compiler-validated end-to-end capture matrix
including direct, forwarded, nested, repeated and blank-line response files; unchanged-command argv
comparison; full regression suite and fourteen-project report, trace, summary and cost comparison.