[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/SBCompileUnit.cpp b/lldb/source/API/SBCompileUnit.cpp
index 2372e0e5..9693dc9 100644
--- a/lldb/source/API/SBCompileUnit.cpp
+++ b/lldb/source/API/SBCompileUnit.cpp
@@ -237,3 +237,42 @@
return true;
}
+
+namespace lldb_private {
+namespace repro {
+
+template <>
+void RegisterMethods<SBCompileUnit>(Registry &R) {
+ LLDB_REGISTER_CONSTRUCTOR(SBCompileUnit, ());
+ LLDB_REGISTER_CONSTRUCTOR(SBCompileUnit, (const lldb::SBCompileUnit &));
+ LLDB_REGISTER_METHOD(
+ const lldb::SBCompileUnit &,
+ SBCompileUnit, operator=,(const lldb::SBCompileUnit &));
+ LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBCompileUnit, GetFileSpec,
+ ());
+ LLDB_REGISTER_METHOD_CONST(uint32_t, SBCompileUnit, GetNumLineEntries, ());
+ LLDB_REGISTER_METHOD_CONST(lldb::SBLineEntry, SBCompileUnit,
+ GetLineEntryAtIndex, (uint32_t));
+ LLDB_REGISTER_METHOD_CONST(uint32_t, SBCompileUnit, FindLineEntryIndex,
+ (uint32_t, uint32_t, lldb::SBFileSpec *));
+ LLDB_REGISTER_METHOD_CONST(uint32_t, SBCompileUnit, FindLineEntryIndex,
+ (uint32_t, uint32_t, lldb::SBFileSpec *, bool));
+ LLDB_REGISTER_METHOD_CONST(uint32_t, SBCompileUnit, GetNumSupportFiles, ());
+ LLDB_REGISTER_METHOD(lldb::SBTypeList, SBCompileUnit, GetTypes, (uint32_t));
+ LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBCompileUnit,
+ GetSupportFileAtIndex, (uint32_t));
+ LLDB_REGISTER_METHOD(uint32_t, SBCompileUnit, FindSupportFileIndex,
+ (uint32_t, const lldb::SBFileSpec &, bool));
+ LLDB_REGISTER_METHOD(lldb::LanguageType, SBCompileUnit, GetLanguage, ());
+ LLDB_REGISTER_METHOD_CONST(bool, SBCompileUnit, IsValid, ());
+ LLDB_REGISTER_METHOD_CONST(bool, SBCompileUnit, operator bool, ());
+ LLDB_REGISTER_METHOD_CONST(
+ bool, SBCompileUnit, operator==,(const lldb::SBCompileUnit &));
+ LLDB_REGISTER_METHOD_CONST(
+ bool, SBCompileUnit, operator!=,(const lldb::SBCompileUnit &));
+ LLDB_REGISTER_METHOD(bool, SBCompileUnit, GetDescription,
+ (lldb::SBStream &));
+}
+
+}
+}