LLVM  6.0.0svn
DebugChecksumsSubsection.h
Go to the documentation of this file.
1 //===- DebugChecksumsSubsection.h -------------------------------*- 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 #ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGCHECKSUMSSUBSECTION_H
11 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGCHECKSUMSSUBSECTION_H
12 
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/DenseMap.h"
15 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/Allocator.h"
22 #include "llvm/Support/Error.h"
23 #include <cstdint>
24 #include <vector>
25 
26 namespace llvm {
27 
28 namespace codeview {
29 
30 class DebugStringTableSubsection;
31 
33  uint32_t FileNameOffset; // Byte offset of filename in global stringtable.
34  FileChecksumKind Kind; // The type of checksum.
35  ArrayRef<uint8_t> Checksum; // The bytes of the checksum.
36 };
37 
38 } // end namespace codeview
39 
40 template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
41 public:
42  using ContextType = void;
43 
44  Error operator()(BinaryStreamRef Stream, uint32_t &Len,
46 };
47 
48 namespace codeview {
49 
53 
54 public:
57 
58  static bool classof(const DebugSubsectionRef *S) {
60  }
61 
62  bool valid() const { return Checksums.valid(); }
63 
66 
67  Iterator begin() const { return Checksums.begin(); }
68  Iterator end() const { return Checksums.end(); }
69 
70  const FileChecksumArray &getArray() const { return Checksums; }
71 
72 private:
73  FileChecksumArray Checksums;
74 };
75 
77 public:
79 
80  static bool classof(const DebugSubsection *S) {
82  }
83 
84  void addChecksum(StringRef FileName, FileChecksumKind Kind,
85  ArrayRef<uint8_t> Bytes);
86 
87  uint32_t calculateSerializedSize() const override;
88  Error commit(BinaryStreamWriter &Writer) const override;
89  uint32_t mapChecksumOffset(StringRef FileName) const;
90 
91 private:
93 
95  uint32_t SerializedSize = 0;
96  BumpPtrAllocator Storage;
97  std::vector<FileChecksumEntry> Checksums;
98 };
99 
100 } // end namespace codeview
101 
102 } // end namespace llvm
103 
104 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCHECKSUMSSUBSECTION_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
static bool classof(const DebugSubsection *S)
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic...
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:138
Provides write only access to a subclass of WritableBinaryStream.
Represents a read-write view of a CodeView string table.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
VarStreamArray represents an array of variable length records backed by a stream. ...
DebugSubsectionKind kind() const
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringRef > StandardNames)
initialize - Initialize the set of available library functions based on the specified target triple...
static bool classof(const DebugSubsectionRef *S)
Lightweight error class with error context and mandatory checking.
Definition: Error.h:156
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
DebugSubsectionKind kind() const