Moved Swift's option table from swiftDriver into a new swiftOption library.

This allows swiftFrontend to drop its dependency on swiftDriver, and could
someday allow us to move the integrated frontend's option parsing out of
swiftFrontend (which would allow other tools which use swiftFrontend to
exclude the option table entirely).

Swift SVN r19824
This commit is contained in:
Connor Wakamo
2014-07-10 20:51:50 +00:00
parent cf14fefd3c
commit 2d6c9e9062
15 changed files with 20 additions and 17 deletions

View File

@@ -1 +1 @@
add_subdirectory(Driver)
add_subdirectory(Option)

View File

@@ -1,3 +1,3 @@
set(LLVM_TARGET_DEFINITIONS Options.td)
tablegen(LLVM Options.inc -gen-opt-parser-defs)
add_public_tablegen_target(SwiftDriverOptions)
add_public_tablegen_target(SwiftOptions)

View File

@@ -35,7 +35,7 @@ namespace options {
OPT_INVALID = 0, // This is not an option ID.
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
HELPTEXT, METAVAR) OPT_##ID,
#include "swift/Driver/Options.inc"
#include "swift/Option/Options.inc"
LastOption
#undef OPTION
};

View File

@@ -9,6 +9,7 @@ add_subdirectory(IDE)
add_subdirectory(Immediate)
add_subdirectory(IRGen)
add_subdirectory(OptimizeARC)
add_subdirectory(Option)
add_subdirectory(Parse)
add_subdirectory(PrintAsObjC)
add_subdirectory(ReST)

View File

@@ -3,7 +3,6 @@ add_swift_library(swiftDriver
Compilation.cpp
Driver.cpp
Job.cpp
Options.cpp
OutputFileMap.cpp
Tool.cpp
Tools.cpp
@@ -11,6 +10,4 @@ add_swift_library(swiftDriver
ToolChains.cpp
Types.cpp
Util.cpp
DEPENDS swiftAST swiftBasic)
add_dependencies(swiftDriver SwiftDriverOptions)
DEPENDS swiftAST swiftBasic swiftOption)

View File

@@ -30,9 +30,9 @@
#include "swift/Driver/Action.h"
#include "swift/Driver/Compilation.h"
#include "swift/Driver/Job.h"
#include "swift/Driver/Options.h"
#include "swift/Driver/OutputFileMap.h"
#include "swift/Driver/ToolChain.h"
#include "swift/Option/Options.h"
#include "swift/Parse/Lexer.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"

View File

@@ -19,9 +19,9 @@
#include "swift/Basic/Range.h"
#include "swift/Driver/Driver.h"
#include "swift/Driver/Job.h"
#include "swift/Driver/Options.h"
#include "swift/Frontend/Frontend.h"
#include "clang/Driver/Util.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Option/Options.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"

View File

@@ -6,4 +6,4 @@ add_swift_library(swiftFrontend
FrontendOptions.cpp
PrintingDiagnosticConsumer.cpp
SerializedDiagnosticConsumer.cpp
DEPENDS swiftAST swiftDriver swiftParse swiftSema swiftSerialization swiftSIL)
DEPENDS swiftAST swiftOption swiftParse swiftSema swiftSerialization swiftSIL)

View File

@@ -15,7 +15,7 @@
#include "swift/Strings.h"
#include "swift/AST/DiagnosticsFrontend.h"
#include "swift/Basic/Platform.h"
#include "swift/Driver/Options.h"
#include "swift/Option/Options.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Option/Arg.h"

View File

@@ -0,0 +1,5 @@
add_swift_library(swiftOption
Options.cpp
DEPENDS swiftBasic)
add_dependencies(swiftOption SwiftOptions)

View File

@@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//
#include "swift/Driver/Options.h"
#include "swift/Option/Options.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Option/OptTable.h"
@@ -21,7 +21,7 @@ using namespace swift::driver::options;
using namespace llvm::opt;
#define PREFIX(NAME, VALUE) static const char *const NAME[] = VALUE;
#include "swift/Driver/Options.inc"
#include "swift/Option/Options.inc"
#undef PREFIX
static const OptTable::Info InfoTable[] = {
@@ -29,7 +29,7 @@ static const OptTable::Info InfoTable[] = {
HELPTEXT, METAVAR) \
{ PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \
FLAGS, OPT_##GROUP, OPT_##ALIAS, ALIASARGS },
#include "swift/Driver/Options.inc"
#include "swift/Option/Options.inc"
#undef OPTION
};

View File

@@ -3,7 +3,7 @@ add_swift_executable(swift
frontend_main.cpp
DEPENDS swiftDriver swiftIRGen swiftSIL swiftSILGen swiftSILPasses swiftImmediate
swiftSerialization swiftFrontend swiftClangImporter swiftIDE
swiftPrintAsObjC
swiftPrintAsObjC swiftOption
COMPONENT_DEPENDS bitreader bitwriter codegen ipo jit linker mcjit asmparser
selectiondag ${LLVM_TARGETS_TO_BUILD})

View File

@@ -21,13 +21,13 @@
#include "swift/AST/DiagnosticsFrontend.h"
#include "swift/AST/IRGenOptions.h"
#include "swift/Basic/SourceManager.h"
#include "swift/Driver/Options.h"
#include "swift/Frontend/DependencyFileGenerator.h"
#include "swift/Frontend/DiagnosticVerifier.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Frontend/PrintingDiagnosticConsumer.h"
#include "swift/Frontend/SerializedDiagnosticConsumer.h"
#include "swift/Immediate/Immediate.h"
#include "swift/Option/Options.h"
#include "swift/PrintAsObjC/PrintAsObjC.h"
#include "swift/SILPasses/Passes.h"
#include "llvm/ADT/Statistic.h"