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.

58 lines
1.8 KiB

  1. //===- MCLabel.h - Machine Code Directional Local Labels --------*- 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 declaration of the MCLabel class.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_MC_MCLABEL_H
  14. #define LLVM_MC_MCLABEL_H
  15. #include "llvm/Support/Compiler.h"
  16. namespace llvm {
  17. class MCContext;
  18. class raw_ostream;
  19. /// MCLabel - Instances of this class represent a label name in the MC file,
  20. /// and MCLabel are created and unique'd by the MCContext class. MCLabel
  21. /// should only be constructed for valid instances in the object file.
  22. class MCLabel {
  23. // Instance - the instance number of this Directional Local Label
  24. unsigned Instance;
  25. private: // MCContext creates and uniques these.
  26. friend class MCContext;
  27. MCLabel(unsigned instance)
  28. : Instance(instance) {}
  29. MCLabel(const MCLabel&) LLVM_DELETED_FUNCTION;
  30. void operator=(const MCLabel&) LLVM_DELETED_FUNCTION;
  31. public:
  32. /// getInstance - Get the current instance of this Directional Local Label.
  33. unsigned getInstance() const { return Instance; }
  34. /// incInstance - Increment the current instance of this Directional Local
  35. /// Label.
  36. unsigned incInstance() { return ++Instance; }
  37. /// print - Print the value to the stream \p OS.
  38. void print(raw_ostream &OS) const;
  39. /// dump - Print the value to stderr.
  40. void dump() const;
  41. };
  42. inline raw_ostream &operator<<(raw_ostream &OS, const MCLabel &Label) {
  43. Label.print(OS);
  44. return OS;
  45. }
  46. } // end namespace llvm
  47. #endif