Skip to content

Commit

Permalink
[BOLT][DWARF] Remove option to write to DWP (llvm#100771)
Browse files Browse the repository at this point in the history
Remove the --write-dwp option as well as related code and tests.
  • Loading branch information
sayhaan committed Jul 30, 2024
1 parent 546e4a2 commit 79dcd93
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 529 deletions.
37 changes: 0 additions & 37 deletions bolt/include/bolt/Rewrite/DWARFRewriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "bolt/Core/GDBIndex.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/DIE.h"
#include "llvm/DWP/DWP.h"
#include "llvm/MC/MCContext.h"
#include "llvm/Support/ToolOutputFile.h"
#include <cstdint>
Expand All @@ -41,13 +40,6 @@ class DWARFRewriter {
uint64_t TypeHash;
uint64_t TypeDIERelativeOffset;
};
/// Contains information for CU or TU so we can output correct {cu, tu}-index.
struct UnitMeta {
uint64_t Offset;
uint64_t Length;
uint64_t TUHash;
};
using UnitMetaVectorType = std::vector<UnitMeta>;

private:
BinaryContext &BC;
Expand Down Expand Up @@ -194,35 +186,6 @@ class DWARFRewriter {
const std::string &, DebugLocWriter &,
DebugStrOffsetsWriter &, DebugStrWriter &);
using KnownSectionsEntry = std::pair<MCSection *, DWARFSectionKind>;
struct DWPState {
std::unique_ptr<ToolOutputFile> Out;
std::unique_ptr<BinaryContext> TmpBC;
std::unique_ptr<MCStreamer> Streamer;
std::unique_ptr<DWPStringPool> Strings;
/// Used to store String sections for .dwo files if they are being modified.
std::vector<std::unique_ptr<DebugBufferVector>> StrSections;
const MCObjectFileInfo *MCOFI = nullptr;
const DWARFUnitIndex *CUIndex = nullptr;
std::deque<SmallString<32>> UncompressedSections;
MapVector<uint64_t, UnitIndexEntry> IndexEntries;
MapVector<uint64_t, UnitIndexEntry> TypeIndexEntries;
StringMap<KnownSectionsEntry> KnownSections;
uint32_t ContributionOffsets[8] = {};
uint32_t IndexVersion = 2;
uint64_t DebugInfoSize = 0;
uint16_t Version = 0;
bool IsDWP = false;
};
/// Init .dwp file
void initDWPState(DWPState &);

/// Write out .dwp File
void finalizeDWP(DWPState &);

/// add content of dwo to .dwp file.
void updateDWP(DWARFUnit &, const OverriddenSectionsMap &, const UnitMeta &,
UnitMetaVectorType &, DWPState &, DebugLocWriter &,
DebugStrOffsetsWriter &, DebugStrWriter &);
};

} // namespace bolt
Expand Down
1 change: 0 additions & 1 deletion bolt/lib/Rewrite/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(LLVM_LINK_COMPONENTS
Core
DebugInfoDWARF
DWP
JITLink
MC
Object
Expand Down
Loading

0 comments on commit 79dcd93

Please sign in to comment.