Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:21

0001 //==- CodeViewYAMLTypeHashing.h - CodeView YAMLIO Type hashing ----*- C++-*-==//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines classes for handling the YAML representation of CodeView
0010 // Debug Info.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H
0015 #define LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H
0016 
0017 #include "llvm/ADT/ArrayRef.h"
0018 #include "llvm/DebugInfo/CodeView/TypeHashing.h"
0019 #include "llvm/ObjectYAML/YAML.h"
0020 #include "llvm/Support/Allocator.h"
0021 #include "llvm/Support/Error.h"
0022 #include "llvm/Support/YAMLTraits.h"
0023 #include <cstdint>
0024 #include <memory>
0025 #include <vector>
0026 
0027 namespace llvm {
0028 
0029 namespace CodeViewYAML {
0030 
0031 struct GlobalHash {
0032   GlobalHash() = default;
0033   explicit GlobalHash(StringRef S) : Hash(S) {
0034     assert(S.size() == 8 && "Invalid hash size!");
0035   }
0036   explicit GlobalHash(ArrayRef<uint8_t> S) : Hash(S) {
0037     assert(S.size() == 8 && "Invalid hash size!");
0038   }
0039   yaml::BinaryRef Hash;
0040 };
0041 
0042 struct DebugHSection {
0043   uint32_t Magic;
0044   uint16_t Version;
0045   uint16_t HashAlgorithm;
0046   std::vector<GlobalHash> Hashes;
0047 };
0048 
0049 DebugHSection fromDebugH(ArrayRef<uint8_t> DebugH);
0050 ArrayRef<uint8_t> toDebugH(const DebugHSection &DebugH,
0051                            BumpPtrAllocator &Alloc);
0052 
0053 } // end namespace CodeViewYAML
0054 
0055 } // end namespace llvm
0056 
0057 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::DebugHSection)
0058 LLVM_YAML_DECLARE_SCALAR_TRAITS(CodeViewYAML::GlobalHash, QuotingType::None)
0059 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::GlobalHash)
0060 
0061 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLTYPEHASHING_H