diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2021-06-14 12:24:54 +0200 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2021-06-14 13:58:19 +0200 |
commit | 80c0c639687ef52f5c432ea059ff9cb53125d08e (patch) | |
tree | a8847fa76e788f6375402e8e1ec5ec252ae880a0 /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | 41115efca642981c2165cdf9ef2b2148605faa12 (diff) | |
download | llvm-80c0c639687ef52f5c432ea059ff9cb53125d08e.zip llvm-80c0c639687ef52f5c432ea059ff9cb53125d08e.tar.gz llvm-80c0c639687ef52f5c432ea059ff9cb53125d08e.tar.bz2 |
[clang][deps] Prevent unintended modifications of the original TU command-line
One of the goals of the dependency scanner is to generate command-lines that can be used to explicitly build modular dependencies of a translation unit. The only modifications to these command-lines should be for the purposes of explicit modular build.
However, the current version of dependency scanner leaks its implementation details into the command-lines.
The first problem is that the `clang-scan-deps` tool adjusts the original textual command-line (adding `-Eonly -M -MT <target> -sys-header-deps -Wno-error -o /dev/null `, removing `--serialize-diagnostics`) in order to set up the `DependencyScanning` library. This has been addressed in D103461, D104012, D104030, D104031, D104033. With these patches, the `DependencyScanning` library receives the unmodified `CompilerInvocation`, sets it up and uses it for the implicit modular build.
Finally, to prevent leaking the implementation details to the resulting command-lines, this patch generates them from the **original** unmodified `CompilerInvocation` rather than from the one that drives the implicit build.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D104036
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions