LLVM 20.0.0git
FileEntry.h
Go to the documentation of this file.
1//===- FileEntry.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_GSYM_FILEENTRY_H
10#define LLVM_DEBUGINFO_GSYM_FILEENTRY_H
11
13#include "llvm/ADT/Hashing.h"
14#include <functional>
15#include <stdint.h>
16
17namespace llvm {
18namespace gsym {
19
20/// Files in GSYM are contained in FileEntry structs where we split the
21/// directory and basename into two different strings in the string
22/// table. This allows paths to shared commont directory and filename
23/// strings and saves space.
24struct FileEntry {
25
26 /// Offsets in the string table.
27 /// @{
30 /// @}
31
32 FileEntry() = default;
34
35 // Implement operator== so that FileEntry can be used as key in
36 // unordered containers.
37 bool operator==(const FileEntry &RHS) const {
38 return Base == RHS.Base && Dir == RHS.Dir;
39 };
40 bool operator!=(const FileEntry &RHS) const {
41 return Base != RHS.Base || Dir != RHS.Dir;
42 };
43};
44
45} // namespace gsym
46
47template <> struct DenseMapInfo<gsym::FileEntry> {
48 static inline gsym::FileEntry getEmptyKey() {
50 return gsym::FileEntry(key, key);
51 }
54 return gsym::FileEntry(key, key);
55 }
56 static unsigned getHashValue(const gsym::FileEntry &Val) {
59 }
60 static bool isEqual(const gsym::FileEntry &LHS, const gsym::FileEntry &RHS) {
61 return LHS == RHS;
62 }
63};
64
65} // namespace llvm
66#endif // LLVM_DEBUGINFO_GSYM_FILEENTRY_H
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This file defines DenseMapInfo traits for DenseMap.
Value * RHS
Value * LHS
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Definition: Hashing.h:593
static unsigned getHashValue(const gsym::FileEntry &Val)
Definition: FileEntry.h:56
static bool isEqual(const gsym::FileEntry &LHS, const gsym::FileEntry &RHS)
Definition: FileEntry.h:60
static gsym::FileEntry getTombstoneKey()
Definition: FileEntry.h:52
static gsym::FileEntry getEmptyKey()
Definition: FileEntry.h:48
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: DenseMapInfo.h:52
Files in GSYM are contained in FileEntry structs where we split the directory and basename into two d...
Definition: FileEntry.h:24
FileEntry(uint32_t D, uint32_t B)
Definition: FileEntry.h:33
bool operator!=(const FileEntry &RHS) const
Definition: FileEntry.h:40
bool operator==(const FileEntry &RHS) const
Definition: FileEntry.h:37
uint32_t Dir
Offsets in the string table.
Definition: FileEntry.h:28