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 2.

llvm-svn: 230089
This commit is contained in:
Adrian Prantl
2015-02-20 23:34:26 +00:00
parent 1f3e5c195c
commit f2b0cd91eb
33 changed files with 399 additions and 65 deletions

View File

@@ -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) {