Skip to content

Commit 12e26d1

Browse files
committed
[Minidump] Add extern template declarations for MinidumpFile::getListStream
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.
1 parent 9255850 commit 12e26d1

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

llvm/include/llvm/Object/Minidump.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@
1515
#include "llvm/ADT/iterator.h"
1616
#include "llvm/BinaryFormat/Minidump.h"
1717
#include "llvm/Object/Binary.h"
18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/Support/Error.h"
1920

2021
namespace llvm {
22+
namespace minidump {
23+
struct Module;
24+
struct Thread;
25+
struct MemoryDescriptor;
26+
} // namespace minidump
2127
namespace object {
2228

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

380+
// Needed by MinidumpTest.cpp
381+
extern template LLVM_TEMPLATE_ABI Expected<ArrayRef<minidump::Module>>
382+
MinidumpFile::getListStream(minidump::StreamType) const;
383+
extern template LLVM_TEMPLATE_ABI Expected<ArrayRef<minidump::Thread>>
384+
MinidumpFile::getListStream(minidump::StreamType) const;
385+
extern template LLVM_TEMPLATE_ABI Expected<ArrayRef<minidump::MemoryDescriptor>>
386+
MinidumpFile::getListStream(minidump::StreamType) const;
387+
374388
} // end namespace object
375389
} // end namespace llvm
376390

llvm/lib/Object/Minidump.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ Expected<ArrayRef<T>> MinidumpFile::getListStream(StreamType Type) const {
9898

9999
return getDataSliceAs<T>(*Stream, ListOffset, ListSize);
100100
}
101-
template Expected<ArrayRef<Module>>
101+
template LLVM_EXPORT_TEMPLATE Expected<ArrayRef<Module>>
102102
MinidumpFile::getListStream(StreamType) const;
103-
template Expected<ArrayRef<Thread>>
103+
template LLVM_EXPORT_TEMPLATE Expected<ArrayRef<Thread>>
104104
MinidumpFile::getListStream(StreamType) const;
105-
template Expected<ArrayRef<MemoryDescriptor>>
105+
template LLVM_EXPORT_TEMPLATE Expected<ArrayRef<MemoryDescriptor>>
106106
MinidumpFile::getListStream(StreamType) const;
107107

108108
Expected<ArrayRef<uint8_t>> MinidumpFile::getDataSlice(ArrayRef<uint8_t> Data,

0 commit comments

Comments
 (0)