Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB

  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. #ifndef LLVM_CODEGEN_REGALLOCREGISTRY_H
  15. #define LLVM_CODEGEN_REGALLOCREGISTRY_H
  16. #include "llvm/CodeGen/MachinePassRegistry.h"
  17. namespace llvm {
  18. //===----------------------------------------------------------------------===//
  19. ///
  20. /// RegisterRegAlloc class - Track the registration of register allocators.
  21. ///
  22. //===----------------------------------------------------------------------===//
  23. class RegisterRegAlloc : public MachinePassRegistryNode {
  24. public:
  25. typedef FunctionPass *(*FunctionPassCtor)();
  26. static MachinePassRegistry Registry;
  27. RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
  28. : MachinePassRegistryNode(N, D, (MachinePassCtor)C)
  29. {
  30. Registry.Add(this);
  31. }
  32. ~RegisterRegAlloc() { Registry.Remove(this); }
  33. // Accessors.
  34. //
  35. RegisterRegAlloc *getNext() const {
  36. return (RegisterRegAlloc *)MachinePassRegistryNode::getNext();
  37. }
  38. static RegisterRegAlloc *getList() {
  39. return (RegisterRegAlloc *)Registry.getList();
  40. }
  41. static FunctionPassCtor getDefault() {
  42. return (FunctionPassCtor)Registry.getDefault();
  43. }
  44. static void setDefault(FunctionPassCtor C) {
  45. Registry.setDefault((MachinePassCtor)C);
  46. }
  47. static void setListener(MachinePassRegistryListener *L) {
  48. Registry.setListener(L);
  49. }
  50. };
  51. } // end namespace llvm
  52. #endif