blob: 1af3da810b5aef5dc75d2053473316cb6dcb1792 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- FunctionId.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#ifndef LLVM_DEBUGINFO_CODEVIEW_FUNCTIONID_H
11#define LLVM_DEBUGINFO_CODEVIEW_FUNCTIONID_H
12
13#include <cinttypes>
14
15namespace llvm {
16namespace codeview {
17
18class FunctionId {
19public:
20 FunctionId() : Index(0) {}
21
22 explicit FunctionId(uint32_t Index) : Index(Index) {}
23
24 uint32_t getIndex() const { return Index; }
25
26private:
27 uint32_t Index;
28};
29
30inline bool operator==(const FunctionId &A, const FunctionId &B) {
31 return A.getIndex() == B.getIndex();
32}
33
34inline bool operator!=(const FunctionId &A, const FunctionId &B) {
35 return A.getIndex() != B.getIndex();
36}
37
38inline bool operator<(const FunctionId &A, const FunctionId &B) {
39 return A.getIndex() < B.getIndex();
40}
41
42inline bool operator<=(const FunctionId &A, const FunctionId &B) {
43 return A.getIndex() <= B.getIndex();
44}
45
46inline bool operator>(const FunctionId &A, const FunctionId &B) {
47 return A.getIndex() > B.getIndex();
48}
49
50inline bool operator>=(const FunctionId &A, const FunctionId &B) {
51 return A.getIndex() >= B.getIndex();
52}
53}
54}
55
56#endif