diff options
Diffstat (limited to 'include/clang/Frontend/FrontendActions.h')
-rw-r--r-- | include/clang/Frontend/FrontendActions.h | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h index ba1dbb8f23..72a3d90847 100644 --- a/include/clang/Frontend/FrontendActions.h +++ b/include/clang/Frontend/FrontendActions.h @@ -67,40 +67,22 @@ protected: }; class GeneratePCHAction : public ASTFrontendAction { + bool MakeModule; + protected: virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, StringRef InFile); virtual TranslationUnitKind getTranslationUnitKind() { - return TU_Prefix; + return MakeModule? TU_Module : TU_Prefix; } virtual bool hasASTFileSupport() const { return false; } public: - /// \brief Compute the AST consumer arguments that will be used to - /// create the PCHGenerator instance returned by CreateASTConsumer. - /// - /// \returns true if an error occurred, false otherwise. - static bool ComputeASTConsumerArguments(CompilerInstance &CI, - StringRef InFile, - std::string &Sysroot, - std::string &OutputFile, - raw_ostream *&OS); -}; - -class GenerateModuleAction : public ASTFrontendAction { -protected: - virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, - StringRef InFile); - - virtual TranslationUnitKind getTranslationUnitKind() { - return TU_Module; - } + /// \brief Create a new action + explicit GeneratePCHAction(bool MakeModule) : MakeModule(MakeModule) { } - virtual bool hasASTFileSupport() const { return false; } - -public: /// \brief Compute the AST consumer arguments that will be used to /// create the PCHGenerator instance returned by CreateASTConsumer. /// |