This eliminates the only dependency edge the generic Arg/OptTable
utility classes had on something Driver-specific. (I'd like to lower
them into Basic after this so users that just parse their own set of
arguments don't need to pull in everything else in libDriver.)
From f00105182ee3d2e4d0da7303f73a0f50288df1dd Mon Sep 17 00:00:00 2001
From: nobled <[email protected]>
Date: Sun, 5 Feb 2012 21:13:11 +0000
Subject: [PATCH 6/8] move argument-related diagnostics into CommonKinds
Eliminates the only dependency edge the Arg/OptTable code has
on something Driver-specific.
---
include/clang/Basic/DiagnosticCommonKinds.td | 7 +++++++
include/clang/Basic/DiagnosticDriverKinds.td | 5 -----
lib/Driver/ArgList.cpp | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td
index 0a58d1f..35a84ae 100644
--- a/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/include/clang/Basic/DiagnosticCommonKinds.td
@@ -100,4 +100,11 @@ def err_file_modified : Error<
"file '%0' modified since it was first processed">, DefaultFatal;
def err_unsupported_bom : Error<"%0 byte order mark detected in '%1', but "
"encoding is not supported">, DefaultFatal;
+
+// Arg parsing
+def err_drv_missing_argument : Error<
+ "argument to '%0' is missing (expected %1 %plural{1:value|:values}1)">;
+def err_drv_unknown_argument : Error<"unknown argument: '%0'">;
+def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
+def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
}
diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td
index f3d9504..8113f9a 100644
--- a/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/include/clang/Basic/DiagnosticDriverKinds.td
@@ -41,8 +41,6 @@ def err_drv_command_failure : Error<
"unable to execute command: %0">;
def err_drv_invalid_darwin_version : Error<
"invalid Darwin version number: %0">;
-def err_drv_missing_argument : Error<
- "argument to '%0' is missing (expected %1 %plural{1:value|:values}1)">;
def err_drv_invalid_Xarch_argument_with_args : Error<
"invalid Xarch argument: '%0', options requiring arguments are unsupported">;
def err_drv_invalid_Xarch_argument_isdriver : Error<
@@ -74,9 +72,6 @@ def err_drv_invalid_libcxx_deployment : Error<
def err_drv_I_dash_not_supported : Error<
"'%0' not supported, please use -iquote instead">;
-def err_drv_unknown_argument : Error<"unknown argument: '%0'">;
-def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
-def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
def err_drv_invalid_remap_file : Error<
"invalid option '%0' not of the form <from-file>;<to-file>">;
def err_drv_invalid_gcc_output_type : Error<
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index d26da25..155bb9c 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -9,8 +9,8 @@
#include "clang/Driver/ArgList.h"
#include "clang/Driver/Arg.h"
-#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Option.h"
+#include "clang/Basic/Diagnostic.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
--
1.7.4.1
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits