FunctionId.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //===- FunctionId.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. #ifndef LLVM_DEBUGINFO_CODEVIEW_FUNCTIONID_H
  9. #define LLVM_DEBUGINFO_CODEVIEW_FUNCTIONID_H
  10. #include <cinttypes>
  11. namespace llvm {
  12. namespace codeview {
  13. class FunctionId {
  14. public:
  15. FunctionId() : Index(0) {}
  16. explicit FunctionId(uint32_t Index) : Index(Index) {}
  17. uint32_t getIndex() const { return Index; }
  18. private:
  19. uint32_t Index;
  20. };
  21. inline bool operator==(const FunctionId &A, const FunctionId &B) {
  22. return A.getIndex() == B.getIndex();
  23. }
  24. inline bool operator!=(const FunctionId &A, const FunctionId &B) {
  25. return A.getIndex() != B.getIndex();
  26. }
  27. inline bool operator<(const FunctionId &A, const FunctionId &B) {
  28. return A.getIndex() < B.getIndex();
  29. }
  30. inline bool operator<=(const FunctionId &A, const FunctionId &B) {
  31. return A.getIndex() <= B.getIndex();
  32. }
  33. inline bool operator>(const FunctionId &A, const FunctionId &B) {
  34. return A.getIndex() > B.getIndex();
  35. }
  36. inline bool operator>=(const FunctionId &A, const FunctionId &B) {
  37. return A.getIndex() >= B.getIndex();
  38. }
  39. }
  40. }
  41. #endif