~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/CompilerDriver/Plugin.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===--- Plugin.h - The LLVM Compiler Driver --------------------*- C++ -*-===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is distributed under the University of Illinois Open
 
6
// Source License. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
//
 
10
//  Plugin support for llvmc.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef LLVM_INCLUDE_COMPILER_DRIVER_PLUGIN_H
 
15
#define LLVM_INCLUDE_COMPILER_DRIVER_PLUGIN_H
 
16
 
 
17
#include "llvm/Support/Registry.h"
 
18
 
 
19
namespace llvmc {
 
20
 
 
21
  class LanguageMap;
 
22
  class CompilationGraph;
 
23
 
 
24
  /// BasePlugin - An abstract base class for all LLVMC plugins.
 
25
  struct BasePlugin {
 
26
 
 
27
    /// Priority - Plugin priority, useful for handling dependencies
 
28
    /// between plugins. Plugins with lower priorities are loaded
 
29
    /// first.
 
30
    virtual int Priority() const { return 0; }
 
31
 
 
32
    /// PreprocessOptions - The auto-generated function that performs various
 
33
    /// consistency checks on options (like ensuring that -O2 and -O3 are not
 
34
    /// used together).
 
35
    virtual void PreprocessOptions() const = 0;
 
36
 
 
37
    /// PopulateLanguageMap - The auto-generated function that fills in
 
38
    /// the language map (map from file extensions to language names).
 
39
    virtual void PopulateLanguageMap(LanguageMap&) const = 0;
 
40
 
 
41
    /// PopulateCompilationGraph - The auto-generated function that
 
42
    /// populates the compilation graph with nodes and edges.
 
43
    virtual void PopulateCompilationGraph(CompilationGraph&) const = 0;
 
44
 
 
45
    /// Needed to avoid a compiler warning.
 
46
    virtual ~BasePlugin() {}
 
47
  };
 
48
 
 
49
  typedef llvm::Registry<BasePlugin> PluginRegistry;
 
50
 
 
51
  template <class P>
 
52
  struct RegisterPlugin
 
53
    : public PluginRegistry::Add<P> {
 
54
    typedef PluginRegistry::Add<P> Base;
 
55
 
 
56
    RegisterPlugin(const char* Name = "Nameless",
 
57
                   const char* Desc = "Auto-generated plugin")
 
58
      : Base(Name, Desc) {}
 
59
  };
 
60
 
 
61
 
 
62
  /// PluginLoader - Helper class used by the main program for
 
63
  /// lifetime management.
 
64
  struct PluginLoader {
 
65
    PluginLoader();
 
66
    ~PluginLoader();
 
67
 
 
68
    /// RunInitialization - Calls PreprocessOptions, PopulateLanguageMap and
 
69
    /// PopulateCompilationGraph methods of all plugins. This populates the
 
70
    /// global language map and the compilation graph.
 
71
    void RunInitialization(LanguageMap& langMap, CompilationGraph& graph) const;
 
72
 
 
73
  private:
 
74
    // noncopyable
 
75
    PluginLoader(const PluginLoader& other);
 
76
    const PluginLoader& operator=(const PluginLoader& other);
 
77
  };
 
78
 
 
79
}
 
80
 
 
81
#endif // LLVM_INCLUDE_COMPILER_DRIVER_PLUGIN_H