aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-16 16:59:23 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-16 16:59:23 +0000
commit3177aae51a21f61ab483c52f97124bdb707da7f1 (patch)
treec0dcd4ec9cd85fe30d7f3f2a55386f8aa0a4686d /include/clang/Frontend
parent7ccecb72cb8e0a77139526bd090cf8c68ba178cd (diff)
Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy Straszheim!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r--include/clang/Frontend/FrontendAction.h15
-rw-r--r--include/clang/Frontend/FrontendOptions.h3
-rw-r--r--include/clang/Frontend/FrontendPluginRegistry.h2
3 files changed, 19 insertions, 1 deletions
diff --git a/include/clang/Frontend/FrontendAction.h b/include/clang/Frontend/FrontendAction.h
index b16a6aa509..f6a68bf69e 100644
--- a/include/clang/Frontend/FrontendAction.h
+++ b/include/clang/Frontend/FrontendAction.h
@@ -13,6 +13,11 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/OwningPtr.h"
#include <string>
+#include <vector>
+
+namespace llvm {
+ class raw_ostream;
+}
namespace clang {
class ASTConsumer;
@@ -214,6 +219,16 @@ public:
virtual bool usesPreprocessorOnly() const { return false; }
};
+class PluginASTAction : public ASTFrontendAction {
+protected:
+ virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+ llvm::StringRef InFile) = 0;
+
+public:
+ virtual bool ParseArgs(const std::vector<std::string>& arg) = 0;
+ virtual void PrintHelp(llvm::raw_ostream&) = 0;
+};
+
/// PreprocessorFrontendAction - Abstract base class to use for preprocessor
/// based frontend actions.
class PreprocessorFrontendAction : public FrontendAction {
diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h
index 07e062ed6b..0f4538976d 100644
--- a/include/clang/Frontend/FrontendOptions.h
+++ b/include/clang/Frontend/FrontendOptions.h
@@ -94,6 +94,9 @@ public:
/// The name of the action to run when using a plugin action.
std::string ActionName;
+ /// Arg to pass to the plugin
+ std::vector<std::string> PluginArgs;
+
/// The list of plugins to load.
std::vector<std::string> Plugins;
diff --git a/include/clang/Frontend/FrontendPluginRegistry.h b/include/clang/Frontend/FrontendPluginRegistry.h
index 8341492cfd..ec925adb01 100644
--- a/include/clang/Frontend/FrontendPluginRegistry.h
+++ b/include/clang/Frontend/FrontendPluginRegistry.h
@@ -16,7 +16,7 @@
namespace clang {
/// The frontend plugin registry.
-typedef llvm::Registry<FrontendAction> FrontendPluginRegistry;
+typedef llvm::Registry<PluginASTAction> FrontendPluginRegistry;
} // end namespace clang