~ubuntu-branches/ubuntu/hardy/clamav/hardy-security

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Marc Deslauriers, Scott Kitterman
  • Date: 2013-03-21 08:37:54 UTC
  • mfrom: (43.1.79 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130321083754-r3dnl8aewkny2rxu
Tags: 0.97.7+dfsg-1ubuntu0.08.04.1
[ Marc Deslauriers ]
* SECURITY UPDATE: Updated to 0.97.7 to fix multiple security issues.
  (LP: #1157385)
  - CVE numbers pending

[ Scott Kitterman ]
* Changes to adapt to Hardy:
  - Build without llvm support on lpia to fix FTBFS (not a regression as
    llvm has never built on hardy lpia)
  - Drop -T -W from apparmor_parser calls in clamav-daemon and freshclam
    postinsts since it is not supported in Hardy's apparmor
  - Drop deny rule in freshclam apparmor profile since deny is not
    supported in Hardy's apparmor
  - Drop dh_lintian from debian/rules and adjust version of debhelper
    build-dep
  - Drop build-dep and libclamav-dev depends on non-existent libtommath-dev
  - Changed Section to 'utils' for clamav-dbg package
  - Ignore test suite errors on hppa
  - Build-depend on libltdl3-dev instead of libltdl-dev
  - Drop hardening flags changes
  - Drop unneeded versioning on lsb-base (clamav ships it's own status
    function)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===-- DOTGraphTraitsPass.h - Print/View dotty graphs-----------*- C++ -*-===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is distributed under the University of Illinois Open Source
 
6
// License. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
//
 
10
// Templates to create dotty viewer and printer passes for GraphTraits graphs.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef LLVM_ANALYSIS_DOT_GRAPHTRAITS_PASS_H
 
15
#define LLVM_ANALYSIS_DOT_GRAPHTRAITS_PASS_H
 
16
 
 
17
#include "llvm/Pass.h"
 
18
#include "llvm/Analysis/CFGPrinter.h"
 
19
 
 
20
namespace llvm {
 
21
template <class Analysis, bool Simple>
 
22
struct DOTGraphTraitsViewer : public FunctionPass {
 
23
  std::string Name;
 
24
 
 
25
  DOTGraphTraitsViewer(std::string GraphName, char &ID) : FunctionPass(ID) {
 
26
    Name = GraphName;
 
27
  }
 
28
 
 
29
  virtual bool runOnFunction(Function &F) {
 
30
    Analysis *Graph;
 
31
    std::string Title, GraphName;
 
32
    Graph = &getAnalysis<Analysis>();
 
33
    GraphName = DOTGraphTraits<Analysis*>::getGraphName(Graph);
 
34
    Title = GraphName + " for '" + F.getNameStr() + "' function";
 
35
    ViewGraph(Graph, Name, Simple, Title);
 
36
 
 
37
    return false;
 
38
  }
 
39
 
 
40
  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
 
41
    AU.setPreservesAll();
 
42
    AU.addRequired<Analysis>();
 
43
  }
 
44
};
 
45
 
 
46
template <class Analysis, bool Simple>
 
47
struct DOTGraphTraitsPrinter : public FunctionPass {
 
48
 
 
49
  std::string Name;
 
50
 
 
51
  DOTGraphTraitsPrinter(std::string GraphName, char &ID)
 
52
    : FunctionPass(ID) {
 
53
    Name = GraphName;
 
54
  }
 
55
 
 
56
  virtual bool runOnFunction(Function &F) {
 
57
    Analysis *Graph;
 
58
    std::string Filename = Name + "." + F.getNameStr() + ".dot";
 
59
    errs() << "Writing '" << Filename << "'...";
 
60
 
 
61
    std::string ErrorInfo;
 
62
    raw_fd_ostream File(Filename.c_str(), ErrorInfo);
 
63
    Graph = &getAnalysis<Analysis>();
 
64
 
 
65
    std::string Title, GraphName;
 
66
    GraphName = DOTGraphTraits<Analysis*>::getGraphName(Graph);
 
67
    Title = GraphName + " for '" + F.getNameStr() + "' function";
 
68
 
 
69
    if (ErrorInfo.empty())
 
70
      WriteGraph(File, Graph, Simple, Name, Title);
 
71
    else
 
72
      errs() << "  error opening file for writing!";
 
73
    errs() << "\n";
 
74
    return false;
 
75
  }
 
76
 
 
77
  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
 
78
    AU.setPreservesAll();
 
79
    AU.addRequired<Analysis>();
 
80
  }
 
81
};
 
82
}
 
83
#endif