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/ARCMigrate | |
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/ARCMigrate')
-rw-r--r-- | clang/lib/ARCMigrate/ARCMT.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index f33ad21cf02..e3288421859 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/lib/ARCMigrate/ARCMT.cpp @@ -167,7 +167,7 @@ static bool HasARCRuntime(CompilerInvocation &origCI) { static CompilerInvocation * createInvocationForMigration(CompilerInvocation &origCI, - const PCHContainerOperations &PCHContainerOps) { + const PCHContainerReader &PCHContainerRdr) { std::unique_ptr<CompilerInvocation> CInvok; CInvok.reset(new CompilerInvocation(origCI)); PreprocessorOptions &PPOpts = CInvok->getPreprocessorOpts(); @@ -180,7 +180,7 @@ createInvocationForMigration(CompilerInvocation &origCI, new DiagnosticsEngine(DiagID, &origCI.getDiagnosticOpts(), new IgnoringDiagConsumer())); std::string OriginalFile = ASTReader::getOriginalSourceFile( - PPOpts.ImplicitPCHInclude, FileMgr, PCHContainerOps, *Diags); + PPOpts.ImplicitPCHInclude, FileMgr, PCHContainerRdr, *Diags); if (!OriginalFile.empty()) PPOpts.Includes.insert(PPOpts.Includes.begin(), OriginalFile); PPOpts.ImplicitPCHInclude.clear(); @@ -247,7 +247,8 @@ bool arcmt::checkForManualIssues( assert(!transforms.empty()); std::unique_ptr<CompilerInvocation> CInvok; - CInvok.reset(createInvocationForMigration(origCI, *PCHContainerOps)); + CInvok.reset( + createInvocationForMigration(origCI, PCHContainerOps->getRawReader())); CInvok->getFrontendOpts().Inputs.clear(); CInvok->getFrontendOpts().Inputs.push_back(Input); @@ -517,7 +518,8 @@ MigrationProcess::MigrationProcess( bool MigrationProcess::applyTransform(TransformFn trans, RewriteListener *listener) { std::unique_ptr<CompilerInvocation> CInvok; - CInvok.reset(createInvocationForMigration(OrigCI, *PCHContainerOps)); + CInvok.reset( + createInvocationForMigration(OrigCI, PCHContainerOps->getRawReader())); CInvok->getDiagnosticOpts().IgnoreWarnings = true; Remapper.applyMappings(CInvok->getPreprocessorOpts()); |