[llvm] r345084 - [dwarfdump] Make incompatibility between -diff and -verbose explicit.
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 23 14:51:44 PDT 2018
Author: jdevlieghere
Date: Tue Oct 23 14:51:44 2018
New Revision: 345084
URL: http://llvm.org/viewvc/llvm-project?rev=345084&view=rev
Log:
[dwarfdump] Make incompatibility between -diff and -verbose explicit.
Using -diff and -verbose together doesn't work today. We should audit
where these two options interact and fix them. In the meantime we error
out when the user try to specify both.
Modified:
llvm/trunk/test/tools/llvm-dwarfdump/cmdline.test
llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
Modified: llvm/trunk/test/tools/llvm-dwarfdump/cmdline.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/cmdline.test?rev=345084&r1=345083&r2=345084&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/cmdline.test (original)
+++ llvm/trunk/test/tools/llvm-dwarfdump/cmdline.test Tue Oct 23 14:51:44 2018
@@ -24,3 +24,6 @@ HELP-NOT: -reverse-iterate
RUN: llvm-dwarfdump --version 2>&1 | FileCheck --check-prefix=VERSION %s
VERSION: {{ version }}
+
+RUN: llvm-dwarfdump -diff -verbose 2>&1 | FileCheck --check-prefix=INCOMPATIBLE %s
+INCOMPATIBLE: error: incompatible arguments: specifying both -diff and -verbose is currently not supported
Modified: llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp?rev=345084&r1=345083&r2=345084&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp (original)
+++ llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp Tue Oct 23 14:51:44 2018
@@ -226,7 +226,7 @@ static alias VerboseAlias("v", desc("Ali
static void error(StringRef Prefix, std::error_code EC) {
if (!EC)
return;
- errs() << Prefix << ": " << EC.message() << "\n";
+ WithColor::error() << Prefix << ": " << EC.message() << "\n";
exit(1);
}
@@ -571,6 +571,14 @@ int main(int argc, char **argv) {
return 0;
}
+ // FIXME: Audit interactions between these two options and make them
+ // compatible.
+ if (Diff && Verbose) {
+ WithColor::error() << "incompatible arguments: specifying both -diff and "
+ "-verbose is currently not supported";
+ return 0;
+ }
+
std::unique_ptr<ToolOutputFile> OutputFile;
if (!OutputFilename.empty()) {
std::error_code EC;
More information about the llvm-commits
mailing list