[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
diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp
index ca4d435..5fc999f 100644
--- a/lldb/source/API/SBSection.cpp
+++ b/lldb/source/API/SBSection.cpp
@@ -288,3 +288,41 @@
 
   return true;
 }
+
+namespace lldb_private {
+namespace repro {
+
+template <>
+void RegisterMethods<SBSection>(Registry &R) {
+  LLDB_REGISTER_CONSTRUCTOR(SBSection, ());
+  LLDB_REGISTER_CONSTRUCTOR(SBSection, (const lldb::SBSection &));
+  LLDB_REGISTER_METHOD(const lldb::SBSection &,
+                       SBSection, operator=,(const lldb::SBSection &));
+  LLDB_REGISTER_METHOD_CONST(bool, SBSection, IsValid, ());
+  LLDB_REGISTER_METHOD_CONST(bool, SBSection, operator bool, ());
+  LLDB_REGISTER_METHOD(const char *, SBSection, GetName, ());
+  LLDB_REGISTER_METHOD(lldb::SBSection, SBSection, GetParent, ());
+  LLDB_REGISTER_METHOD(lldb::SBSection, SBSection, FindSubSection,
+                       (const char *));
+  LLDB_REGISTER_METHOD(size_t, SBSection, GetNumSubSections, ());
+  LLDB_REGISTER_METHOD(lldb::SBSection, SBSection, GetSubSectionAtIndex,
+                       (size_t));
+  LLDB_REGISTER_METHOD(lldb::addr_t, SBSection, GetFileAddress, ());
+  LLDB_REGISTER_METHOD(lldb::addr_t, SBSection, GetLoadAddress,
+                       (lldb::SBTarget &));
+  LLDB_REGISTER_METHOD(lldb::addr_t, SBSection, GetByteSize, ());
+  LLDB_REGISTER_METHOD(uint64_t, SBSection, GetFileOffset, ());
+  LLDB_REGISTER_METHOD(uint64_t, SBSection, GetFileByteSize, ());
+  LLDB_REGISTER_METHOD(lldb::SBData, SBSection, GetSectionData, ());
+  LLDB_REGISTER_METHOD(lldb::SBData, SBSection, GetSectionData,
+                       (uint64_t, uint64_t));
+  LLDB_REGISTER_METHOD(lldb::SectionType, SBSection, GetSectionType, ());
+  LLDB_REGISTER_METHOD_CONST(uint32_t, SBSection, GetPermissions, ());
+  LLDB_REGISTER_METHOD(uint32_t, SBSection, GetTargetByteSize, ());
+  LLDB_REGISTER_METHOD(bool, SBSection, operator==,(const lldb::SBSection &));
+  LLDB_REGISTER_METHOD(bool, SBSection, operator!=,(const lldb::SBSection &));
+  LLDB_REGISTER_METHOD(bool, SBSection, GetDescription, (lldb::SBStream &));
+}
+
+}
+}