aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/FrontendActions.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-25 22:30:56 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-25 22:30:56 +0000
commit467dc88512b4ba4bb16e274ea3771dc1415d31da (patch)
treec5ebc779742f310ab83aa597265cfd9a7e854b0b /include/clang/Frontend/FrontendActions.h
parentca4c40ab4995d195d9a4d175fa7c30dcc2d99ebf (diff)
Introduce a -cc1 option "-emit-module", that creates a binary module
from the given source. -emit-module behaves similarly to -emit-pch, except that Sema is somewhat more strict about the contents of -emit-module. In the future, there are likely to be more interesting differences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/FrontendActions.h')
-rw-r--r--include/clang/Frontend/FrontendActions.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h
index 646ee2552a..ef204312c4 100644
--- a/include/clang/Frontend/FrontendActions.h
+++ b/include/clang/Frontend/FrontendActions.h
@@ -67,15 +67,22 @@ protected:
};
class GeneratePCHAction : public ASTFrontendAction {
+ bool MakeModule;
+
protected:
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
StringRef InFile);
- virtual bool usesCompleteTranslationUnit() { return false; }
+ virtual TranslationUnitKind getTranslationUnitKind() {
+ return MakeModule? TU_Module : 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.
///
@@ -128,7 +135,7 @@ public:
virtual ~ASTMergeAction();
virtual bool usesPreprocessorOnly() const;
- virtual bool usesCompleteTranslationUnit();
+ virtual TranslationUnitKind getTranslationUnitKind();
virtual bool hasPCHSupport() const;
virtual bool hasASTFileSupport() const;
virtual bool hasCodeCompletionSupport() const;