Skip to content

Commit f2080cb

Browse files
committed
Remove the linked list through metadata caches, since LLDB is
no longer using it even in fallback code.
1 parent 5ffb151 commit f2080cb

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

stdlib/public/runtime/Metadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace {
157157
struct GenericCacheEntry;
158158

159159
// The cache entries in a generic cache are laid out like this:
160-
struct GenericCacheEntryHeader : CacheEntry<GenericCacheEntry> {
160+
struct GenericCacheEntryHeader {
161161
const Metadata *Value;
162162
size_t NumArguments;
163163
};

stdlib/public/runtime/MetadataCache.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,7 @@ class KeyDataRef {
125125
};
126126

127127
template <class Impl>
128-
struct CacheEntryHeader {
129-
/// LLDB walks this list.
130-
/// FIXME: when LLDB stops walking this list, there will stop being
131-
/// any reason to store argument data in cache entries, and a *ton*
132-
/// of weird stuff here will go away.
133-
const Impl *Next;
134-
};
128+
struct CacheEntryHeader {};
135129

136130
/// A CRTP class for defining entries in a metadata cache.
137131
template <class Impl, class Header = CacheEntryHeader<Impl> >
@@ -272,11 +266,6 @@ template <class ValueTy> class MetadataCache {
272266
static_assert(sizeof(Map) == 2 * sizeof(void*),
273267
"offset of Head is not at proper offset");
274268

275-
/// The head of a linked list connecting all the metadata cache entries.
276-
/// TODO: Remove this when LLDB is able to understand the final data
277-
/// structure for the metadata cache.
278-
const ValueTy *Head;
279-
280269
struct ConcurrencyControl {
281270
Mutex Lock;
282271
ConditionVariable Queue;
@@ -362,10 +351,6 @@ template <class ValueTy> class MetadataCache {
362351
// creating the metadata.
363352
auto value = builder();
364353

365-
// Update the linked list.
366-
value->Next = Head;
367-
Head = value;
368-
369354
#if SWIFT_DEBUG_RUNTIME
370355
printf("%s(%p): created %p\n",
371356
ValueTy::getName(), (void*) this, value);

0 commit comments

Comments
 (0)