Index: include/llvm/ExecutionEngine/ObjectMemoryBuffer.h =================================================================== --- include/llvm/ExecutionEngine/ObjectMemoryBuffer.h +++ include/llvm/ExecutionEngine/ObjectMemoryBuffer.h @@ -56,6 +56,7 @@ private: SmallVector SV; std::string BufferName; + void anchor() override; }; } // namespace llvm Index: include/llvm/ExecutionEngine/RTDyldMemoryManager.h =================================================================== --- include/llvm/ExecutionEngine/RTDyldMemoryManager.h +++ include/llvm/ExecutionEngine/RTDyldMemoryManager.h @@ -47,6 +47,9 @@ /// newly loaded object. virtual void notifyObjectLoaded(ExecutionEngine *EE, const object::ObjectFile &) {} + +private: + void anchor() override; }; // RuntimeDyld clients often want to handle the memory management of @@ -142,6 +145,9 @@ }; typedef std::vector EHFrameInfos; EHFrameInfos EHFrames; + +private: + void anchor() override; }; // Create wrappers for C Binding types (see CBindingWrapping.h). Index: include/llvm/ExecutionEngine/SectionMemoryManager.h =================================================================== --- include/llvm/ExecutionEngine/SectionMemoryManager.h +++ include/llvm/ExecutionEngine/SectionMemoryManager.h @@ -182,6 +182,8 @@ std::error_code applyMemoryGroupPermissions(MemoryGroup &MemGroup, unsigned Permissions); + void anchor() override; + MemoryGroup CodeMem; MemoryGroup RWDataMem; MemoryGroup RODataMem; Index: include/llvm/Support/MemoryBuffer.h =================================================================== --- include/llvm/Support/MemoryBuffer.h +++ include/llvm/Support/MemoryBuffer.h @@ -148,6 +148,9 @@ virtual BufferKind getBufferKind() const = 0; MemoryBufferRef getMemBufferRef() const; + +private: + virtual void anchor(); }; /// This class is an extension of MemoryBuffer, which allows copy-on-write Index: include/llvm/Support/raw_ostream.h =================================================================== --- include/llvm/Support/raw_ostream.h +++ include/llvm/Support/raw_ostream.h @@ -329,6 +329,8 @@ /// Copy data into the buffer. Size must not be greater than the number of /// unused bytes in the buffer. void copy_to_buffer(const char *Ptr, size_t Size); + + virtual void anchor(); }; /// An abstract base class for streams implementations that also support a @@ -336,6 +338,7 @@ /// but needs to patch in a header that needs to know the output size. class raw_pwrite_stream : public raw_ostream { virtual void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) = 0; + void anchor() override; public: explicit raw_pwrite_stream(bool Unbuffered = false) @@ -383,6 +386,8 @@ /// Set the flag indicating that an output error has been encountered. void error_detected(std::error_code EC) { this->EC = EC; } + void anchor() override; + public: /// Open the specified file for writing. If an error occurs, information /// about the error is put into EC, and the stream should be immediately Index: lib/ExecutionEngine/MCJIT/MCJIT.h =================================================================== --- lib/ExecutionEngine/MCJIT/MCJIT.h +++ lib/ExecutionEngine/MCJIT/MCJIT.h @@ -42,6 +42,7 @@ private: MCJIT &ParentEngine; std::shared_ptr ClientResolver; + void anchor() override; }; // About Module states: added->loaded->finalized. Index: lib/ExecutionEngine/MCJIT/MCJIT.cpp =================================================================== --- lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -28,6 +28,8 @@ using namespace llvm; +void llvm::ObjectMemoryBuffer::anchor() {} + namespace { static struct RegisterJIT { @@ -665,3 +667,5 @@ return nullptr; return ClientResolver->findSymbol(Name); } + +void LinkingSymbolResolver::anchor() {} Index: lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp =================================================================== --- lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp +++ lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp @@ -298,4 +298,6 @@ return (void*)Addr; } +void RTDyldMemoryManager::anchor() {} +void MCJITMemoryManager::anchor() {} } // namespace llvm Index: lib/ExecutionEngine/SectionMemoryManager.cpp =================================================================== --- lib/ExecutionEngine/SectionMemoryManager.cpp +++ lib/ExecutionEngine/SectionMemoryManager.cpp @@ -232,6 +232,8 @@ SectionMemoryManager::MemoryMapper::~MemoryMapper() {} +void SectionMemoryManager::anchor() {} + namespace { // Trivial implementation of SectionMemoryManager::MemoryMapper that just calls // into sys::Memory. Index: lib/LTO/LLVMBuild.txt =================================================================== --- lib/LTO/LLVMBuild.txt +++ lib/LTO/LLVMBuild.txt @@ -37,3 +37,4 @@ Support Target TransformUtils + MCJIT Index: lib/Support/MemoryBuffer.cpp =================================================================== --- lib/Support/MemoryBuffer.cpp +++ lib/Support/MemoryBuffer.cpp @@ -531,3 +531,5 @@ StringRef Identifier = getBufferIdentifier(); return MemoryBufferRef(Data, Identifier); } + +void MemoryBuffer::anchor() {} Index: lib/Support/raw_ostream.cpp =================================================================== --- lib/Support/raw_ostream.cpp +++ lib/Support/raw_ostream.cpp @@ -474,6 +474,8 @@ return *this; } +void raw_ostream::anchor() {} + //===----------------------------------------------------------------------===// // Formatted Output //===----------------------------------------------------------------------===// @@ -727,6 +729,8 @@ return sys::Process::FileDescriptorHasColors(FD); } +void raw_fd_ostream::anchor() {} + //===----------------------------------------------------------------------===// // outs(), errs(), nulls() //===----------------------------------------------------------------------===// @@ -804,3 +808,5 @@ void raw_null_ostream::pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) {} + +void raw_pwrite_stream::anchor() {}