Skip to content

Commit ba59476

Browse files
committed
Revert "[clang][driver] Emit a warning if -xc/-xc++ is after the last input file"
This reverts commit 1c1a4b9. Some builders failed.
1 parent 1c1a4b9 commit ba59476

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,6 @@ def warn_drv_preprocessed_input_file_unused : Warning<
365365
def warn_drv_unused_argument : Warning<
366366
"argument unused during compilation: '%0'">,
367367
InGroup<UnusedCommandLineArgument>;
368-
def warn_drv_unused_x : Warning<
369-
"‘-x %0’ after last input file has no effect">,
370-
InGroup<UnusedCommandLineArgument>;
371368
def warn_drv_empty_joined_argument : Warning<
372369
"joined argument expects additional value: '%0'">,
373370
InGroup<UnusedCommandLineArgument>;

clang/lib/Driver/Driver.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,15 +2308,6 @@ void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
23082308
assert(!Args.hasArg(options::OPT_x) && "-x and /TC or /TP is not allowed");
23092309
}
23102310

2311-
// Warn -x after last input file has no effect
2312-
{
2313-
Arg *LastXArg = Args.getLastArgNoClaim(options::OPT_x);
2314-
Arg *LastInputArg = Args.getLastArgNoClaim(options::OPT_INPUT);
2315-
if (LastInputArg->getIndex() < LastXArg->getIndex()) {
2316-
Diag(clang::diag::warn_drv_unused_x) << LastXArg->getValue();
2317-
}
2318-
}
2319-
23202311
for (Arg *A : Args) {
23212312
if (A->getOption().getKind() == Option::InputClass) {
23222313
const char *Value = A->getValue();

clang/test/Driver/x-args.c

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)