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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fsfod
Copy link
Contributor

@fsfod fsfod commented Oct 16, 2024

Add extern template defs along with visibility macros to MinidumpFile::getListStream that is 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.

…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.
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 16, 2024

@llvm/pr-subscribers-llvm-binary-utilities

Author: Thomas Fransham (fsfod)

Changes

Add extern template defs along with visibility macros to MinidumpFile::getListStream that is 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.


Full diff: https://github.com/llvm/llvm-project/pull/112568.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Object/Minidump.h (+14)
  • (modified) llvm/lib/Object/Minidump.cpp (+3-3)
diff --git a/llvm/include/llvm/Object/Minidump.h b/llvm/include/llvm/Object/Minidump.h
index e6b21979ccaa1d..5002a2a54c7555 100644
--- a/llvm/include/llvm/Object/Minidump.h
+++ b/llvm/include/llvm/Object/Minidump.h
@@ -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
 
diff --git a/llvm/lib/Object/Minidump.cpp b/llvm/lib/Object/Minidump.cpp
index fe768c4c90711b..50d4c608456900 100644
--- a/llvm/lib/Object/Minidump.cpp
+++ b/llvm/lib/Object/Minidump.cpp
@@ -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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants