Author: Pavel Labath
Date: 2021-10-26T09:58:10+02:00
New Revision: b69564d94d90b83ccdcc501f811959c23aeec52a

URL: 
https://github.com/llvm/llvm-project/commit/b69564d94d90b83ccdcc501f811959c23aeec52a
DIFF: 
https://github.com/llvm/llvm-project/commit/b69564d94d90b83ccdcc501f811959c23aeec52a.diff

LOG: [lldb/DWARF] Move a declaration closer to its use

Adresses post-commit feedback on D112310.

Added: 
    

Modified: 
    lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index ad5b44365054a..f8715398a052e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -863,7 +863,6 @@ Function *SymbolFileDWARF::ParseFunction(CompileUnit 
&comp_unit,
 
   // Union of all ranges in the function DIE (if the function is
   // discontiguous)
-  AddressRange func_range;
   lldb::addr_t lowest_func_addr = ranges.GetMinRangeBase(0);
   lldb::addr_t highest_func_addr = ranges.GetMaxRangeEnd(0);
   if (lowest_func_addr == LLDB_INVALID_ADDRESS ||
@@ -872,6 +871,7 @@ Function *SymbolFileDWARF::ParseFunction(CompileUnit 
&comp_unit,
     return nullptr;
 
   ModuleSP module_sp(die.GetModule());
+  AddressRange func_range;
   func_range.GetBaseAddress().ResolveAddressUsingFileSections(
       lowest_func_addr, module_sp->GetSectionList());
   if (!func_range.GetBaseAddress().IsValid())


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to