annotate include/llvm/DebugInfo/CodeView/GUID.h @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //===- GUID.h ---------------------------------------------------*- C++ -*-===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 #define LLVM_DEBUGINFO_CODEVIEW_GUID_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 #include <cstdint>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 #include <cstring>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 namespace llvm {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 class raw_ostream;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 namespace codeview {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 /// This represents the 'GUID' type from windows.h.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 struct GUID {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 uint8_t Guid[16];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 inline bool operator==(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 inline bool operator<(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 inline bool operator<=(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 inline bool operator>(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 return !(LHS <= RHS);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 inline bool operator>=(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 return !(LHS < RHS);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 inline bool operator!=(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 return !(LHS == RHS);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 } // namespace codeview
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 } // namespace llvm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 #endif