Coverage Report

Created: 2018-11-16 02:38

/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<FunctionPass *(*)()> {
30
public:
31
  using FunctionPassCtor = FunctionPass *(*)();
32
33
  static MachinePassRegistry<FunctionPassCtor> Registry;
34
35
  RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
36
477k
      : MachinePassRegistryNode(N, D, C) {
37
477k
    Registry.Add(this);
38
477k
  }
39
40
477k
  ~RegisterRegAlloc() { Registry.Remove(this); }
41
42
  // Accessors.
43
381k
  RegisterRegAlloc *getNext() const {
44
381k
    return (RegisterRegAlloc *)MachinePassRegistryNode::getNext();
45
381k
  }
46
47
95.4k
  static RegisterRegAlloc *getList() {
48
95.4k
    return (RegisterRegAlloc *)Registry.getList();
49
95.4k
  }
50
51
67.4k
  static FunctionPassCtor getDefault() { return Registry.getDefault(); }
52
53
33.5k
  static void setDefault(FunctionPassCtor C) { Registry.setDefault(C); }
54
55
190k
  static void setListener(MachinePassRegistryListener<FunctionPassCtor> *L) {
56
190k
    Registry.setListener(L);
57
190k
  }
58
};
59
60
} // end namespace llvm
61
62
#endif // LLVM_CODEGEN_REGALLOCREGISTRY_H