Skip to content

Commit db0871f

Browse files
Change DIEDataRef to be a SIMPLE_DATA_REF because it doesn't have any references
1 parent 038c057 commit db0871f

File tree

3 files changed

+2
-47
lines changed

3 files changed

+2
-47
lines changed

llvm/include/llvm/MCCAS/MCCASObjectV1.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ CASV1_SIMPLE_DATA_REF(DebugAbbrevUnoptRef, mc:debug_abbrev_unopt)
2525
CASV1_SIMPLE_DATA_REF(DistinctDebugLineRef, mc:debug_line_distinct_data)
2626
CASV1_SIMPLE_DATA_REF(DIEAbbrevRef, mc:debug_DIE_abbrev)
2727
CASV1_SIMPLE_DATA_REF(DIEDistinctDataRef, mc:debug_DIE_distinct_data)
28+
CASV1_SIMPLE_DATA_REF(DIEDataRef, mc:debug_DIE_data)
2829
CASV1_SIMPLE_DATA_REF(AddendsRef, mc:addends)
2930

3031
#undef CASV1_SIMPLE_DATA_REF

llvm/include/llvm/MCCAS/MCCASObjectV1.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -681,40 +681,6 @@ class DebugInfoSectionRef : public SpecificRef<DebugInfoSectionRef> {
681681
explicit DebugInfoSectionRef(SpecificRefT Ref) : SpecificRefT(Ref) {}
682682
};
683683

684-
class DIEDataRef : public SpecificRef<DIEDataRef> {
685-
using SpecificRefT = SpecificRef<DIEDataRef>;
686-
friend class SpecificRef<DIEDataRef>;
687-
688-
public:
689-
static constexpr StringLiteral KindString = "mc:debug_DIE_data";
690-
static Expected<DIEDataRef> create(MCCASBuilder &MB,
691-
ArrayRef<cas::ObjectRef> Children,
692-
ArrayRef<char> Contents);
693-
694-
static Expected<DIEDataRef> get(Expected<MCObjectProxy> Ref) {
695-
auto Specific = SpecificRefT::getSpecific(std::move(Ref));
696-
if (!Specific)
697-
return Specific.takeError();
698-
return DIEDataRef(*Specific);
699-
}
700-
static Expected<DIEDataRef> get(const MCSchema &Schema, cas::ObjectRef ID) {
701-
return get(Schema.get(ID));
702-
}
703-
static std::optional<DIEDataRef> Cast(MCObjectProxy Ref) {
704-
auto Specific = SpecificRefT::Cast(Ref);
705-
if (!Specific)
706-
return std::nullopt;
707-
return DIEDataRef(*Specific);
708-
}
709-
Expected<uint64_t> materialize(MCCASReader &Reader,
710-
ArrayRef<char> AbbrevSectionContents,
711-
ArrayRef<uint32_t> SecOffsetVals,
712-
raw_ostream *Stream = nullptr) const;
713-
714-
private:
715-
explicit DIEDataRef(SpecificRefT Ref) : SpecificRefT(Ref) {}
716-
};
717-
718684
struct LoadedDIETopLevel {
719685
SmallVector<StringRef, 0> AbbrevEntries;
720686
DIEDistinctDataRef DistinctData;

llvm/lib/MCCAS/MCCASObjectV1.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ Error MCSchema::fillCache() {
170170
PaddingRef::KindString,
171171
MCAssemblerRef::KindString,
172172
DebugInfoSectionRef::KindString,
173-
DIEDataRef::KindString,
174173
#define CASV1_SIMPLE_DATA_REF(RefName, IdentifierName) RefName::KindString,
175174
#define CASV1_SIMPLE_GROUP_REF(RefName, IdentifierName) RefName::KindString,
176175
#define MCFRAGMENT_NODE_REF(MCFragmentName, MCEnumName, MCEnumIdentifier) \
@@ -1893,7 +1892,7 @@ struct DIEDataWriter : public DataWriter {
18931892

18941893
/// Saves the main data stream and any children to a new DIEDataRef node.
18951894
Expected<DIEDataRef> getCASNode(MCCASBuilder &CASBuilder) {
1896-
auto Ref = DIEDataRef::create(CASBuilder, Children, Data);
1895+
auto Ref = DIEDataRef::create(CASBuilder, toStringRef(Data));
18971896
Data.clear();
18981897
return Ref;
18991898
}
@@ -2932,17 +2931,6 @@ DIEDedupeTopLevelRef::create(MCCASBuilder &MB,
29322931
return get(B->build());
29332932
}
29342933

2935-
Expected<DIEDataRef> DIEDataRef::create(MCCASBuilder &MB,
2936-
ArrayRef<cas::ObjectRef> Children,
2937-
ArrayRef<char> Contents) {
2938-
Expected<Builder> B = Builder::startNode(MB.Schema, KindString);
2939-
if (!B)
2940-
return B.takeError();
2941-
append_range(B->Refs, Children);
2942-
append_range(B->Data, toStringRef(Contents));
2943-
return get(B->build());
2944-
}
2945-
29462934
// Returns true if DIE should be placed in a separate CAS block.
29472935
static bool shouldCreateSeparateBlockFor(DWARFDie &DIE) {
29482936
dwarf::Tag Tag = DIE.getTag();

0 commit comments

Comments
 (0)