003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/lib/ObjectYAML
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
lib
/
ObjectYAML
/
📁
..
📄
COFFEmitter.cpp
(23.04 KB)
📄
COFFYAML.cpp
(21.38 KB)
📄
CodeViewYAMLDebugSections.cpp
(33.73 KB)
📄
CodeViewYAMLSymbols.cpp
(22.05 KB)
📄
CodeViewYAMLTypeHashing.cpp
(2.89 KB)
📄
CodeViewYAMLTypes.cpp
(30.23 KB)
📄
DWARFEmitter.cpp
(18.58 KB)
📄
DWARFVisitor.cpp
(6.63 KB)
📄
DWARFVisitor.h
(2.8 KB)
📄
DWARFYAML.cpp
(8.96 KB)
📄
ELFEmitter.cpp
(67.52 KB)
📄
ELFYAML.cpp
(54.88 KB)
📄
MachOEmitter.cpp
(22.41 KB)
📄
MachOYAML.cpp
(21.85 KB)
📄
MinidumpEmitter.cpp
(8.41 KB)
📄
MinidumpYAML.cpp
(21.67 KB)
📄
ObjectYAML.cpp
(2.67 KB)
📄
WasmEmitter.cpp
(21.57 KB)
📄
WasmYAML.cpp
(20.39 KB)
📄
XCOFFYAML.cpp
(2.86 KB)
📄
YAML.cpp
(2.11 KB)
📄
yaml2obj.cpp
(2.22 KB)
Editing: CodeViewYAMLTypeHashing.cpp
//===- CodeViewYAMLTypeHashing.cpp - CodeView YAMLIO type hashing ---------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines classes for handling the YAML representation of CodeView // Debug Info. // //===----------------------------------------------------------------------===// #include "llvm/ObjectYAML/CodeViewYAMLTypeHashing.h" #include "llvm/BinaryFormat/COFF.h" #include "llvm/Support/BinaryByteStream.h" #include "llvm/Support/BinaryStreamReader.h" #include "llvm/Support/BinaryStreamWriter.h" using namespace llvm; using namespace llvm::codeview; using namespace llvm::CodeViewYAML; using namespace llvm::yaml; namespace llvm { namespace yaml { void MappingTraits<DebugHSection>::mapping(IO &io, DebugHSection &DebugH) { io.mapRequired("Version", DebugH.Version); io.mapRequired("HashAlgorithm", DebugH.HashAlgorithm); io.mapOptional("HashValues", DebugH.Hashes); } void ScalarTraits<GlobalHash>::output(const GlobalHash &GH, void *Ctx, raw_ostream &OS) { ScalarTraits<BinaryRef>::output(GH.Hash, Ctx, OS); } StringRef ScalarTraits<GlobalHash>::input(StringRef Scalar, void *Ctx, GlobalHash &GH) { return ScalarTraits<BinaryRef>::input(Scalar, Ctx, GH.Hash); } } // end namespace yaml } // end namespace llvm DebugHSection llvm::CodeViewYAML::fromDebugH(ArrayRef<uint8_t> DebugH) { assert(DebugH.size() >= 8); assert((DebugH.size() - 8) % 8 == 0); BinaryStreamReader Reader(DebugH, llvm::support::little); DebugHSection DHS; cantFail(Reader.readInteger(DHS.Magic)); cantFail(Reader.readInteger(DHS.Version)); cantFail(Reader.readInteger(DHS.HashAlgorithm)); while (Reader.bytesRemaining() != 0) { ArrayRef<uint8_t> S; cantFail(Reader.readBytes(S, 8)); DHS.Hashes.emplace_back(S); } assert(Reader.bytesRemaining() == 0); return DHS; } ArrayRef<uint8_t> llvm::CodeViewYAML::toDebugH(const DebugHSection &DebugH, BumpPtrAllocator &Alloc) { uint32_t Size = 8 + 8 * DebugH.Hashes.size(); uint8_t *Data = Alloc.Allocate<uint8_t>(Size); MutableArrayRef<uint8_t> Buffer(Data, Size); BinaryStreamWriter Writer(Buffer, llvm::support::little); cantFail(Writer.writeInteger(DebugH.Magic)); cantFail(Writer.writeInteger(DebugH.Version)); cantFail(Writer.writeInteger(DebugH.HashAlgorithm)); SmallString<8> Hash; for (const auto &H : DebugH.Hashes) { Hash.clear(); raw_svector_ostream OS(Hash); H.Hash.writeAsBinary(OS); assert((Hash.size() == 8) && "Invalid hash size!"); cantFail(Writer.writeFixedString(Hash)); } assert(Writer.bytesRemaining() == 0); return Buffer; }
Upload File
Create Folder