LLVM 17.0.0git
GUID.h
Go to the documentation of this file.
1//===- GUID.h ---------------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H
10#define LLVM_DEBUGINFO_CODEVIEW_GUID_H
11
12#include <cstdint>
13#include <cstring>
14
15namespace llvm {
16class raw_ostream;
17
18namespace codeview {
19
20/// This represents the 'GUID' type from windows.h.
21struct GUID {
22 uint8_t Guid[16];
23};
24
25inline bool operator==(const GUID &LHS, const GUID &RHS) {
26 return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid));
27}
28
29inline bool operator<(const GUID &LHS, const GUID &RHS) {
30 return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0;
31}
32
33inline bool operator<=(const GUID &LHS, const GUID &RHS) {
34 return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0;
35}
36
37inline bool operator>(const GUID &LHS, const GUID &RHS) {
38 return !(LHS <= RHS);
39}
40
41inline bool operator>=(const GUID &LHS, const GUID &RHS) {
42 return !(LHS < RHS);
43}
44
45inline bool operator!=(const GUID &LHS, const GUID &RHS) {
46 return !(LHS == RHS);
47}
48
49raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid);
50
51} // namespace codeview
52} // namespace llvm
53
54#endif
Merge contiguous icmps into a memcmp
Definition: MergeICmps.cpp:908
Value * RHS
Value * LHS
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
bool operator!=(const FunctionId &A, const FunctionId &B)
Definition: FunctionId.h:33
bool operator>(const FunctionId &A, const FunctionId &B)
Definition: FunctionId.h:45
bool operator>=(const FunctionId &A, const FunctionId &B)
Definition: FunctionId.h:49
bool operator<(const FunctionId &A, const FunctionId &B)
Definition: FunctionId.h:37
bool operator<=(const FunctionId &A, const FunctionId &B)
Definition: FunctionId.h:41
bool operator==(const FunctionId &A, const FunctionId &B)
Definition: FunctionId.h:29
raw_ostream & operator<<(raw_ostream &OS, const GUID &Guid)
Definition: Formatters.cpp:57
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
This represents the 'GUID' type from windows.h.
Definition: GUID.h:21
uint8_t Guid[16]
Definition: GUID.h:22