annotate include/llvm/DebugInfo/CodeView/GUID.h @ 147:c2174574ed3a

LLVM 10
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 16:55:33 +0900
parents 803732b1fca8
children
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 //
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 121
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 121
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 121
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 //
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 #ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 #define LLVM_DEBUGINFO_CODEVIEW_GUID_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 #include <cstdint>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 #include <cstring>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 namespace llvm {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 class raw_ostream;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 namespace codeview {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 /// This represents the 'GUID' type from windows.h.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 struct GUID {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 uint8_t Guid[16];
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 inline bool operator==(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid));
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 inline bool operator<(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 inline bool operator<=(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 inline bool operator>(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 return !(LHS <= RHS);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 inline bool operator>=(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 return !(LHS < RHS);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 inline bool operator!=(const GUID &LHS, const GUID &RHS) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 return !(LHS == RHS);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 } // namespace codeview
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 } // namespace llvm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 #endif