~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/CompilerDriver/Tool.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
//===--- Tool.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
//  Tool abstract base class - an interface to tool descriptions.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef LLVM_INCLUDE_COMPILER_DRIVER_TOOL_H
 
15
#define LLVM_INCLUDE_COMPILER_DRIVER_TOOL_H
 
16
 
 
17
#include "llvm/CompilerDriver/Action.h"
 
18
 
 
19
#include "llvm/ADT/IntrusiveRefCntPtr.h"
 
20
#include "llvm/ADT/StringSet.h"
 
21
#include "llvm/System/Path.h"
 
22
 
 
23
#include <string>
 
24
#include <vector>
 
25
#include <utility>
 
26
 
 
27
namespace llvmc {
 
28
 
 
29
  class LanguageMap;
 
30
  typedef std::vector<std::pair<unsigned, std::string> > ArgsVector;
 
31
  typedef std::vector<llvm::sys::Path> PathVector;
 
32
  typedef std::vector<std::string> StrVector;
 
33
  typedef llvm::StringSet<> InputLanguagesSet;
 
34
 
 
35
  /// Tool - Represents a single tool.
 
36
  class Tool : public llvm::RefCountedBaseVPTR<Tool> {
 
37
  public:
 
38
 
 
39
    virtual ~Tool() {}
 
40
 
 
41
    virtual Action GenerateAction (const PathVector& inFiles,
 
42
                                   bool  HasChildren,
 
43
                                   const llvm::sys::Path& TempDir,
 
44
                                   const InputLanguagesSet& InLangs,
 
45
                                   const LanguageMap& LangMap) const = 0;
 
46
 
 
47
    virtual Action GenerateAction (const llvm::sys::Path& inFile,
 
48
                                   bool  HasChildren,
 
49
                                   const llvm::sys::Path& TempDir,
 
50
                                   const InputLanguagesSet& InLangs,
 
51
                                   const LanguageMap& LangMap) const = 0;
 
52
 
 
53
    virtual const char*  Name() const = 0;
 
54
    virtual const char** InputLanguages() const = 0;
 
55
    virtual const char*  OutputLanguage() const = 0;
 
56
 
 
57
    virtual bool IsJoin() const = 0;
 
58
    virtual bool WorksOnEmpty() const = 0;
 
59
 
 
60
  protected:
 
61
    /// OutFileName - Generate the output file name.
 
62
    llvm::sys::Path OutFilename(const llvm::sys::Path& In,
 
63
                                const llvm::sys::Path& TempDir,
 
64
                                bool StopCompilation,
 
65
                                const char* OutputSuffix) const;
 
66
 
 
67
    StrVector SortArgs(ArgsVector& Args) const;
 
68
  };
 
69
 
 
70
  /// JoinTool - A Tool that has an associated input file list.
 
71
  class JoinTool : public Tool {
 
72
  public:
 
73
    void AddToJoinList(const llvm::sys::Path& P) { JoinList_.push_back(P); }
 
74
    void ClearJoinList() { JoinList_.clear(); }
 
75
    bool JoinListEmpty() const { return JoinList_.empty(); }
 
76
 
 
77
    Action GenerateAction(bool  HasChildren,
 
78
                          const llvm::sys::Path& TempDir,
 
79
                          const InputLanguagesSet& InLangs,
 
80
                          const LanguageMap& LangMap) const {
 
81
      return GenerateAction(JoinList_, HasChildren, TempDir, InLangs, LangMap);
 
82
    }
 
83
    // We shouldn't shadow base class's version of GenerateAction.
 
84
    using Tool::GenerateAction;
 
85
 
 
86
  private:
 
87
    PathVector JoinList_;
 
88
  };
 
89
 
 
90
}
 
91
 
 
92
#endif // LLVM_INCLUDE_COMPILER_DRIVER_TOOL_H