Skip to content

Commit

Permalink
Revert "[clang][driver] Emit a warning if -xc/-xc++ is after the last…
Browse files Browse the repository at this point in the history
… input file"

This reverts commit 1c1a4b9.

Some builders failed.
  • Loading branch information
kongy committed Mar 15, 2022
1 parent 1c1a4b9 commit ba59476
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
3 changes: 0 additions & 3 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Expand Up @@ -365,9 +365,6 @@ def warn_drv_preprocessed_input_file_unused : Warning<
def warn_drv_unused_argument : Warning<
"argument unused during compilation: '%0'">,
InGroup<UnusedCommandLineArgument>;
def warn_drv_unused_x : Warning<
"‘-x %0’ after last input file has no effect">,
InGroup<UnusedCommandLineArgument>;
def warn_drv_empty_joined_argument : Warning<
"joined argument expects additional value: '%0'">,
InGroup<UnusedCommandLineArgument>;
Expand Down
9 changes: 0 additions & 9 deletions clang/lib/Driver/Driver.cpp
Expand Up @@ -2308,15 +2308,6 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
assert(!Args.hasArg(options::OPT_x) && "-x and /TC or /TP is not allowed");
}

// Warn -x after last input file has no effect
{
Arg *LastXArg = Args.getLastArgNoClaim(options::OPT_x);
Arg *LastInputArg = Args.getLastArgNoClaim(options::OPT_INPUT);
if (LastInputArg->getIndex() < LastXArg->getIndex()) {
Diag(clang::diag::warn_drv_unused_x) << LastXArg->getValue();
}
}

for (Arg *A : Args) {
if (A->getOption().getKind() == Option::InputClass) {
const char *Value = A->getValue();
Expand Down
7 changes: 0 additions & 7 deletions clang/test/Driver/x-args.c

This file was deleted.

0 comments on commit ba59476

Please sign in to comment.