Skip to content

Commit 2a479c0

Browse files
Introduce the DIEDedupeTopLevelRef CAS Block
DIEDedupeTopLevelRef is a CAS block that holds no data and has references to DIEDataRef CAS blocks. This makes it easy to check that a DIETopLevelRef in a CAS is valid, as it should only have 3 references to it, a DIEDedupeTopLevelRef, a DIEAbbrevSetRef, and a DIEDistinctDataRef
1 parent 49c2c1f commit 2a479c0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

llvm/include/llvm/MCCAS/MCCASObjectV1.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ CASV1_SIMPLE_GROUP_REF(SymbolTableRef, mc:symbol_table)
4141
CASV1_SIMPLE_GROUP_REF(DebugStringSectionRef, mc:debug_string_section)
4242
CASV1_SIMPLE_GROUP_REF(DIEAbbrevSetRef, mc:debug_DIE_abbrev_set)
4343
CASV1_SIMPLE_GROUP_REF(DIETopLevelRef, mc:debug_DIE_top_level)
44+
CASV1_SIMPLE_GROUP_REF(DIEDedupeTopLevelRef, mc:debug_DIE_Dedupe_top_level)
4445

4546
#undef CASV1_SIMPLE_GROUP_REF
4647
#endif /* CASV1_SIMPLE_GPOUP_REF */

llvm/lib/MCCAS/MCCASObjectV1.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,6 +2918,16 @@ DIETopLevelRef::create(MCCASBuilder &MB, ArrayRef<cas::ObjectRef> Children) {
29182918
return get(B->build());
29192919
}
29202920

2921+
Expected<DIEDedupeTopLevelRef>
2922+
DIEDedupeTopLevelRef::create(MCCASBuilder &MB,
2923+
ArrayRef<cas::ObjectRef> Children) {
2924+
Expected<Builder> B = Builder::startNode(MB.Schema, KindString);
2925+
if (!B)
2926+
return B.takeError();
2927+
append_range(B->Refs, Children);
2928+
return get(B->build());
2929+
}
2930+
29212931
Expected<DIEDataRef> DIEDataRef::create(MCCASBuilder &MB,
29222932
ArrayRef<cas::ObjectRef> Children,
29232933
ArrayRef<char> Contents) {

0 commit comments

Comments
 (0)