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
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user