Skip to content

Commit

Permalink
[Minidump] Add extern template declarations for MinidumpFile::getList…
Browse files Browse the repository at this point in the history
…Stream

Add extern template defs along with visibility macros to MinidumpFile::getListStream
thats needed by MinidumpTest.cpp when llvm is built as shared library on windows
with explicit visibility macros enabled.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM plugins on window.
  • Loading branch information
fsfod committed Oct 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9255850 commit 12e26d1
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions llvm/include/llvm/Object/Minidump.h
Original file line number Diff line number Diff line change
@@ -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.
@@ -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
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

6 changes: 3 additions & 3 deletions llvm/lib/Object/Minidump.cpp
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 12e26d1

Please sign in to comment.