mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "Adapt for Mach-O clang module container format transition."
This reverts commit 25995 (this commit was missing a few LLVM libraries). Swift SVN r26020
This commit is contained in:
@@ -45,7 +45,6 @@ add_swift_library(swiftAST
|
||||
clangToolingCore
|
||||
clangFrontendTool
|
||||
clangFrontend
|
||||
clangCodeGen
|
||||
clangDriver
|
||||
clangSerialization
|
||||
clangParse
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "clang/Basic/Module.h"
|
||||
#include "clang/Basic/TargetInfo.h"
|
||||
#include "clang/Basic/Version.h"
|
||||
#include "clang/CodeGen/LLVMModuleProvider.h"
|
||||
#include "clang/Frontend/FrontendActions.h"
|
||||
#include "clang/Frontend/Utils.h"
|
||||
#include "clang/Serialization/ASTReader.h"
|
||||
@@ -405,8 +404,7 @@ ClangImporter::create(ASTContext &ctx,
|
||||
sourceBuffer.release());
|
||||
|
||||
// Create a compiler instance.
|
||||
importer->Impl.Instance.reset(new CompilerInstance(
|
||||
clang::SharedModuleProvider::Create<clang::LLVMModuleProvider>()));
|
||||
importer->Impl.Instance.reset(new CompilerInstance);
|
||||
auto &instance = *importer->Impl.Instance;
|
||||
instance.setDiagnostics(&*clangDiags);
|
||||
instance.setInvocation(&*invocation);
|
||||
@@ -605,8 +603,7 @@ std::string ClangImporter::getBridgingHeaderContents(StringRef headerPath,
|
||||
|
||||
invocation->getPreprocessorOpts().resetNonModularOptions();
|
||||
|
||||
clang::CompilerInstance rewriteInstance(
|
||||
Impl.Instance->getSharedModuleProvider());
|
||||
clang::CompilerInstance rewriteInstance;
|
||||
rewriteInstance.setInvocation(&*invocation);
|
||||
rewriteInstance.createDiagnostics(new clang::IgnoringDiagConsumer);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ add_swift_executable(lldb-moduleimport-test
|
||||
LINK_LIBRARIES
|
||||
swiftASTSectionImporter swiftFrontend swiftClangImporter
|
||||
COMPONENT_DEPENDS
|
||||
bitreader bitwriter ipo objcarcopts option support ${LLVM_TARGETS_TO_BUILD})
|
||||
bitreader bitwriter option support ${LLVM_TARGETS_TO_BUILD})
|
||||
|
||||
swift_install_in_component(testsuite-tools
|
||||
TARGETS lldb-moduleimport-test
|
||||
|
||||
@@ -34,6 +34,27 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
static llvm::cl::list<std::string>
|
||||
InputNames(llvm::cl::Positional, llvm::cl::desc("compiled_swift_file1.o ..."),
|
||||
llvm::cl::OneOrMore);
|
||||
|
||||
static llvm::cl::opt<std::string>
|
||||
SDK("sdk", llvm::cl::desc("path to the SDK to build against"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
DumpModule("dump-module",
|
||||
llvm::cl::desc("Dump the imported module after checking it imports just fine"));
|
||||
|
||||
static llvm::cl::opt<std::string>
|
||||
ModuleCachePath("module-cache-path", llvm::cl::desc("Clang module cache path"));
|
||||
|
||||
static llvm::cl::list<std::string>
|
||||
ImportPaths("I", llvm::cl::desc("add a directory to the import search path"));
|
||||
|
||||
static llvm::cl::list<std::string>
|
||||
FrameworkPaths("F", llvm::cl::desc("add a directory to the framework search path"));
|
||||
|
||||
|
||||
void anchorForGetMainExecutable() {}
|
||||
|
||||
using namespace llvm::MachO;
|
||||
@@ -59,37 +80,7 @@ static void printValidationInfo(llvm::StringRef data) {
|
||||
int main(int argc, char **argv) {
|
||||
llvm::sys::PrintStackTraceOnErrorSignal();
|
||||
llvm::PrettyStackTraceProgram ST(argc, argv);
|
||||
|
||||
// Command line handling.
|
||||
llvm::cl::list<std::string> InputNames(
|
||||
llvm::cl::Positional, llvm::cl::desc("compiled_swift_file1.o ..."),
|
||||
llvm::cl::OneOrMore);
|
||||
|
||||
llvm::cl::opt<std::string> SDK(
|
||||
"sdk", llvm::cl::desc("path to the SDK to build against"));
|
||||
|
||||
llvm::cl::opt<bool> DumpModule(
|
||||
"dump-module", llvm::cl::desc(
|
||||
"Dump the imported module after checking it imports just fine"));
|
||||
|
||||
llvm::cl::opt<std::string> ModuleCachePath(
|
||||
"module-cache-path", llvm::cl::desc("Clang module cache path"));
|
||||
|
||||
llvm::cl::list<std::string> ImportPaths(
|
||||
"I", llvm::cl::desc("add a directory to the import search path"));
|
||||
|
||||
llvm::cl::list<std::string> FrameworkPaths(
|
||||
"F", llvm::cl::desc("add a directory to the framework search path"));
|
||||
|
||||
llvm::cl::ParseCommandLineOptions(argc, argv);
|
||||
// Unregister our options so they don't interfere with the command line
|
||||
// parsing in CodeGen/BackendUtil.cpp.
|
||||
FrameworkPaths.removeArgument();
|
||||
ImportPaths.removeArgument();
|
||||
ModuleCachePath.removeArgument();
|
||||
DumpModule.removeArgument();
|
||||
SDK.removeArgument();
|
||||
InputNames.removeArgument();
|
||||
|
||||
// If no SDK was specified via -sdk, check environment variable SDKROOT.
|
||||
if (SDK.getNumOccurrences() == 0) {
|
||||
|
||||
@@ -7,7 +7,7 @@ add_swift_executable(sil-extract
|
||||
swiftSerialization
|
||||
swiftClangImporter
|
||||
COMPONENT_DEPENDS
|
||||
option bitreader bitwriter ipo objcarcopts support ${LLVM_TARGETS_TO_BUILD})
|
||||
option bitreader bitwriter support ${LLVM_TARGETS_TO_BUILD})
|
||||
|
||||
swift_install_in_component(tools
|
||||
TARGETS sil-extract
|
||||
|
||||
@@ -6,7 +6,7 @@ add_swift_executable(sil-opt
|
||||
swiftSILGen
|
||||
swiftSILPasses
|
||||
COMPONENT_DEPENDS
|
||||
option bitreader bitwriter ipo objcarcopts support ${LLVM_TARGETS_TO_BUILD})
|
||||
option bitreader bitwriter support ${LLVM_TARGETS_TO_BUILD})
|
||||
|
||||
swift_install_in_component(tools
|
||||
TARGETS sil-opt
|
||||
|
||||
@@ -7,8 +7,7 @@ add_swift_executable(swift-ide-test
|
||||
swiftFrontend
|
||||
swiftIDE
|
||||
COMPONENT_DEPENDS
|
||||
bitreader bitwriter ipo objcarcopts transformutils option support
|
||||
${LLVM_TARGETS_TO_BUILD})
|
||||
bitreader bitwriter transformutils option support ${LLVM_TARGETS_TO_BUILD})
|
||||
|
||||
# If libxml2 is available, make it available for swift-ide-test.
|
||||
if(SWIFT_HAVE_LIBXML)
|
||||
|
||||
Reference in New Issue
Block a user