Coverage Report

Created: 2019-01-21 03:01

/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
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file contains the implementation for register allocator function
10
// pass registry (RegisterRegAlloc).
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CODEGEN_REGALLOCREGISTRY_H
15
#define LLVM_CODEGEN_REGALLOCREGISTRY_H
16
17
#include "llvm/CodeGen/MachinePassRegistry.h"
18
19
namespace llvm {
20
21
class FunctionPass;
22
23
//===----------------------------------------------------------------------===//
24
///
25
/// RegisterRegAlloc class - Track the registration of register allocators.
26
///
27
//===----------------------------------------------------------------------===//
28
class RegisterRegAlloc : public MachinePassRegistryNode<FunctionPass *(*)()> {
29
public:
30
  using FunctionPassCtor = FunctionPass *(*)();
31
32
  static MachinePassRegistry<FunctionPassCtor> Registry;
33
34
  RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
35
485k
      : MachinePassRegistryNode(N, D, C) {
36
485k
    Registry.Add(this);
37
485k
  }
38
39
485k
  ~RegisterRegAlloc() { Registry.Remove(this); }
40
41
  // Accessors.
42
388k
  RegisterRegAlloc *getNext() const {
43
388k
    return (RegisterRegAlloc *)MachinePassRegistryNode::getNext();
44
388k
  }
45
46
97.1k
  static RegisterRegAlloc *getList() {
47
97.1k
    return (RegisterRegAlloc *)Registry.getList();
48
97.1k
  }
49
50
68.2k
  static FunctionPassCtor getDefault() { return Registry.getDefault(); }
51
52
33.9k
  static void setDefault(FunctionPassCtor C) { Registry.setDefault(C); }
53
54
194k
  static void setListener(MachinePassRegistryListener<FunctionPassCtor> *L) {
55
194k
    Registry.setListener(L);
56
194k
  }
57
};
58
59
} // end namespace llvm
60
61
#endif // LLVM_CODEGEN_REGALLOCREGISTRY_H