[Lldb-commits] [PATCH] D42955: Make Module::GetSectionList output consistent

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 22 08:25:27 PST 2018


clayborg added a comment.

Back from vacation, sorry for the delay. Only one question on who is actually responsible for creating the sections. I vote to let SymbolVendor::CreateSection() always do the work. Let me know what you think.



================
Comment at: source/Core/Module.cpp:1283-1284
   if (!m_sections_ap) {
-    ObjectFile *obj_file = GetObjectFile();
-    if (obj_file != nullptr)
+    if (ObjectFile *obj_file = GetObjectFile())
       obj_file->CreateSections(*GetUnifiedSectionList());
+    if (SymbolVendor *vendor = GetSymbolVendor())
----------------
If we are going to let the symbol vendor do it's thing, then we should probably not manually call ObjectFile::CreateSections. The idea behind SymbolVendor is that _it_ knows how best to do things for one or more object files. Can we move all logic for parsing sections into the SymbolVendor::CreateSections()?


https://reviews.llvm.org/D42955





More information about the lldb-commits mailing list