LLVM  14.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 
12 #include "llvm/ADT/DenseMapInfo.h"
13 #include "llvm/ADT/Hashing.h"
14 #include <functional>
15 #include <stdint.h>
16 
17 namespace llvm {
18 namespace 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.
24 struct 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 
47 template <> struct DenseMapInfo<gsym::FileEntry> {
48  static inline gsym::FileEntry getEmptyKey() {
50  return gsym::FileEntry(key, key);
51  }
52  static inline gsym::FileEntry getTombstoneKey() {
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
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::DenseMapInfo< gsym::FileEntry >::getEmptyKey
static gsym::FileEntry getEmptyKey()
Definition: FileEntry.h:48
llvm::gsym::FileEntry::FileEntry
FileEntry(uint32_t D, uint32_t B)
Definition: FileEntry.h:33
Hashing.h
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: APInt.h:34
llvm::gsym::FileEntry::Dir
uint32_t Dir
Offsets in the string table.
Definition: FileEntry.h:28
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::gsym::FileEntry::Base
uint32_t Base
Definition: FileEntry.h:29
llvm::DenseMapInfo< gsym::FileEntry >::getTombstoneKey
static gsym::FileEntry getTombstoneKey()
Definition: FileEntry.h:52
llvm::gsym::FileEntry::FileEntry
FileEntry()=default
uint32_t
llvm::gsym::FileEntry
Files in GSYM are contained in FileEntry structs where we split the directory and basename into two d...
Definition: FileEntry.h:24
llvm::DenseMapInfo< gsym::FileEntry >::getHashValue
static unsigned getHashValue(const gsym::FileEntry &Val)
Definition: FileEntry.h:56
llvm::DenseMapInfo< gsym::FileEntry >::isEqual
static bool isEqual(const gsym::FileEntry &LHS, const gsym::FileEntry &RHS)
Definition: FileEntry.h:60
llvm::hash_combine
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Definition: Hashing.h:605
llvm::gsym::FileEntry::operator==
bool operator==(const FileEntry &RHS) const
Definition: FileEntry.h:37
DenseMapInfo.h
llvm::gsym::FileEntry::operator!=
bool operator!=(const FileEntry &RHS) const
Definition: FileEntry.h:40