Break almost all dependencies of Driver on Frontend

- Sink OutputFileMap{.h,.cpp} and ReferenceDependencyKeys.h to Basic
- Remove unnecessary includes of Frontend.h.
This commit is contained in:
Jordan Rose
2018-08-27 20:04:45 -07:00
parent 140ee562d3
commit e224e31720
18 changed files with 20 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
//===--- OutputFileMap.h - Driver output file map ---------------*- C++ -*-===//
//===--- OutputFileMap.h - Map of inputs to multiple outputs ----*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
@@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_DRIVER_OUTPUTFILEMAP_H
#define SWIFT_DRIVER_OUTPUTFILEMAP_H
#ifndef SWIFT_BASIC_OUTPUTFILEMAP_H
#define SWIFT_BASIC_OUTPUTFILEMAP_H
#include "swift/Basic/FileTypes.h"
#include "swift/Basic/LLVM.h"

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
@@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_FRONTENDTOOL_REFERENCEDEPENDENCYKEYS_H
#define SWIFT_FRONTENDTOOL_REFERENCEDEPENDENCYKEYS_H
#ifndef SWIFT_BASIC_REFERENCEDEPENDENCYKEYS_H
#define SWIFT_BASIC_REFERENCEDEPENDENCYKEYS_H
#include "swift/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"

View File

@@ -19,11 +19,11 @@
#include "swift/Basic/ArrayRefView.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Basic/Statistic.h"
#include "swift/Driver/Driver.h"
#include "swift/Driver/Job.h"
#include "swift/Driver/Util.h"
#include "swift/Frontend/OutputFileMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Chrono.h"

View File

@@ -21,9 +21,9 @@
#include "swift/Basic/FileTypes.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/OptionSet.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Basic/Sanitizers.h"
#include "swift/Driver/Util.h"
#include "swift/Frontend/OutputFileMap.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"

View File

@@ -15,9 +15,9 @@
#include "swift/Basic/FileTypes.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Driver/Action.h"
#include "swift/Driver/Util.h"
#include "swift/Frontend/OutputFileMap.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PointerIntPair.h"

View File

@@ -78,6 +78,7 @@ add_swift_library(swiftBasic STATIC
LangOptions.cpp
LLVMContext.cpp
Mangler.cpp
OutputFileMap.cpp
Platform.cpp
PrefixMap.cpp
PrettyStackTrace.cpp

View File

@@ -1,4 +1,4 @@
//===--- OutputFileMap.cpp - Driver output file map -----------------------===//
//===--- OutputFileMap.h - Map of inputs to multiple outputs --------------===//
//
// This source file is part of the Swift.org open source project
//
@@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//
#include "swift/Frontend/OutputFileMap.h"
#include "swift/Basic/OutputFileMap.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"

View File

@@ -14,6 +14,7 @@
#include "swift/AST/DiagnosticEngine.h"
#include "swift/AST/DiagnosticsDriver.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Basic/Program.h"
#include "swift/Basic/STLExtras.h"
#include "swift/Basic/Statistic.h"
@@ -26,7 +27,6 @@
#include "swift/Driver/Job.h"
#include "swift/Driver/ParseableOutput.h"
#include "swift/Driver/ToolChain.h"
#include "swift/Frontend/OutputFileMap.h"
#include "swift/Option/Options.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"

View File

@@ -16,12 +16,12 @@
#include "swift/Basic/LLVM.h"
#include "swift/Basic/Platform.h"
#include "swift/Basic/Range.h"
#include "swift/Basic/STLExtras.h"
#include "swift/Basic/TaskQueue.h"
#include "swift/Config.h"
#include "swift/Driver/Compilation.h"
#include "swift/Driver/Driver.h"
#include "swift/Driver/Job.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Option/Options.h"
#include "clang/Basic/Version.h"
#include "clang/Driver/Util.h"

View File

@@ -10,10 +10,10 @@
//
//===----------------------------------------------------------------------===//
#include "swift/Basic/ReferenceDependencyKeys.h"
#include "swift/Basic/Statistic.h"
#include "swift/Driver/DependencyGraph.h"
#include "swift/Demangling/Demangle.h"
#include "swift/Frontend/ReferenceDependencyKeys.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringSwitch.h"

View File

@@ -21,6 +21,7 @@
#include "swift/AST/DiagnosticsDriver.h"
#include "swift/AST/DiagnosticsFrontend.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Basic/Range.h"
#include "swift/Basic/Statistic.h"
#include "swift/Basic/TaskQueue.h"
@@ -31,7 +32,6 @@
#include "swift/Driver/Job.h"
#include "swift/Driver/PrettyStackTrace.h"
#include "swift/Driver/ToolChain.h"
#include "swift/Frontend/OutputFileMap.h"
#include "swift/Option/Options.h"
#include "swift/Option/SanitizerOptions.h"
#include "swift/Parse/Lexer.h"

View File

@@ -16,12 +16,12 @@
#include "swift/Basic/LLVM.h"
#include "swift/Basic/Platform.h"
#include "swift/Basic/Range.h"
#include "swift/Basic/STLExtras.h"
#include "swift/Basic/TaskQueue.h"
#include "swift/Config.h"
#include "swift/Driver/Compilation.h"
#include "swift/Driver/Driver.h"
#include "swift/Driver/Job.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Option/Options.h"
#include "clang/Basic/Version.h"
#include "clang/Driver/Util.h"

View File

@@ -21,7 +21,6 @@
#include "swift/Driver/Compilation.h"
#include "swift/Driver/Driver.h"
#include "swift/Driver/Job.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Option/Options.h"
#include "clang/Basic/Version.h"
#include "clang/Driver/Util.h"

View File

@@ -21,7 +21,6 @@
#include "swift/Driver/Compilation.h"
#include "swift/Driver/Driver.h"
#include "swift/Driver/Job.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Option/Options.h"
#include "clang/Basic/Version.h"
#include "clang/Driver/Util.h"

View File

@@ -14,9 +14,9 @@
#include "ArgsToFrontendInputsConverter.h"
#include "ArgsToFrontendOptionsConverter.h"
#include "swift/AST/DiagnosticsFrontend.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Basic/Platform.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Frontend/OutputFileMap.h"
#include "swift/Option/Options.h"
#include "swift/Option/SanitizerOptions.h"
#include "swift/Strings.h"

View File

@@ -7,7 +7,6 @@ add_swift_library(swiftFrontend STATIC
Frontend.cpp
FrontendInputsAndOutputs.cpp
FrontendOptions.cpp
OutputFileMap.cpp
PrintingDiagnosticConsumer.cpp
SerializedDiagnosticConsumer.cpp
DEPENDS

View File

@@ -23,8 +23,8 @@
#include "swift/AST/ReferencedNameTracker.h"
#include "swift/AST/Types.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/ReferenceDependencyKeys.h"
#include "swift/Frontend/FrontendOptions.h"
#include "swift/Frontend/ReferenceDependencyKeys.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"

View File

@@ -1,5 +1,5 @@
#include "swift/Basic/ReferenceDependencyKeys.h"
#include "swift/Driver/DependencyGraph.h"
#include "swift/Frontend/ReferenceDependencyKeys.h"
#include "gtest/gtest.h"
using namespace swift;