summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-06-20 18:53:08 +0000
committerAdrian Prantl <aprantl@apple.com>2015-06-20 18:53:08 +0000
commitbb165fb04db511d0f6927133662b74943f76cc39 (patch)
tree5c8150e9096c41f7a426c704aa4762e6420cd28e /clang/lib/Frontend/FrontendAction.cpp
parent6ed81cbcdb6e5f07f6ac71a446d970c2db8945a5 (diff)
downloadbcm5719-llvm-bb165fb04db511d0f6927133662b74943f76cc39.tar.gz
bcm5719-llvm-bb165fb04db511d0f6927133662b74943f76cc39.zip
Introduce a PCHContainerOperations interface (NFC).
A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r--clang/lib/Frontend/FrontendAction.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index 9bba75541ff..db9dd3b0988 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -191,7 +191,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics());
std::unique_ptr<ASTUnit> AST =
- ASTUnit::LoadFromASTFile(InputFile, Diags, CI.getFileSystemOpts());
+ ASTUnit::LoadFromASTFile(InputFile, CI.getPCHContainerOperations(),
+ Diags, CI.getFileSystemOpts());
if (!AST)
goto failure;
@@ -271,11 +272,10 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
for (llvm::sys::fs::directory_iterator Dir(DirNative, EC), DirEnd;
Dir != DirEnd && !EC; Dir.increment(EC)) {
// Check whether this is an acceptable AST file.
- if (ASTReader::isAcceptableASTFile(Dir->path(), FileMgr,
- CI.getLangOpts(),
- CI.getTargetOpts(),
- CI.getPreprocessorOpts(),
- SpecificModuleCachePath)) {
+ if (ASTReader::isAcceptableASTFile(
+ Dir->path(), FileMgr, *CI.getPCHContainerOperations(),
+ CI.getLangOpts(), CI.getTargetOpts(), CI.getPreprocessorOpts(),
+ SpecificModuleCachePath)) {
PPOpts.ImplicitPCHInclude = Dir->path();
Found = true;
break;
@@ -443,8 +443,8 @@ bool FrontendAction::Execute() {
if (CI.shouldBuildGlobalModuleIndex() && CI.hasFileManager() &&
CI.hasPreprocessor()) {
GlobalModuleIndex::writeIndex(
- CI.getFileManager(),
- CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath());
+ CI.getFileManager(), *CI.getPCHContainerOperations(),
+ CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath());
}
return true;
OpenPOWER on IntegriCloud