LLVM  8.0.1
DebugInlineeLinesSubsection.h
Go to the documentation of this file.
1 //===- DebugInlineeLinesSubsection.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_DEBUGINLINEELINESSUBSECTION_H
11 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGINLINEELINESSUBSECTION_H
12 
13 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Support/Endian.h"
22 #include "llvm/Support/Error.h"
23 #include <cstdint>
24 #include <vector>
25 
26 namespace llvm {
27 
28 namespace codeview {
29 
30 class DebugChecksumsSubsection;
31 
33  Normal, // CV_INLINEE_SOURCE_LINE_SIGNATURE
34  ExtraFiles // CV_INLINEE_SOURCE_LINE_SIGNATURE_EX
35 };
36 
38  TypeIndex Inlinee; // ID of the function that was inlined.
39  support::ulittle32_t FileID; // Offset into FileChecksums subsection.
40  support::ulittle32_t SourceLineNum; // First line of inlined code.
41  // If extra files present:
42  // ulittle32_t ExtraFileCount;
43  // ulittle32_t Files[];
44 };
45 
49 };
50 
51 } // end namespace codeview
52 
53 template <> struct VarStreamArrayExtractor<codeview::InlineeSourceLine> {
54  Error operator()(BinaryStreamRef Stream, uint32_t &Len,
56 
57  bool HasExtraFiles = false;
58 };
59 
60 namespace codeview {
61 
65 
66 public:
68 
69  static bool classof(const DebugSubsectionRef *S) {
71  }
72 
74  bool hasExtraFiles() const;
75 
76  Iterator begin() const { return Lines.begin(); }
77  Iterator end() const { return Lines.end(); }
78 
79 private:
80  InlineeLinesSignature Signature;
82 };
83 
85 public:
86  struct Entry {
87  std::vector<support::ulittle32_t> ExtraFiles;
89  };
90 
92  bool HasExtraFiles = false);
93 
94  static bool classof(const DebugSubsection *S) {
96  }
97 
98  Error commit(BinaryStreamWriter &Writer) const override;
99  uint32_t calculateSerializedSize() const override;
100 
101  void addInlineSite(TypeIndex FuncId, StringRef FileName, uint32_t SourceLine);
102  void addExtraFile(StringRef FileName);
103 
104  bool hasExtraFiles() const { return HasExtraFiles; }
105  void setHasExtraFiles(bool Has) { HasExtraFiles = Has; }
106 
107  std::vector<Entry>::const_iterator begin() const { return Entries.begin(); }
108  std::vector<Entry>::const_iterator end() const { return Entries.end(); }
109 
110 private:
111  DebugChecksumsSubsection &Checksums;
112  bool HasExtraFiles = false;
113  uint32_t ExtraFileCount = 0;
114  std::vector<Entry> Entries;
115 };
116 
117 } // end namespace codeview
118 
119 } // end namespace llvm
120 
121 #endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGINLINEELINESSUBSECTION_H
Profile::FuncID FuncId
Definition: Profile.cpp:321
This class represents lattice values for constants.
Definition: AllocatorList.h:24
static bool classof(const DebugSubsectionRef *S)
std::vector< Entry >::const_iterator end() const
VarStreamArrayExtractor is intended to be specialized to provide customized extraction logic...
std::vector< Entry >::const_iterator begin() const
A 32-bit type reference.
Definition: TypeIndex.h:96
static bool classof(const DebugSubsection *S)
Provides write only access to a subclass of WritableBinaryStream.
const InlineeSourceLineHeader * Header
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 the set of available library functions based on the specified target triple.
FixedStreamArray< support::ulittle32_t > ExtraFiles
Lightweight error class with error context and mandatory checking.
Definition: Error.h:158
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