diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-02-13 06:25:41 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-02-13 06:25:41 +0000 |
| commit | d5b440369dbb0d41e6ecd47d6ac7410201e27f17 (patch) | |
| tree | 4dc2e3c44bcd3e14143715fa86584862b2290f9f /lldb/source/Plugins/ObjectFile/ELF | |
| parent | 5cf777e41387c84518a9ff2ec1222058daf54e58 (diff) | |
| download | bcm5719-llvm-d5b440369dbb0d41e6ecd47d6ac7410201e27f17.tar.gz bcm5719-llvm-d5b440369dbb0d41e6ecd47d6ac7410201e27f17.zip | |
Replace 'ap' with 'up' suffix in variable names. (NFC)
The `ap` suffix is a remnant of lldb's former use of auto pointers,
before they got deprecated. Although all their uses were replaced by
unique pointers, some variables still carried the suffix.
In r353795 I removed another auto_ptr remnant, namely redundant calls to
::get for unique_pointers. Jim justly noted that this is a good
opportunity to clean up the variable names as well.
I went over all the changes to ensure my find-and-replace didn't have
any undesired side-effects. I hope I didn't miss any, but if you end up
at this commit doing a git blame on a weirdly named variable, please
know that the change was unintentional.
llvm-svn: 353912
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF')
| -rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 74 | ||||
| -rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | 6 |
2 files changed, 40 insertions, 40 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index eaafa84db03..e6a39dbc54d 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -435,11 +435,11 @@ ObjectFile *ObjectFileELF::CreateInstance(const lldb::ModuleSP &module_sp, unsigned address_size = ELFHeader::AddressSizeInBytes(magic); if (address_size == 4 || address_size == 8) { - std::unique_ptr<ObjectFileELF> objfile_ap(new ObjectFileELF( + std::unique_ptr<ObjectFileELF> objfile_up(new ObjectFileELF( module_sp, data_sp, data_offset, file, file_offset, length)); - ArchSpec spec = objfile_ap->GetArchitecture(); - if (spec && objfile_ap->SetModulesArchitecture(spec)) - return objfile_ap.release(); + ArchSpec spec = objfile_up->GetArchitecture(); + if (spec && objfile_up->SetModulesArchitecture(spec)) + return objfile_up.release(); } return NULL; @@ -453,11 +453,11 @@ ObjectFile *ObjectFileELF::CreateMemoryInstance( if (ELFHeader::MagicBytesMatch(magic)) { unsigned address_size = ELFHeader::AddressSizeInBytes(magic); if (address_size == 4 || address_size == 8) { - std::unique_ptr<ObjectFileELF> objfile_ap( + std::unique_ptr<ObjectFileELF> objfile_up( new ObjectFileELF(module_sp, data_sp, process_sp, header_addr)); - ArchSpec spec = objfile_ap->GetArchitecture(); - if (spec && objfile_ap->SetModulesArchitecture(spec)) - return objfile_ap.release(); + ArchSpec spec = objfile_up->GetArchitecture(); + if (spec && objfile_up->SetModulesArchitecture(spec)) + return objfile_up.release(); } } } @@ -774,7 +774,7 @@ ObjectFileELF::ObjectFileELF(const lldb::ModuleSP &module_sp, : ObjectFile(module_sp, file, file_offset, length, data_sp, data_offset), m_header(), m_uuid(), m_gnu_debuglink_file(), m_gnu_debuglink_crc(0), m_program_headers(), m_section_headers(), m_dynamic_symbols(), - m_filespec_ap(), m_entry_point_address(), m_arch_spec() { + m_filespec_up(), m_entry_point_address(), m_arch_spec() { if (file) m_file = *file; ::memset(&m_header, 0, sizeof(m_header)); @@ -787,7 +787,7 @@ ObjectFileELF::ObjectFileELF(const lldb::ModuleSP &module_sp, : ObjectFile(module_sp, process_sp, header_addr, header_data_sp), m_header(), m_uuid(), m_gnu_debuglink_file(), m_gnu_debuglink_crc(0), m_program_headers(), m_section_headers(), m_dynamic_symbols(), - m_filespec_ap(), m_entry_point_address(), m_arch_spec() { + m_filespec_up(), m_entry_point_address(), m_arch_spec() { ::memset(&m_header, 0, sizeof(m_header)); } @@ -950,7 +950,7 @@ uint32_t ObjectFileELF::GetDependentModules(FileSpecList &files) { uint32_t num_specs = 0; for (unsigned i = 0; i < num_modules; ++i) { - if (files.AppendIfUnique(m_filespec_ap->GetFileSpecAtIndex(i))) + if (files.AppendIfUnique(m_filespec_up->GetFileSpecAtIndex(i))) num_specs++; } @@ -1057,10 +1057,10 @@ Address ObjectFileELF::GetBaseAddress() { // ParseDependentModules //---------------------------------------------------------------------- size_t ObjectFileELF::ParseDependentModules() { - if (m_filespec_ap) - return m_filespec_ap->GetSize(); + if (m_filespec_up) + return m_filespec_up->GetSize(); - m_filespec_ap.reset(new FileSpecList()); + m_filespec_up.reset(new FileSpecList()); if (!ParseSectionHeaders()) return 0; @@ -1107,11 +1107,11 @@ size_t ObjectFileELF::ParseDependentModules() { const char *lib_name = dynstr_data.PeekCStr(str_index); FileSpec file_spec(lib_name); FileSystem::Instance().Resolve(file_spec); - m_filespec_ap->Append(file_spec); + m_filespec_up->Append(file_spec); } } - return m_filespec_ap->GetSize(); + return m_filespec_up->GetSize(); } //---------------------------------------------------------------------- @@ -1931,10 +1931,10 @@ public: } void ObjectFileELF::CreateSections(SectionList &unified_section_list) { - if (m_sections_ap) + if (m_sections_up) return; - m_sections_ap = llvm::make_unique<SectionList>(); + m_sections_up = llvm::make_unique<SectionList>(); VMAddressProvider address_provider(CalculateType()); size_t LoadID = 0; @@ -1954,7 +1954,7 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) { eSectionTypeContainer, InfoOr->GetRangeBase(), InfoOr->GetByteSize(), PHdr.p_offset, PHdr.p_filesz, Log2Align, /*flags*/ 0); Segment->SetPermissions(GetPermissions(PHdr)); - m_sections_ap->AddSection(Segment); + m_sections_up->AddSection(Segment); address_provider.AddSegment(*InfoOr, std::move(Segment)); } @@ -2000,7 +2000,7 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) { section_sp->SetPermissions(GetPermissions(header)); section_sp->SetIsThreadSpecific(header.sh_flags & SHF_TLS); - (InfoOr->Segment ? InfoOr->Segment->GetChildren() : *m_sections_ap) + (InfoOr->Segment ? InfoOr->Segment->GetChildren() : *m_sections_up) .AddSection(section_sp); address_provider.AddSection(std::move(*InfoOr), std::move(section_sp)); } @@ -2008,7 +2008,7 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) { // For eTypeDebugInfo files, the Symbol Vendor will take care of updating the // unified section list. if (GetType() != eTypeDebugInfo) - unified_section_list = *m_sections_ap; + unified_section_list = *m_sections_up; } // Find the arm/aarch64 mapping symbol character in the given symbol name. @@ -2384,7 +2384,7 @@ unsigned ObjectFileELF::ParseSymbolTable(Symtab *symbol_table, } // Get section list for this object file. - SectionList *section_list = m_sections_ap.get(); + SectionList *section_list = m_sections_up.get(); if (!section_list) return 0; @@ -2612,7 +2612,7 @@ ObjectFileELF::ParseTrampolineSymbols(Symtab *symbol_table, user_id_t start_id, if (!sym_hdr) return 0; - SectionList *section_list = m_sections_ap.get(); + SectionList *section_list = m_sections_up.get(); if (!section_list) return 0; @@ -2805,7 +2805,7 @@ Symtab *ObjectFileELF::GetSymtab() { if (module_obj_file && module_obj_file != this) return module_obj_file->GetSymtab(); - if (m_symtab_ap == NULL) { + if (m_symtab_up == NULL) { SectionList *section_list = module_sp->GetSectionList(); if (!section_list) return NULL; @@ -2829,8 +2829,8 @@ Symtab *ObjectFileELF::GetSymtab() { .get(); } if (symtab) { - m_symtab_ap.reset(new Symtab(symtab->GetObjectFile())); - symbol_id += ParseSymbolTable(m_symtab_ap.get(), symbol_id, symtab); + m_symtab_up.reset(new Symtab(symtab->GetObjectFile())); + symbol_id += ParseSymbolTable(m_symtab_up.get(), symbol_id, symtab); } // DT_JMPREL @@ -2854,30 +2854,30 @@ Symtab *ObjectFileELF::GetSymtab() { GetSectionHeaderByIndex(reloc_id); assert(reloc_header); - if (m_symtab_ap == nullptr) - m_symtab_ap.reset(new Symtab(reloc_section->GetObjectFile())); + if (m_symtab_up == nullptr) + m_symtab_up.reset(new Symtab(reloc_section->GetObjectFile())); - ParseTrampolineSymbols(m_symtab_ap.get(), symbol_id, reloc_header, + ParseTrampolineSymbols(m_symtab_up.get(), symbol_id, reloc_header, reloc_id); } } DWARFCallFrameInfo *eh_frame = GetUnwindTable().GetEHFrameInfo(); if (eh_frame) { - if (m_symtab_ap == nullptr) - m_symtab_ap.reset(new Symtab(this)); - ParseUnwindSymbols(m_symtab_ap.get(), eh_frame); + if (m_symtab_up == nullptr) + m_symtab_up.reset(new Symtab(this)); + ParseUnwindSymbols(m_symtab_up.get(), eh_frame); } // If we still don't have any symtab then create an empty instance to avoid // do the section lookup next time. - if (m_symtab_ap == nullptr) - m_symtab_ap.reset(new Symtab(this)); + if (m_symtab_up == nullptr) + m_symtab_up.reset(new Symtab(this)); - m_symtab_ap->CalculateSymbolSizes(); + m_symtab_up->CalculateSymbolSizes(); } - return m_symtab_ap.get(); + return m_symtab_up.get(); } void ObjectFileELF::RelocateSection(lldb_private::Section *section) @@ -3276,7 +3276,7 @@ void ObjectFileELF::DumpDependentModules(lldb_private::Stream *s) { if (num_modules > 0) { s->PutCString("Dependent Modules:\n"); for (unsigned i = 0; i < num_modules; ++i) { - const FileSpec &spec = m_filespec_ap->GetFileSpecAtIndex(i); + const FileSpec &spec = m_filespec_up->GetFileSpecAtIndex(i); s->Printf(" %s\n", spec.GetFilename().GetCString()); } } diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index fb51212a0a5..668cfa36566 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -210,7 +210,7 @@ private: /// List of file specifications corresponding to the modules (shared /// libraries) on which this object file depends. - mutable std::unique_ptr<lldb_private::FileSpecList> m_filespec_ap; + mutable std::unique_ptr<lldb_private::FileSpecList> m_filespec_up; /// Cached value of the entry point for this module. lldb_private::Address m_entry_point_address; @@ -264,7 +264,7 @@ private: lldb_private::ArchSpec &arch_spec); /// Scans the dynamic section and locates all dependent modules (shared - /// libraries) populating m_filespec_ap. This method will compute the + /// libraries) populating m_filespec_up. This method will compute the /// dependent module list only once. Returns the number of dependent /// modules parsed. size_t ParseDependentModules(); @@ -274,7 +274,7 @@ private: /// number of dynamic symbols parsed. size_t ParseDynamicSymbols(); - /// Populates m_symtab_ap will all non-dynamic linker symbols. This method + /// Populates m_symtab_up will all non-dynamic linker symbols. This method /// will parse the symbols only once. Returns the number of symbols parsed. unsigned ParseSymbolTable(lldb_private::Symtab *symbol_table, lldb::user_id_t start_id, |

