1515#include " bolt/Core/GDBIndex.h"
1616#include " llvm/ADT/StringRef.h"
1717#include " llvm/CodeGen/DIE.h"
18- #include " llvm/DWP/DWP.h"
1918#include " llvm/MC/MCContext.h"
2019#include " llvm/Support/ToolOutputFile.h"
2120#include < cstdint>
@@ -41,13 +40,6 @@ class DWARFRewriter {
4140 uint64_t TypeHash;
4241 uint64_t TypeDIERelativeOffset;
4342 };
44- // / Contains information for CU or TU so we can output correct {cu, tu}-index.
45- struct UnitMeta {
46- uint64_t Offset;
47- uint64_t Length;
48- uint64_t TUHash;
49- };
50- using UnitMetaVectorType = std::vector<UnitMeta>;
5143
5244private:
5345 BinaryContext &BC;
@@ -194,35 +186,6 @@ class DWARFRewriter {
194186 const std::string &, DebugLocWriter &,
195187 DebugStrOffsetsWriter &, DebugStrWriter &);
196188 using KnownSectionsEntry = std::pair<MCSection *, DWARFSectionKind>;
197- struct DWPState {
198- std::unique_ptr<ToolOutputFile> Out;
199- std::unique_ptr<BinaryContext> TmpBC;
200- std::unique_ptr<MCStreamer> Streamer;
201- std::unique_ptr<DWPStringPool> Strings;
202- // / Used to store String sections for .dwo files if they are being modified.
203- std::vector<std::unique_ptr<DebugBufferVector>> StrSections;
204- const MCObjectFileInfo *MCOFI = nullptr ;
205- const DWARFUnitIndex *CUIndex = nullptr ;
206- std::deque<SmallString<32 >> UncompressedSections;
207- MapVector<uint64_t , UnitIndexEntry> IndexEntries;
208- MapVector<uint64_t , UnitIndexEntry> TypeIndexEntries;
209- StringMap<KnownSectionsEntry> KnownSections;
210- uint32_t ContributionOffsets[8 ] = {};
211- uint32_t IndexVersion = 2 ;
212- uint64_t DebugInfoSize = 0 ;
213- uint16_t Version = 0 ;
214- bool IsDWP = false ;
215- };
216- // / Init .dwp file
217- void initDWPState (DWPState &);
218-
219- // / Write out .dwp File
220- void finalizeDWP (DWPState &);
221-
222- // / add content of dwo to .dwp file.
223- void updateDWP (DWARFUnit &, const OverriddenSectionsMap &, const UnitMeta &,
224- UnitMetaVectorType &, DWPState &, DebugLocWriter &,
225- DebugStrOffsetsWriter &, DebugStrWriter &);
226189};
227190
228191} // namespace bolt
0 commit comments