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/Lex/HeaderSearch.cpp | |
parent | cabe02e14110526189a0935d172f8547f0232572 (diff) | |
download | llvm-fb2398d0c43405a6b654c80560e38fb3ccd134b9.zip llvm-fb2398d0c43405a6b654c80560e38fb3ccd134b9.tar.gz llvm-fb2398d0c43405a6b654c80560e38fb3ccd134b9.tar.bz2 |
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/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index b805990..983dc18 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -14,6 +14,7 @@ #include "clang/Lex/HeaderSearch.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/IdentifierTable.h" +#include "clang/Frontend/PCHContainerOperations.h" #include "clang/Lex/ExternalPreprocessorSource.h" #include "clang/Lex/HeaderMap.h" #include "clang/Lex/HeaderSearchOptions.h" @@ -151,7 +152,8 @@ std::string HeaderSearch::getModuleFileName(StringRef ModuleName, auto FileName = llvm::sys::path::filename(ModuleMapPath); llvm::hash_code Hash = - llvm::hash_combine(DirName.lower(), FileName.lower()); + llvm::hash_combine(DirName.lower(), FileName.lower(), + HSOpts->ModuleFormat); SmallString<128> HashStr; llvm::APInt(64, size_t(Hash)).toStringUnsigned(HashStr, /*Radix*/36); |