-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang-scan-deps] Expand response files before the argument adjuster #89950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
13c4110
[clang-scan-deps] Expand response files before the argument ajuster
aganea d6122c7
Add test
aganea d74e133
Handle /Fo in the Clang driver as well.
aganea 3eaba52
Cover extracting -MT dependency from /Fo flag in clang-cl mode
aganea 7b6f573
Address review comments
aganea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Check that the scanner can adjust arguments by reading .rsp files in advance. | ||
|
||
// RUN: rm -rf %t | ||
// RUN: split-file %s %t | ||
|
||
// First run the tests with a .cdb | ||
// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json | ||
jansvoboda11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// RUN: sed -e "s|DIR|%/t|g" %t/args_nested.template > %t/args_nested.rsp | ||
|
||
// RUN: cp %t/args_compilation.rsp %t/args.rsp | ||
// RUN: clang-scan-deps --compilation-database %t/cdb.json > %t/deps.json | ||
// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s | ||
|
||
// RUN: cp %t/args_preprocess.rsp %t/args.rsp | ||
// RUN: clang-scan-deps --compilation-database %t/cdb.json > %t/deps.json | ||
// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s | ||
|
||
|
||
// Now run the tests again with a in-place compilation database | ||
// RUN: cd %t | ||
|
||
// RUN: cp args_compilation.rsp args.rsp | ||
// RUN: clang-scan-deps -o deps.json -- %clang_cl @args.rsp | ||
// RUN: cat deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s | ||
|
||
// RUN: cp args_preprocess.rsp args.rsp | ||
// RUN: clang-scan-deps -o deps.json -- %clang_cl @args.rsp | ||
// RUN: cat deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s | ||
|
||
// Here we ensure that we got a qualified .obj with its full path, since that's what we're passing with /Fo | ||
// CHECK: [[PREFIX]]/tu.obj: | ||
|
||
//--- cdb.json.template | ||
[{ | ||
"file": "DIR/tu.cpp", | ||
"directory": "DIR", | ||
"command": "clang-cl @DIR/args.rsp" | ||
}] | ||
|
||
//--- args_compilation.rsp | ||
@args_nested.rsp | ||
/c | ||
|
||
//--- args_preprocess.rsp | ||
@args_nested.rsp | ||
/E | ||
|
||
//--- args_nested.template | ||
/I include | ||
tu.cpp | ||
/FoDIR/tu.obj | ||
|
||
//--- include/header.h | ||
|
||
//--- tu.cpp | ||
#include "header.h" |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.