diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-02-24 04:25:59 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-02-24 04:25:59 +0000 |
commit | fc360dc30be41b7ea941ae39fd8a847b6e0263c5 (patch) | |
tree | a1ff1d6476ea33713c9ed4d5e18575690322f9d5 /clang/lib/Serialization/ModuleManager.cpp | |
parent | c109102ecb80c06375688d374fdc17c04cd7d562 (diff) | |
download | llvm-fc360dc30be41b7ea941ae39fd8a847b6e0263c5.zip llvm-fc360dc30be41b7ea941ae39fd8a847b6e0263c5.tar.gz llvm-fc360dc30be41b7ea941ae39fd8a847b6e0263c5.tar.bz2 |
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
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r-- | clang/lib/Serialization/ModuleManager.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index ac98ca0..8f1473f 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) { |