FunctionId.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- FunctionId.h ---------------------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_DEBUGINFO_CODEVIEW_FUNCTIONID_H
  14. #define LLVM_DEBUGINFO_CODEVIEW_FUNCTIONID_H
  15. #include <cinttypes>
  16. namespace llvm {
  17. namespace codeview {
  18. class FunctionId {
  19. public:
  20. FunctionId() : Index(0) {}
  21. explicit FunctionId(uint32_t Index) : Index(Index) {}
  22. uint32_t getIndex() const { return Index; }
  23. private:
  24. uint32_t Index;
  25. };
  26. inline bool operator==(const FunctionId &A, const FunctionId &B) {
  27. return A.getIndex() == B.getIndex();
  28. }
  29. inline bool operator!=(const FunctionId &A, const FunctionId &B) {
  30. return A.getIndex() != B.getIndex();
  31. }
  32. inline bool operator<(const FunctionId &A, const FunctionId &B) {
  33. return A.getIndex() < B.getIndex();
  34. }
  35. inline bool operator<=(const FunctionId &A, const FunctionId &B) {
  36. return A.getIndex() <= B.getIndex();
  37. }
  38. inline bool operator>(const FunctionId &A, const FunctionId &B) {
  39. return A.getIndex() > B.getIndex();
  40. }
  41. inline bool operator>=(const FunctionId &A, const FunctionId &B) {
  42. return A.getIndex() >= B.getIndex();
  43. }
  44. }
  45. }
  46. #endif
  47. #ifdef __GNUC__
  48. #pragma GCC diagnostic pop
  49. #endif