LLVM  8.0.1
CodeViewYAMLTypeHashing.h
Go to the documentation of this file.
1 //==- CodeViewYAMLTypeHashing.h - CodeView YAMLIO Type hashing ----*- C++-*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines classes for handling the YAML representation of CodeView
11 // Debug Info.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H
16 #define LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H
17 
18 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ObjectYAML/YAML.h"
21 #include "llvm/Support/Allocator.h"
22 #include "llvm/Support/Error.h"
24 #include <cstdint>
25 #include <memory>
26 #include <vector>
27 
28 namespace llvm {
29 
30 namespace CodeViewYAML {
31 
32 struct GlobalHash {
33  GlobalHash() = default;
34  explicit GlobalHash(StringRef S) : Hash(S) {
35  assert(S.size() == 8 && "Invalid hash size!");
36  }
37  explicit GlobalHash(ArrayRef<uint8_t> S) : Hash(S) {
38  assert(S.size() == 8 && "Invalid hash size!");
39  }
41 };
42 
43 struct DebugHSection {
45  uint16_t Version;
46  uint16_t HashAlgorithm;
47  std::vector<GlobalHash> Hashes;
48 };
49 
52  BumpPtrAllocator &Alloc);
53 
54 } // end namespace CodeViewYAML
55 
56 } // end namespace llvm
57 
58 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::DebugHSection)
59 LLVM_YAML_DECLARE_SCALAR_TRAITS(CodeViewYAML::GlobalHash, QuotingType::None)
60 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::GlobalHash)
61 
62 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Definition: StringRef.h:138
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
ArrayRef< uint8_t > toDebugH(const DebugHSection &DebugH, BumpPtrAllocator &Alloc)
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:141
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:149
Specialized YAMLIO scalar type for representing a binary blob.
Definition: YAML.h:64
DebugHSection fromDebugH(ArrayRef< uint8_t > DebugH)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49