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:
Jonas Devlieghere
2019-02-13 06:25:41 +00:00
parent 5cf777e413
commit d5b440369d
190 changed files with 1963 additions and 1959 deletions

View File

@@ -83,16 +83,16 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(const lldb::ModuleSP &module_sp,
return nullptr;
}
auto objfile_ap = llvm::make_unique<ObjectFilePECOFF>(
auto objfile_up = llvm::make_unique<ObjectFilePECOFF>(
module_sp, data_sp, data_offset, file, file_offset, length);
if (!objfile_ap || !objfile_ap->ParseHeader())
if (!objfile_up || !objfile_up->ParseHeader())
return nullptr;
// Cache coff binary.
if (!objfile_ap->CreateBinary())
if (!objfile_up->CreateBinary())
return nullptr;
return objfile_ap.release();
return objfile_up.release();
}
ObjectFile *ObjectFilePECOFF::CreateMemoryInstance(
@@ -100,10 +100,10 @@ ObjectFile *ObjectFilePECOFF::CreateMemoryInstance(
const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) {
if (!data_sp || !ObjectFilePECOFF::MagicBytesMatch(data_sp))
return nullptr;
auto objfile_ap = llvm::make_unique<ObjectFilePECOFF>(
auto objfile_up = llvm::make_unique<ObjectFilePECOFF>(
module_sp, data_sp, process_sp, header_addr);
if (objfile_ap.get() && objfile_ap->ParseHeader()) {
return objfile_ap.release();
if (objfile_up.get() && objfile_up->ParseHeader()) {
return objfile_up.release();
}
return nullptr;
}
@@ -477,13 +477,13 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t offset, size_t size) {
ProcessSP process_sp(m_process_wp.lock());
DataExtractor data;
if (process_sp) {
auto data_ap = llvm::make_unique<DataBufferHeap>(size, 0);
auto data_up = llvm::make_unique<DataBufferHeap>(size, 0);
Status readmem_error;
size_t bytes_read =
process_sp->ReadMemory(m_image_base + offset, data_ap->GetBytes(),
data_ap->GetByteSize(), readmem_error);
process_sp->ReadMemory(m_image_base + offset, data_up->GetBytes(),
data_up->GetByteSize(), readmem_error);
if (bytes_read == size) {
DataBufferSP buffer_sp(data_ap.release());
DataBufferSP buffer_sp(data_up.release());
data.SetData(buffer_sp, 0, buffer_sp->GetByteSize());
}
}
@@ -552,10 +552,10 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
if (m_symtab_ap == NULL) {
if (m_symtab_up == NULL) {
SectionList *sect_list = GetSectionList();
m_symtab_ap.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> guard(m_symtab_ap->GetMutex());
m_symtab_up.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> guard(m_symtab_up->GetMutex());
const uint32_t num_syms = m_coff_header.nsyms;
@@ -579,7 +579,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
offset = 0;
std::string symbol_name;
Symbol *symbols = m_symtab_ap->Resize(num_syms);
Symbol *symbols = m_symtab_up->Resize(num_syms);
for (uint32_t i = 0; i < num_syms; ++i) {
coff_symbol_t symbol;
const uint32_t symbol_offset = offset;
@@ -660,7 +660,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
lldb::offset_t name_ordinal_offset =
export_table.address_of_name_ordinals - data_start;
Symbol *symbols = m_symtab_ap->Resize(export_table.number_of_names);
Symbol *symbols = m_symtab_up->Resize(export_table.number_of_names);
std::string symbol_name;
@@ -687,10 +687,10 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
symbols[i].SetDebug(true);
}
}
m_symtab_ap->CalculateSymbolSizes();
m_symtab_up->CalculateSymbolSizes();
}
}
return m_symtab_ap.get();
return m_symtab_up.get();
}
bool ObjectFilePECOFF::IsStripped() {
@@ -699,9 +699,9 @@ bool ObjectFilePECOFF::IsStripped() {
}
void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
if (m_sections_ap)
if (m_sections_up)
return;
m_sections_ap.reset(new SectionList());
m_sections_up.reset(new SectionList());
ModuleSP module_sp(GetModule());
if (module_sp) {
@@ -832,7 +832,7 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
// section_sp->SetIsEncrypted (segment_is_encrypted);
unified_section_list.AddSection(section_sp);
m_sections_ap->AddSection(section_sp);
m_sections_up->AddSection(section_sp);
}
}
}
@@ -948,8 +948,8 @@ void ObjectFilePECOFF::Dump(Stream *s) {
if (sections)
sections->Dump(s, NULL, true, UINT32_MAX);
if (m_symtab_ap)
m_symtab_ap->Dump(s, NULL, eSortOrderNone);
if (m_symtab_up)
m_symtab_up->Dump(s, NULL, eSortOrderNone);
if (m_dos_header.e_magic)
DumpDOSHeader(s, m_dos_header);