From fc360dc30be41b7ea941ae39fd8a847b6e0263c5 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 24 Feb 2015 04:25:59 +0000 Subject: Wrap clang module files in a Mach-O, ELF, or COFF container. This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. Take 3. llvm-svn: 230305 --- clang/lib/Serialization/ModuleManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clang/lib/Serialization/ModuleManager.cpp') diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index ac98ca0b872..8f1473f3a3a 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/lib/Serialization/ModuleManager.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/ModuleMap.h" +#include "clang/Serialization/ASTReader.h" #include "clang/Serialization/GlobalModuleIndex.h" #include "clang/Serialization/ModuleManager.h" #include "llvm/Support/MemoryBuffer.h" @@ -135,10 +136,10 @@ ModuleManager::addModule(StringRef FileName, ModuleKind Type, New->Buffer = std::move(*Buf); } - - // Initialize the stream - New->StreamFile.init((const unsigned char *)New->Buffer->getBufferStart(), - (const unsigned char *)New->Buffer->getBufferEnd()); + + // Initialize the stream. + ASTReader::InitStreamFileWithModule(New->Buffer->getMemBufferRef(), + New->StreamFile); } if (ExpectedSignature) { -- cgit v1.2.3