Coverage Report

Created: 2018-07-19 03:59

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/RegAllocRegistry.h
Line
Count
Source
1
//===- llvm/CodeGen/RegAllocRegistry.h --------------------------*- 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
// This file contains the implementation for register allocator function
11
// pass registry (RegisterRegAlloc).
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_CODEGEN_REGALLOCREGISTRY_H
16
#define LLVM_CODEGEN_REGALLOCREGISTRY_H
17
18
#include "llvm/CodeGen/MachinePassRegistry.h"
19
20
namespace llvm {
21
22
class FunctionPass;
23
24
//===----------------------------------------------------------------------===//
25
///
26
/// RegisterRegAlloc class - Track the registration of register allocators.
27
///
28
//===----------------------------------------------------------------------===//
29
class RegisterRegAlloc : public MachinePassRegistryNode {
30
public:
31
  using FunctionPassCtor = FunctionPass *(*)();
32
33
  static MachinePassRegistry Registry;
34
35
  RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
36
456k
      : MachinePassRegistryNode(N, D, (MachinePassCtor)C) {
37
456k
    Registry.Add(this);
38
456k
  }
39
40
456k
  ~RegisterRegAlloc() { Registry.Remove(this); }
41
42
  // Accessors.
43
365k
  RegisterRegAlloc *getNext() const {
44
365k
    return (RegisterRegAlloc *)MachinePassRegistryNode::getNext();
45
365k
  }
46
47
91.3k
  static RegisterRegAlloc *getList() {
48
91.3k
    return (RegisterRegAlloc *)Registry.getList();
49
91.3k
  }
50
51
64.4k
  static FunctionPassCtor getDefault() {
52
64.4k
    return (FunctionPassCtor)Registry.getDefault();
53
64.4k
  }
54
55
32.0k
  static void setDefault(FunctionPassCtor C) {
56
32.0k
    Registry.setDefault((MachinePassCtor)C);
57
32.0k
  }
58
59
182k
  static void setListener(MachinePassRegistryListener *L) {
60
182k
    Registry.setListener(L);
61
182k
  }
62
};
63
64
} // end namespace llvm
65
66
#endif // LLVM_CODEGEN_REGALLOCREGISTRY_H