Summary: This patch adds anchor() for MemoryBuffer, raw_fd_ostream, RTDyldMemoryManager, SectionMemoryManager, etc.
Reviewers: jlebar, eli.friedman, dblaikie
Reviewed By: dblaikie
Subscribers: mehdi_amini, mgorny, dblaikie, weimingz, llvm-commits
Differential Revision: https://reviews.llvm.org/D45244
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329861
91177308-0d34-0410-b5e6-
96231b3b80d8
private:
SmallVector<char, 0> SV;
std::string BufferName;
+ void anchor() override;
};
} // namespace llvm
/// 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
};
typedef std::vector<EHFrame> EHFrameInfos;
EHFrameInfos EHFrames;
+
+private:
+ void anchor() override;
};
// Create wrappers for C Binding types (see CBindingWrapping.h).
std::error_code applyMemoryGroupPermissions(MemoryGroup &MemGroup,
unsigned Permissions);
+ void anchor() override;
+
MemoryGroup CodeMem;
MemoryGroup RWDataMem;
MemoryGroup RODataMem;
virtual BufferKind getBufferKind() const = 0;
MemoryBufferRef getMemBufferRef() const;
+
+private:
+ virtual void anchor();
};
/// This class is an extension of MemoryBuffer, which allows copy-on-write
/// 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
/// 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)
/// 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
using namespace llvm;
+void llvm::ObjectMemoryBuffer::anchor() {}
+
namespace {
static struct RegisterJIT {
return nullptr;
return ClientResolver->findSymbol(Name);
}
+
+void LinkingSymbolResolver::anchor() {}
private:
MCJIT &ParentEngine;
std::shared_ptr<LegacyJITSymbolResolver> ClientResolver;
+ void anchor() override;
};
// About Module states: added->loaded->finalized.
return (void*)Addr;
}
+void RTDyldMemoryManager::anchor() {}
+void MCJITMemoryManager::anchor() {}
} // namespace llvm
SectionMemoryManager::MemoryMapper::~MemoryMapper() {}
+void SectionMemoryManager::anchor() {}
+
namespace {
// Trivial implementation of SectionMemoryManager::MemoryMapper that just calls
// into sys::Memory.
Support
Target
TransformUtils
+ MCJIT
StringRef Identifier = getBufferIdentifier();
return MemoryBufferRef(Data, Identifier);
}
+
+void MemoryBuffer::anchor() {}
return *this;
}
+void raw_ostream::anchor() {}
+
//===----------------------------------------------------------------------===//
// Formatted Output
//===----------------------------------------------------------------------===//
return sys::Process::FileDescriptorHasColors(FD);
}
+void raw_fd_ostream::anchor() {}
+
//===----------------------------------------------------------------------===//
// outs(), errs(), nulls()
//===----------------------------------------------------------------------===//
void raw_null_ostream::pwrite_impl(const char *Ptr, size_t Size,
uint64_t Offset) {}
+
+void raw_pwrite_stream::anchor() {}