summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-07-17 16:54:06 +0000
committerHans Wennborg <hans@hanshq.net>2013-07-17 16:54:06 +0000
commitfb624ce8857024488286a1bb7556a59299565ca2 (patch)
treef8e2e81073edb855e05c0a13922cf1382b8b76fa
parent43b4773a205fae17ef4bb1fecc2d297e310b3233 (diff)
downloadbcm5719-llvm-fb624ce8857024488286a1bb7556a59299565ca2.tar.gz
bcm5719-llvm-fb624ce8857024488286a1bb7556a59299565ca2.zip
Option parsing tables: remove some unnecessary #defines
Also make some strings static and add missing #undef's llvm-svn: 186518
-rw-r--r--clang/include/clang/Driver/CC1AsOptions.h2
-rw-r--r--clang/include/clang/Driver/Options.h2
-rw-r--r--clang/lib/Driver/CC1AsOptions.cpp7
-rw-r--r--clang/lib/Driver/DriverOptions.cpp7
4 files changed, 4 insertions, 14 deletions
diff --git a/clang/include/clang/Driver/CC1AsOptions.h b/clang/include/clang/Driver/CC1AsOptions.h
index 7ce2525272a..6d748488af7 100644
--- a/clang/include/clang/Driver/CC1AsOptions.h
+++ b/clang/include/clang/Driver/CC1AsOptions.h
@@ -22,13 +22,11 @@ namespace driver {
namespace cc1asoptions {
enum ID {
OPT_INVALID = 0, // This is not an option ID.
-#define PREFIX(NAME, VALUE)
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
HELPTEXT, METAVAR) OPT_##ID,
#include "clang/Driver/CC1AsOptions.inc"
LastOption
#undef OPTION
-#undef PREFIX
};
}
diff --git a/clang/include/clang/Driver/Options.h b/clang/include/clang/Driver/Options.h
index 650e8e75a6f..1186c8489e4 100644
--- a/clang/include/clang/Driver/Options.h
+++ b/clang/include/clang/Driver/Options.h
@@ -34,13 +34,11 @@ enum ClangFlags {
enum ID {
OPT_INVALID = 0, // This is not an option ID.
-#define PREFIX(NAME, VALUE)
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
HELPTEXT, METAVAR) OPT_##ID,
#include "clang/Driver/Options.inc"
LastOption
#undef OPTION
-#undef PREFIX
};
}
diff --git a/clang/lib/Driver/CC1AsOptions.cpp b/clang/lib/Driver/CC1AsOptions.cpp
index 62c3afbb36c..eb5776d5067 100644
--- a/clang/lib/Driver/CC1AsOptions.cpp
+++ b/clang/lib/Driver/CC1AsOptions.cpp
@@ -16,20 +16,17 @@ using namespace clang::driver;
using namespace llvm::opt;
using namespace clang::driver::cc1asoptions;
-#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
-#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
- HELPTEXT, METAVAR)
+#define PREFIX(NAME, VALUE) static const char *const NAME[] = VALUE;
#include "clang/Driver/CC1AsOptions.inc"
-#undef OPTION
#undef PREFIX
static const OptTable::Info CC1AsInfoTable[] = {
-#define PREFIX(NAME, VALUE)
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
HELPTEXT, METAVAR) \
{ PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \
FLAGS, OPT_##GROUP, OPT_##ALIAS },
#include "clang/Driver/CC1AsOptions.inc"
+#undef OPTION
};
namespace {
diff --git a/clang/lib/Driver/DriverOptions.cpp b/clang/lib/Driver/DriverOptions.cpp
index 39787350cf0..95518ee48b5 100644
--- a/clang/lib/Driver/DriverOptions.cpp
+++ b/clang/lib/Driver/DriverOptions.cpp
@@ -16,20 +16,17 @@ using namespace clang::driver;
using namespace clang::driver::options;
using namespace llvm::opt;
-#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
-#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
- HELPTEXT, METAVAR)
+#define PREFIX(NAME, VALUE) static const char *const NAME[] = VALUE;
#include "clang/Driver/Options.inc"
-#undef OPTION
#undef PREFIX
static const OptTable::Info InfoTable[] = {
-#define PREFIX(NAME, VALUE)
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
HELPTEXT, METAVAR) \
{ PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \
FLAGS, OPT_##GROUP, OPT_##ALIAS },
#include "clang/Driver/Options.inc"
+#undef OPTION
};
namespace {
OpenPOWER on IntegriCloud