1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
7 * This file is distributed under the University of Illinois Open Source
8 * License. See LICENSE.TXT for details.
12 #ifndef PLUGINHANDLER_H
13 #define PLUGINHANDLER_H
17 #include <clang/AST/ASTConsumer.h>
18 #include <clang/Frontend/FrontendAction.h>
24 Class that manages all LO modules.
30 PluginHandler( CompilerInstance
& compiler
, const vector
< string
>& args
);
31 virtual ~PluginHandler();
32 virtual void HandleTranslationUnit( ASTContext
& context
) override
;
33 static void registerPlugin( Plugin
* (*create
)( CompilerInstance
&, Rewriter
& ), const char* optionName
, bool isRewriter
, bool isPPCallback
);
35 void handleOption( const string
& option
);
36 void createPlugin( const string
& name
);
37 DiagnosticBuilder
report( DiagnosticsEngine::Level level
, StringRef message
, SourceLocation loc
= SourceLocation());
38 CompilerInstance
& compiler
;
44 The Clang plugin class, just forwards to PluginHandler.
46 class LibreOfficeAction
47 : public PluginASTAction
50 virtual ASTConsumer
* CreateASTConsumer( CompilerInstance
& Compiler
, StringRef InFile
);
51 virtual bool ParseArgs( const CompilerInstance
& CI
, const vector
< string
>& args
);
53 vector
< string
> _args
;
58 #endif // COMPILEPLUGIN_H
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */