Sketch .td file and build system goop for OptTable based clang-cc options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89330 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Driver/CC1Options.h b/include/clang/Driver/CC1Options.h
new file mode 100644
index 0000000..057022c
--- /dev/null
+++ b/include/clang/Driver/CC1Options.h
@@ -0,0 +1,34 @@
+//===--- CC1Options.h - Clang CC1 Options Table -----------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_DRIVER_CC1OPTIONS_H
+#define CLANG_DRIVER_CC1OPTIONS_H
+
+namespace clang {
+namespace driver {
+  class OptTable;
+
+namespace cc1options {
+  enum ID {
+    OPT_INVALID = 0, // This is not an option ID.
+    OPT_INPUT,       // Reserved ID for input option.
+    OPT_UNKNOWN,     // Reserved ID for unknown option.
+#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \
+               HELPTEXT, METAVAR) OPT_##ID,
+#include "clang/Driver/CC1Options.inc"
+    LastOption
+#undef OPTION
+  };
+}
+
+  OptTable *createCC1OptTable();
+}
+}
+
+#endif
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
new file mode 100644
index 0000000..ef8d847
--- /dev/null
+++ b/include/clang/Driver/CC1Options.td
@@ -0,0 +1,26 @@
+//===--- CC1Options.td - Options for clang -cc1 ---------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file defines the options accepted by clang -cc1.
+//
+//===----------------------------------------------------------------------===//
+
+// Include the common option parsing interfaces.
+include "OptParser.td"
+
+// Target Options
+
+def target_abi : Separate<"-target-abi">,
+  HelpText<"Target a particular ABI type">;
+def target_cpu : Separate<"-mcpu">,
+  HelpText<"Target a specific cpu type (-mcpu=help for details)">;
+def target_features : Separate<"-target-feature">,
+  HelpText<"Target specific attributes">;
+def target_triple : Separate<"-triple">,
+  HelpText<"Specify target triple (e.g. i686-apple-darwin9)">;
diff --git a/include/clang/Driver/CMakeLists.txt b/include/clang/Driver/CMakeLists.txt
index 18b291c..f720d15 100644
--- a/include/clang/Driver/CMakeLists.txt
+++ b/include/clang/Driver/CMakeLists.txt
@@ -3,3 +3,9 @@
          -gen-opt-parser-defs)
 add_custom_target(ClangDriverOptions
   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Options.inc)
+
+set(LLVM_TARGET_DEFINITIONS CC1Options.td)
+tablegen(CC1Options.inc
+         -gen-opt-parser-defs)
+add_custom_target(ClangCC1Options
+  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/CC1Options.inc)
diff --git a/include/clang/Driver/Makefile b/include/clang/Driver/Makefile
index d263fbe..c0f2cc7 100644
--- a/include/clang/Driver/Makefile
+++ b/include/clang/Driver/Makefile
@@ -1,5 +1,5 @@
 LEVEL = ../../../../..
-BUILT_SOURCES = Options.inc
+BUILT_SOURCES = Options.inc CC1Options.inc
 
 TABLEGEN_INC_FILES_COMMON = 1
 
@@ -9,4 +9,8 @@
 	$(Echo) "Building Clang Driver Option tables with tblgen"
 	$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
 
+$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(ObjDir)/.dir
+	$(Echo) "Building Clang CC1 Option tables with tblgen"
+	$(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $<
+