diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-07-17 01:19:54 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-07-17 01:19:54 +0000 |
commit | fb2398d0c43405a6b654c80560e38fb3ccd134b9 (patch) | |
tree | e1a0f288169e920a3ac6d9f2aaece67eb7796bf1 /clang/lib/Serialization/GlobalModuleIndex.cpp | |
parent | cabe02e14110526189a0935d172f8547f0232572 (diff) | |
download | bcm5719-llvm-fb2398d0c43405a6b654c80560e38fb3ccd134b9.tar.gz bcm5719-llvm-fb2398d0c43405a6b654c80560e38fb3ccd134b9.zip |
Make the clang module container format selectable from the command line.
- introduces a new cc1 option -fmodule-format=[raw,obj]
with 'raw' being the default
- supports arbitrary module container formats that libclang is agnostic to
- adds the format to the module hash to avoid collisions
- splits the old PCHContainerOperations into PCHContainerWriter and
a PCHContainerReader.
Thanks to Richard Smith for reviewing this patch!
llvm-svn: 242499
Diffstat (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 2c7da3e82a4..17c7914243e 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -385,7 +385,7 @@ namespace { /// \brief Builder that generates the global module index file. class GlobalModuleIndexBuilder { FileManager &FileMgr; - const PCHContainerOperations &PCHContainerOps; + const PCHContainerReader &PCHContainerRdr; /// \brief Mapping from files to module file information. typedef llvm::MapVector<const FileEntry *, ModuleFileInfo> ModuleFilesMap; @@ -419,8 +419,8 @@ namespace { public: explicit GlobalModuleIndexBuilder( - FileManager &FileMgr, const PCHContainerOperations &PCHContainerOps) - : FileMgr(FileMgr), PCHContainerOps(PCHContainerOps) {} + FileManager &FileMgr, const PCHContainerReader &PCHContainerRdr) + : FileMgr(FileMgr), PCHContainerRdr(PCHContainerRdr) {} /// \brief Load the contents of the given module file into the builder. /// @@ -505,7 +505,7 @@ bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) { // Initialize the input stream llvm::BitstreamReader InStreamFile; - PCHContainerOps.ExtractPCH((*Buffer)->getMemBufferRef(), InStreamFile); + PCHContainerRdr.ExtractPCH((*Buffer)->getMemBufferRef(), InStreamFile); llvm::BitstreamCursor InStream(InStreamFile); // Sniff for the signature. @@ -768,7 +768,7 @@ void GlobalModuleIndexBuilder::writeIndex(llvm::BitstreamWriter &Stream) { GlobalModuleIndex::ErrorCode GlobalModuleIndex::writeIndex(FileManager &FileMgr, - const PCHContainerOperations &PCHContainerOps, + const PCHContainerReader &PCHContainerRdr, StringRef Path) { llvm::SmallString<128> IndexPath; IndexPath += Path; @@ -792,7 +792,7 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr, } // The module index builder. - GlobalModuleIndexBuilder Builder(FileMgr, PCHContainerOps); + GlobalModuleIndexBuilder Builder(FileMgr, PCHContainerRdr); // Load each of the module files. std::error_code EC; |