Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/lld/include/lld/Core/Pass.h
Line
Count
Source
1
//===------ Core/Pass.h - Base class for linker passes ----------*- C++ -*-===//
2
//
3
//                             The LLVM Linker
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLD_CORE_PASS_H
11
#define LLD_CORE_PASS_H
12
13
#include "llvm/Support/Error.h"
14
15
namespace lld {
16
17
class SimpleFile;
18
19
/// Once the core linking is done (which resolves references, coalesces atoms
20
/// and produces a complete Atom graph), the linker runs a series of passes
21
/// on the Atom graph. The graph is modeled as a File, which means the pass
22
/// has access to all the atoms and to File level attributes. Each pass does
23
/// a particular transformation to the Atom graph or to the File attributes.
24
///
25
/// This is the abstract base class for all passes.  A Pass does its
26
/// actual work in it perform() method.  It can iterator over Atoms in the
27
/// graph using the *begin()/*end() atom iterator of the File.  It can add
28
/// new Atoms to the graph using the File's addAtom() method.
29
class Pass {
30
public:
31
540
  virtual ~Pass() = default;
32
33
  /// Do the actual work of the Pass.
34
  virtual llvm::Error perform(SimpleFile &mergedFile) = 0;
35
36
protected:
37
  // Only subclassess can be instantiated.
38
540
  Pass() = default;
39
};
40
41
} // end namespace lld
42
43
#endif // LLD_CORE_PASS_H