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/Frontend/ASTUnit.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/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 57c97d0c312..1bb5c3ff279 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -650,7 +650,7 @@ void ASTUnit::ConfigureDiags(IntrusiveRefCntPtr<DiagnosticsEngine> Diags, std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile( const std::string &Filename, - std::shared_ptr<PCHContainerOperations> PCHContainerOps, + const PCHContainerReader &PCHContainerRdr, IntrusiveRefCntPtr<DiagnosticsEngine> Diags, const FileSystemOptions &FileSystemOpts, bool OnlyLocalDecls, ArrayRef<RemappedFile> RemappedFiles, bool CaptureDiagnostics, @@ -676,7 +676,7 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile( AST->getFileManager(), UserFilesAreVolatile); AST->HSOpts = new HeaderSearchOptions(); - + AST->HSOpts->ModuleFormat = PCHContainerRdr.getFormat(); AST->HeaderInfo.reset(new HeaderSearch(AST->HSOpts, AST->getSourceManager(), AST->getDiagnostics(), @@ -708,7 +708,7 @@ std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile( bool disableValid = false; if (::getenv("LIBCLANG_DISABLE_PCH_VALIDATION")) disableValid = true; - AST->Reader = new ASTReader(PP, Context, *PCHContainerOps, + AST->Reader = new ASTReader(PP, Context, PCHContainerRdr, /*isysroot=*/"", /*DisableValidation=*/disableValid, AllowPCHWithCompilerErrors); |