Home | History | Annotate | Download | only in CodeView
      1 //===- 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 
     15 namespace llvm {
     16 namespace codeview {
     17 
     18 class FunctionId {
     19 public:
     20   FunctionId() : Index(0) {}
     21 
     22   explicit FunctionId(uint32_t Index) : Index(Index) {}
     23 
     24   uint32_t getIndex() const { return Index; }
     25 
     26 private:
     27   uint32_t Index;
     28 };
     29 
     30 inline bool operator==(const FunctionId &A, const FunctionId &B) {
     31   return A.getIndex() == B.getIndex();
     32 }
     33 
     34 inline bool operator!=(const FunctionId &A, const FunctionId &B) {
     35   return A.getIndex() != B.getIndex();
     36 }
     37 
     38 inline bool operator<(const FunctionId &A, const FunctionId &B) {
     39   return A.getIndex() < B.getIndex();
     40 }
     41 
     42 inline bool operator<=(const FunctionId &A, const FunctionId &B) {
     43   return A.getIndex() <= B.getIndex();
     44 }
     45 
     46 inline bool operator>(const FunctionId &A, const FunctionId &B) {
     47   return A.getIndex() > B.getIndex();
     48 }
     49 
     50 inline bool operator>=(const FunctionId &A, const FunctionId &B) {
     51   return A.getIndex() >= B.getIndex();
     52 }
     53 }
     54 }
     55 
     56 #endif
     57