aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/FrontendActions.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-15 21:49:36 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-15 21:49:36 +0000
commitb8691df825c99b0fc989fcd92a008d2500ff2e37 (patch)
tree53fd0ad49858cac8258341f447df39384c6be4e5 /include/clang/Frontend/FrontendActions.h
parent9c0e1ec7b3afd833c1b958ce2aeedff71c7eb4c5 (diff)
Split GenerateModuleAction into its own action, which will start
differing from GeneratePCHAction fairly soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/FrontendActions.h')
-rw-r--r--include/clang/Frontend/FrontendActions.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h
index 72a3d90847..ba1dbb8f23 100644
--- a/include/clang/Frontend/FrontendActions.h
+++ b/include/clang/Frontend/FrontendActions.h
@@ -67,22 +67,40 @@ protected:
};
class GeneratePCHAction : public ASTFrontendAction {
- bool MakeModule;
-
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile);
virtual TranslationUnitKind getTranslationUnitKind() {
- return MakeModule? TU_Module : TU_Prefix;
+ return TU_Prefix;
}
virtual bool hasASTFileSupport() const { return false; }
public:
- /// \brief Create a new action
- explicit GeneratePCHAction(bool MakeModule) : MakeModule(MakeModule) { }
+ /// \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;
+ }
+ 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.
///