GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / compilerplugins / clang / pluginhandler.hxx
blobee53a1f837c3749f5f719703f337c4e8ccef7c90
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * Based on LLVM/Clang.
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
15 #include "plugin.hxx"
17 #include <clang/AST/ASTConsumer.h>
18 #include <clang/Frontend/FrontendAction.h>
20 namespace loplugin
23 /**
24 Class that manages all LO modules.
26 class PluginHandler
27 : public ASTConsumer
29 public:
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 );
34 private:
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;
39 Rewriter rewriter;
40 string scope;
43 /**
44 The Clang plugin class, just forwards to PluginHandler.
46 class LibreOfficeAction
47 : public PluginASTAction
49 public:
50 virtual ASTConsumer* CreateASTConsumer( CompilerInstance& Compiler, StringRef InFile );
51 virtual bool ParseArgs( const CompilerInstance& CI, const vector< string >& args );
52 private:
53 vector< string > _args;
56 } // namespace
58 #endif // COMPILEPLUGIN_H
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */