diff options
| author | Michal Gorny <mgorny@gentoo.org> | 2019-03-19 17:13:13 +0000 |
|---|---|---|
| committer | Michal Gorny <mgorny@gentoo.org> | 2019-03-19 17:13:13 +0000 |
| commit | ae211ece6a90c367ef0cdbabad3110aba3fcda67 (patch) | |
| tree | 5d2f5ce1ffe5332ccb1e1682daad3f365a2f38e0 /lldb/source/API/SBStructuredData.cpp | |
| parent | 982a35eb1df71b10b721cfbf732a8fbf0d94ea7f (diff) | |
[lldb] [Reproducer] Move SBRegistry registration into declaring files
Move SBRegistry method registrations from SBReproducer.cpp into files
declaring the individual APIs, in order to reduce the memory consumption
during build and improve maintainability. The current humongous
SBRegistry constructor exhausts all memory on a NetBSD system with 4G
RAM + 4G swap, therefore making it impossible to build LLDB.
Differential Revision: https://reviews.llvm.org/D59427
llvm-svn: 356481
Diffstat (limited to 'lldb/source/API/SBStructuredData.cpp')
| -rw-r--r-- | lldb/source/API/SBStructuredData.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lldb/source/API/SBStructuredData.cpp b/lldb/source/API/SBStructuredData.cpp index 97d771dfaf91..347dfaed34aa 100644 --- a/lldb/source/API/SBStructuredData.cpp +++ b/lldb/source/API/SBStructuredData.cpp @@ -201,3 +201,47 @@ size_t SBStructuredData::GetStringValue(char *dst, size_t dst_len) const { return (m_impl_up ? m_impl_up->GetStringValue(dst, dst_len) : 0); } + +namespace lldb_private { +namespace repro { + +template <> +void RegisterMethods<SBStructuredData>(Registry &R) { + LLDB_REGISTER_CONSTRUCTOR(SBStructuredData, ()); + LLDB_REGISTER_CONSTRUCTOR(SBStructuredData, + (const lldb::SBStructuredData &)); + LLDB_REGISTER_CONSTRUCTOR(SBStructuredData, (const lldb::EventSP &)); + LLDB_REGISTER_CONSTRUCTOR(SBStructuredData, + (lldb_private::StructuredDataImpl *)); + LLDB_REGISTER_METHOD( + lldb::SBStructuredData &, + SBStructuredData, operator=,(const lldb::SBStructuredData &)); + LLDB_REGISTER_METHOD(lldb::SBError, SBStructuredData, SetFromJSON, + (lldb::SBStream &)); + LLDB_REGISTER_METHOD_CONST(bool, SBStructuredData, IsValid, ()); + LLDB_REGISTER_METHOD_CONST(bool, SBStructuredData, operator bool, ()); + LLDB_REGISTER_METHOD(void, SBStructuredData, Clear, ()); + LLDB_REGISTER_METHOD_CONST(lldb::SBError, SBStructuredData, GetAsJSON, + (lldb::SBStream &)); + LLDB_REGISTER_METHOD_CONST(lldb::SBError, SBStructuredData, GetDescription, + (lldb::SBStream &)); + LLDB_REGISTER_METHOD_CONST(lldb::StructuredDataType, SBStructuredData, + GetType, ()); + LLDB_REGISTER_METHOD_CONST(size_t, SBStructuredData, GetSize, ()); + LLDB_REGISTER_METHOD_CONST(bool, SBStructuredData, GetKeys, + (lldb::SBStringList &)); + LLDB_REGISTER_METHOD_CONST(lldb::SBStructuredData, SBStructuredData, + GetValueForKey, (const char *)); + LLDB_REGISTER_METHOD_CONST(lldb::SBStructuredData, SBStructuredData, + GetItemAtIndex, (size_t)); + LLDB_REGISTER_METHOD_CONST(uint64_t, SBStructuredData, GetIntegerValue, + (uint64_t)); + LLDB_REGISTER_METHOD_CONST(double, SBStructuredData, GetFloatValue, + (double)); + LLDB_REGISTER_METHOD_CONST(bool, SBStructuredData, GetBooleanValue, (bool)); + LLDB_REGISTER_METHOD_CONST(size_t, SBStructuredData, GetStringValue, + (char *, size_t)); +} + +} +} |
