diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-09-18 22:10:59 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-09-18 22:10:59 +0000 |
commit | 0391406e9501d233b6a879c909790504194ca075 (patch) | |
tree | 70dbae9d87eaed69590d07cde98c8fec832c034e /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | |
parent | e0e0796d83c3c5c15b90fe78d11352aa9cbc8ccc (diff) | |
download | bcm5719-llvm-0391406e9501d233b6a879c909790504194ca075.tar.gz bcm5719-llvm-0391406e9501d233b6a879c909790504194ca075.zip |
Simplify the interface of PCHContainerGenerator and friends
by passing in a CompilerInstance instead of all its individual members.
NFC.
llvm-svn: 248053
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r-- | clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index b16544e2e12..b78005ce8f2 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -18,6 +18,7 @@ #include "clang/Basic/TargetInfo.h" #include "clang/CodeGen/BackendUtil.h" #include "clang/Frontend/CodeGenOptions.h" +#include "clang/Frontend/CompilerInstance.h" #include "clang/Serialization/ASTWriter.h" #include "llvm/ADT/StringRef.h" #include "llvm/Bitcode/BitstreamReader.h" @@ -115,15 +116,15 @@ class PCHContainerGenerator : public ASTConsumer { }; public: - PCHContainerGenerator(DiagnosticsEngine &diags, - const HeaderSearchOptions &HSO, - const PreprocessorOptions &PPO, const TargetOptions &TO, - const LangOptions &LO, const std::string &MainFileName, + PCHContainerGenerator(DiagnosticsEngine &diags, const CompilerInstance &CI, + const std::string &MainFileName, const std::string &OutputFileName, raw_pwrite_stream *OS, std::shared_ptr<PCHBuffer> Buffer) - : Diags(diags), Ctx(nullptr), HeaderSearchOpts(HSO), PreprocessorOpts(PPO), - TargetOpts(TO), LangOpts(LO), OS(OS), Buffer(Buffer) { + : Diags(diags), Ctx(nullptr), HeaderSearchOpts(CI.getHeaderSearchOpts()), + PreprocessorOpts(CI.getPreprocessorOpts()), + TargetOpts(CI.getTargetOpts()), LangOpts(CI.getLangOpts()), OS(OS), + Buffer(Buffer) { // The debug info output isn't affected by CodeModel and // ThreadModel, but the backend expects them to be nonempty. CodeGenOpts.CodeModel = "default"; @@ -252,13 +253,11 @@ public: std::unique_ptr<ASTConsumer> ObjectFilePCHContainerWriter::CreatePCHContainerGenerator( - DiagnosticsEngine &Diags, const HeaderSearchOptions &HSO, - const PreprocessorOptions &PPO, const TargetOptions &TO, - const LangOptions &LO, const std::string &MainFileName, - const std::string &OutputFileName, llvm::raw_pwrite_stream *OS, - std::shared_ptr<PCHBuffer> Buffer) const { - return llvm::make_unique<PCHContainerGenerator>( - Diags, HSO, PPO, TO, LO, MainFileName, OutputFileName, OS, Buffer); + DiagnosticsEngine &Diags, const CompilerInstance &CI, + const std::string &MainFileName, const std::string &OutputFileName, + llvm::raw_pwrite_stream *OS, std::shared_ptr<PCHBuffer> Buffer) const { + return llvm::make_unique<PCHContainerGenerator>(Diags, CI, MainFileName, + OutputFileName, OS, Buffer); } void ObjectFilePCHContainerReader::ExtractPCH( |