[Lldb-commits] [lldb] r364702 - Use const auto *

Fangrui Song via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 28 17:55:13 PDT 2019


Author: maskray
Date: Fri Jun 28 17:55:13 2019
New Revision: 364702

URL: http://llvm.org/viewvc/llvm-project?rev=364702&view=rev
Log:
Use const auto *

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    lldb/trunk/source/Symbol/Block.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=364702&r1=364701&r2=364702&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Fri Jun 28 17:55:13 2019
@@ -51,7 +51,7 @@ bool DWARFDebugInfoEntry::Extract(const
 
   if (m_abbr_idx) {
     lldb::offset_t offset = *offset_ptr;
-    auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu);
+    const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu);
     if (abbrevDecl == nullptr) {
       cu->GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
           "{0x%8.8x}: invalid abbreviation code %u, please file a bug and "
@@ -232,7 +232,7 @@ bool DWARFDebugInfoEntry::GetDIENamesAnd
   std::vector<DWARFDIE> dies;
   bool set_frame_base_loclist_addr = false;
 
-  auto abbrevDecl = GetAbbreviationDeclarationPtr(cu);
+  const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu);
 
   SymbolFileDWARF &dwarf = cu->GetSymbolFileDWARF();
   lldb::ModuleSP module = dwarf.GetObjectFile()->GetModule();
@@ -415,7 +415,7 @@ void DWARFDebugInfoEntry::Dump(const DWA
     if (abbrCode != m_abbr_idx) {
       s.Printf("error: DWARF has been modified\n");
     } else if (abbrCode) {
-      auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu);
+      const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu);
       if (abbrevDecl) {
         s.PutCString(DW_TAG_value_to_name(abbrevDecl->Tag()));
         s.Printf(" [%u] %c\n", abbrCode, abbrevDecl->HasChildren() ? '*' : ' ');
@@ -546,7 +546,7 @@ void DWARFDebugInfoEntry::DumpAttribute(
 size_t DWARFDebugInfoEntry::GetAttributes(
     const DWARFUnit *cu, DWARFAttributes &attributes,
     uint32_t curr_depth) const {
-  auto abbrevDecl = GetAbbreviationDeclarationPtr(cu);
+  const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu);
   if (abbrevDecl) {
     const DWARFDataExtractor &data = cu->GetData();
     lldb::offset_t offset = GetFirstAttributeOffset();
@@ -606,7 +606,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttr
     const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &form_value,
     dw_offset_t *end_attr_offset_ptr,
     bool check_specification_or_abstract_origin) const {
-  if (auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu)) {
+  if (const auto *abbrevDecl = GetAbbreviationDeclarationPtr(cu)) {
     uint32_t attr_idx = abbrevDecl->FindAttributeIndex(attr);
 
     if (attr_idx != DW_INVALID_INDEX) {

Modified: lldb/trunk/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Block.cpp?rev=364702&r1=364701&r2=364702&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Block.cpp (original)
+++ lldb/trunk/source/Symbol/Block.cpp Fri Jun 28 17:55:13 2019
@@ -214,10 +214,10 @@ Block *Block::GetInlinedParent() {
 
 Block *Block::GetContainingInlinedBlockWithCallSite(
     const Declaration &find_call_site) {
-  auto inlined_block = GetContainingInlinedBlock();
+  Block *inlined_block = GetContainingInlinedBlock();
 
   while (inlined_block) {
-    auto function_info = inlined_block->GetInlinedFunctionInfo();
+    const auto *function_info = inlined_block->GetInlinedFunctionInfo();
 
     if (function_info &&
         function_info->GetCallSite().FileAndLineEqual(find_call_site))




More information about the lldb-commits mailing list