Skip to content

Commit

Permalink
[clang][driver] Add missing integrated tool option in error message, …
Browse files Browse the repository at this point in the history
…NFC (#81926)
  • Loading branch information
cyndyishida committed Feb 15, 2024
1 parent 1d03d59 commit 761113a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clang/test/Driver/unknown-arg.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
// SILENT-NOT: warning:
// CC1AS-DID-YOU-MEAN: error: unknown argument '-hell'; did you mean '-help'?
// CC1AS-DID-YOU-MEAN: error: unknown argument '--version'; did you mean '-version'?
// UNKNOWN-INTEGRATED: error: unknown integrated tool '-cc1asphalt'. Valid tools include '-cc1' and '-cc1as'.
// UNKNOWN-INTEGRATED: error: unknown integrated tool '-cc1asphalt'. Valid tools include '-cc1', '-cc1as' and '-cc1gen-reproducer'.

// RUN: %clang -S %s -o %t.s -Wunknown-to-clang-option 2>&1 | FileCheck --check-prefix=IGNORED %s

Expand Down
5 changes: 3 additions & 2 deletions clang/tools/driver/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ static int ExecuteCC1Tool(SmallVectorImpl<const char *> &ArgV,
return cc1gen_reproducer_main(ArrayRef(ArgV).slice(2), ArgV[0],
GetExecutablePathVP, ToolContext);
// Reject unknown tools.
llvm::errs() << "error: unknown integrated tool '" << Tool << "'. "
<< "Valid tools include '-cc1' and '-cc1as'.\n";
llvm::errs()
<< "error: unknown integrated tool '" << Tool << "'. "
<< "Valid tools include '-cc1', '-cc1as' and '-cc1gen-reproducer'.\n";
return 1;
}

Expand Down

0 comments on commit 761113a

Please sign in to comment.