r322517 - [Driver] Suggest valid integrated tools
Brian Gesiak via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 15 13:05:40 PST 2018
Author: modocache
Date: Mon Jan 15 13:05:40 2018
New Revision: 322517
URL: http://llvm.org/viewvc/llvm-project?rev=322517&view=rev
Log:
[Driver] Suggest valid integrated tools
Summary:
There are only two valid integrated Clang driver tools: `-cc1` and
`-cc1as`. If a user asks for an unknown tool, such as `-cc1asphalt`,
an error message is displayed to indicate that there is no such tool,
but the message doesn't indicate what the valid options are.
Include the valid options in the error message.
Test Plan: `check-clang`
Reviewers: sepavloff, bkramer, phosek
Reviewed By: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D42004
Modified:
cfe/trunk/test/Driver/unknown-arg.c
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/test/Driver/unknown-arg.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unknown-arg.c?rev=322517&r1=322516&r2=322517&view=diff
==============================================================================
--- cfe/trunk/test/Driver/unknown-arg.c (original)
+++ cfe/trunk/test/Driver/unknown-arg.c Mon Jan 15 13:05:40 2018
@@ -14,6 +14,8 @@
// RUN: FileCheck %s --check-prefix=SILENT
// RUN: not %clang -cc1as -hell --version -debug-info-macros 2>&1 | \
// RUN: FileCheck %s --check-prefix=CC1AS-DID-YOU-MEAN
+// RUN: not %clang -cc1asphalt -help 2>&1 | \
+// RUN: FileCheck %s --check-prefix=UNKNOWN-INTEGRATED
// CHECK: error: unknown argument: '-cake-is-lie'
// CHECK: error: unknown argument: '-%0'
@@ -46,7 +48,7 @@
// CC1AS-DID-YOU-MEAN: error: unknown argument '-hell', did you mean '-help'?
// CC1AS-DID-YOU-MEAN: error: unknown argument '--version', did you mean '-version'?
// CC1AS-DID-YOU-MEAN: error: unknown argument '-debug-info-macros', did you mean '-debug-info-macro'?
-
+// UNKNOWN-INTEGRATED: error: unknown integrated tool 'asphalt'. Valid tools include '-cc1' and '-cc1as'.
// RUN: %clang -S %s -o %t.s -Wunknown-to-clang-option 2>&1 | FileCheck --check-prefix=IGNORED %s
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=322517&r1=322516&r2=322517&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Mon Jan 15 13:05:40 2018
@@ -311,7 +311,8 @@ static int ExecuteCC1Tool(ArrayRef<const
return cc1as_main(argv.slice(2), argv[0], GetExecutablePathVP);
// Reject unknown tools.
- llvm::errs() << "error: unknown integrated tool '" << Tool << "'\n";
+ llvm::errs() << "error: unknown integrated tool '" << Tool << "'. "
+ << "Valid tools include '-cc1' and '-cc1as'.\n";
return 1;
}
More information about the cfe-commits
mailing list