diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-11-05 10:05:10 -0500 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-11-05 14:09:21 -0500 |
commit | f1b4c4bfd0b55c3c0abbc73e1159117f8533aca3 (patch) | |
tree | 48095a3da68bacea68e37e8e4331419296c669d0 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 4f12ba50bb28a1bf5c5131dcdf84121f04b0e584 (diff) | |
download | bcm5719-llvm-f1b4c4bfd0b55c3c0abbc73e1159117f8533aca3.tar.gz bcm5719-llvm-f1b4c4bfd0b55c3c0abbc73e1159117f8533aca3.zip |
[lit] Fix `not` calling internal commands
Without this patch, when using lit's internal shell, if `not` on a lit
RUN line calls `env`, `diff`, or any of the other in-process shell
builtins that lit implements, lit accidentally searches for the latter
as an external executable. What's worse is that works fine when a
developer is testing on a platform where those executables are
available and behave as expected, but it then breaks on other
platforms.
`not` seems useful for some builtins, such as `diff`, so this patch
supports such uses. `not --crash` does not seem useful for builtins,
so this patch diagnoses such uses. In all cases, this patch ensures
shell builtins are found behind any sequence of `env` and `not`
commands.
`not` calling `env` calling an external command appears useful when
the `env` and external command are part of a lit substitution, as in
D65156. This patch supports that by looking through any sequence of
`env` and `not` commands, building the environment from the `env`s,
and storing the `not`s. The `not`s are then added back to the command
line without the `env`s to execute externally. This avoids the need
to replicate the `not` implementation, in particular the `--crash`
option, in lit.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D66531
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions