LLVM  13.0.0git
CodeViewYAMLTypeHashing.h
Go to the documentation of this file.
1 //==- CodeViewYAMLTypeHashing.h - CodeView YAMLIO Type hashing ----*- 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 // This file defines classes for handling the YAML representation of CodeView
10 // Debug Info.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H
15 #define LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H
16 
17 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ObjectYAML/YAML.h"
20 #include "llvm/Support/Allocator.h"
21 #include "llvm/Support/Error.h"
23 #include <cstdint>
24 #include <memory>
25 #include <vector>
26 
27 namespace llvm {
28 
29 namespace CodeViewYAML {
30 
31 struct GlobalHash {
32  GlobalHash() = default;
33  explicit GlobalHash(StringRef S) : Hash(S) {
34  assert(S.size() == 8 && "Invalid hash size!");
35  }
37  assert(S.size() == 8 && "Invalid hash size!");
38  }
40 };
41 
42 struct DebugHSection {
46  std::vector<GlobalHash> Hashes;
47 };
48 
51  BumpPtrAllocator &Alloc);
52 
53 } // end namespace CodeViewYAML
54 
55 } // end namespace llvm
56 
57 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::DebugHSection)
58 LLVM_YAML_DECLARE_SCALAR_TRAITS(CodeViewYAML::GlobalHash, QuotingType::None)
59 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::GlobalHash)
60 
61 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H
llvm::CodeViewYAML::DebugHSection::Version
uint16_t Version
Definition: CodeViewYAMLTypeHashing.h:44
LLVM_YAML_DECLARE_MAPPING_TRAITS
#define LLVM_YAML_DECLARE_MAPPING_TRAITS(Type)
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::CodeViewYAML::GlobalHash
Definition: CodeViewYAMLTypeHashing.h:31
Allocator.h
Error.h
LLVM_YAML_IS_SEQUENCE_VECTOR
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
llvm::CodeViewYAML::GlobalHash::GlobalHash
GlobalHash(ArrayRef< uint8_t > S)
Definition: CodeViewYAMLTypeHashing.h:36
llvm::CodeViewYAML::DebugHSection::HashAlgorithm
uint16_t HashAlgorithm
Definition: CodeViewYAMLTypeHashing.h:45
llvm::CodeViewYAML::GlobalHash::GlobalHash
GlobalHash(StringRef S)
Definition: CodeViewYAMLTypeHashing.h:33
YAML.h
llvm::CodeViewYAML::DebugHSection::Magic
uint32_t Magic
Definition: CodeViewYAMLTypeHashing.h:43
llvm::CodeViewYAML::GlobalHash::GlobalHash
GlobalHash()=default
llvm::None
const NoneType None
Definition: None.h:23
LLVM_YAML_DECLARE_SCALAR_TRAITS
#define LLVM_YAML_DECLARE_SCALAR_TRAITS(Type, MustQuote)
llvm::CodeViewYAML::DebugHSection::Hashes
std::vector< GlobalHash > Hashes
Definition: CodeViewYAMLTypeHashing.h:46
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
ArrayRef.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::CodeViewYAML::toDebugH
ArrayRef< uint8_t > toDebugH(const DebugHSection &DebugH, BumpPtrAllocator &Alloc)
Definition: CodeViewYAMLTypeHashing.cpp:67
llvm::CodeViewYAML::fromDebugH
DebugHSection fromDebugH(ArrayRef< uint8_t > DebugH)
Definition: CodeViewYAMLTypeHashing.cpp:48
YAMLTraits.h
llvm::ArrayRef< uint8_t >
TypeHashing.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::yaml::BinaryRef
Specialized YAMLIO scalar type for representing a binary blob.
Definition: YAML.h:63
uint32_t
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::CodeViewYAML::DebugHSection
Definition: CodeViewYAMLTypeHashing.h:42
uint16_t
llvm::CodeViewYAML::GlobalHash::Hash
yaml::BinaryRef Hash
Definition: CodeViewYAMLTypeHashing.h:39