Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minidump] Add extern template declarations for MinidumpFile::getListStream #112568

Merged
merged 2 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions llvm/include/llvm/Object/Minidump.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@
#include "llvm/ADT/iterator.h"
#include "llvm/BinaryFormat/Minidump.h"
#include "llvm/Object/Binary.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"

namespace llvm {
namespace minidump {
struct Module;
struct Thread;
struct MemoryDescriptor;
} // namespace minidump
namespace object {

/// A class providing access to the contents of a minidump file.
Expand Down Expand Up @@ -371,6 +377,14 @@ Expected<ArrayRef<T>> MinidumpFile::getDataSliceAs(ArrayRef<uint8_t> Data,
return ArrayRef<T>(reinterpret_cast<const T *>(Slice->data()), Count);
}

// Needed by MinidumpTest.cpp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this? This is bound to get out of date over time. (In fact it's probably out of date already, as I suspect lldb needs this as well, but nobody is building it in a configuration where it matters).

extern template LLVM_TEMPLATE_ABI Expected<ArrayRef<minidump::Module>>
MinidumpFile::getListStream(minidump::StreamType) const;
extern template LLVM_TEMPLATE_ABI Expected<ArrayRef<minidump::Thread>>
MinidumpFile::getListStream(minidump::StreamType) const;
extern template LLVM_TEMPLATE_ABI Expected<ArrayRef<minidump::MemoryDescriptor>>
MinidumpFile::getListStream(minidump::StreamType) const;

} // end namespace object
} // end namespace llvm

Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Object/Minidump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ Expected<ArrayRef<T>> MinidumpFile::getListStream(StreamType Type) const {

return getDataSliceAs<T>(*Stream, ListOffset, ListSize);
}
template Expected<ArrayRef<Module>>
template LLVM_EXPORT_TEMPLATE Expected<ArrayRef<Module>>
MinidumpFile::getListStream(StreamType) const;
template Expected<ArrayRef<Thread>>
template LLVM_EXPORT_TEMPLATE Expected<ArrayRef<Thread>>
MinidumpFile::getListStream(StreamType) const;
template Expected<ArrayRef<MemoryDescriptor>>
template LLVM_EXPORT_TEMPLATE Expected<ArrayRef<MemoryDescriptor>>
MinidumpFile::getListStream(StreamType) const;

Expected<ArrayRef<uint8_t>> MinidumpFile::getDataSlice(ArrayRef<uint8_t> Data,
Expand Down
Loading