Relocate Mach-O AST section parsing from SerializedModuleLoader/ to ASTSectionImporter/.

Swift SVN r7869
This commit is contained in:
Adrian Prantl
2013-09-03 21:56:53 +00:00
parent e622720b4b
commit 2063a27aea
12 changed files with 160 additions and 79 deletions

View File

@@ -17,7 +17,7 @@
//===----------------------------------------------------------------------===//
#include "swift/Frontend/Frontend.h"
#include "swift/Serialization/SerializedModuleLoader.h"
#include "swift/ASTSectionImporter/ASTSectionImporter.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/PrettyStackTrace.h"
@@ -100,8 +100,9 @@ int main(int argc, char **argv) {
// Pass the __apple_AST section to the module loader.
auto data = llvm::MemoryBuffer::getNewMemBuffer(section.size, name);
macho.read(const_cast<char *>(data->getBufferStart()), section.size);
if (!CI.getSerializedModuleLoader()->addASTSection
(std::unique_ptr<llvm::MemoryBuffer>(data), modules))
if (!parseASTSection(CI.getSerializedModuleLoader(),
std::unique_ptr<llvm::MemoryBuffer>(data),
modules))
exit(1);
for (auto path : modules)