2 * This file is part of the LibreOffice project.
6 * This file is distributed under the University of Illinois Open Source
7 * License. See LICENSE.TXT for details.
11 #ifndef PLUGINHANDLER_H
12 #define PLUGINHANDLER_H
16 #include <clang/AST/ASTConsumer.h>
17 #include <clang/Frontend/FrontendAction.h>
23 Class that manages all LO modules.
29 PluginHandler( CompilerInstance
& compiler
, const vector
< string
>& args
);
30 virtual ~PluginHandler();
31 virtual void HandleTranslationUnit( ASTContext
& context
) override
;
32 static void registerPlugin( Plugin
* (*create
)( CompilerInstance
&, Rewriter
& ), const char* optionName
, bool isRewriter
);
34 void handleOption( const string
& option
);
35 void createPlugin( const string
& name
);
36 DiagnosticBuilder
report( DiagnosticsEngine::Level level
, StringRef message
, SourceLocation loc
= SourceLocation());
37 CompilerInstance
& compiler
;
43 The Clang plugin class, just forwards to PluginHandler.
45 class LibreOfficeAction
46 : public PluginASTAction
49 virtual ASTConsumer
* CreateASTConsumer( CompilerInstance
& Compiler
, StringRef InFile
);
50 virtual bool ParseArgs( const CompilerInstance
& CI
, const vector
< string
>& args
);
52 vector
< string
> _args
;
57 #endif // COMPILEPLUGIN_H