[PATCH] D63298: Symbolize: Remove dead code. NFCI.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 15:46:57 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL363334: Symbolize: Remove dead code. NFCI. (authored by pcc, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D63298?vs=204627&id=204647#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63298/new/

https://reviews.llvm.org/D63298

Files:
  llvm/trunk/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
  llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp


Index: llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -425,7 +425,6 @@
     Context =
         DWARFContext::create(*Objects.second, nullptr,
                              DWARFContext::defaultErrorHandler, Opts.DWPName);
-  assert(Context);
   auto InfoOrErr =
       SymbolizableObjectFile::create(Objects.first, std::move(Context));
   std::unique_ptr<SymbolizableModule> SymMod;
Index: llvm/trunk/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
+++ llvm/trunk/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
@@ -44,6 +44,7 @@
 ErrorOr<std::unique_ptr<SymbolizableObjectFile>>
 SymbolizableObjectFile::create(object::ObjectFile *Obj,
                                std::unique_ptr<DIContext> DICtx) {
+  assert(DICtx);
   std::unique_ptr<SymbolizableObjectFile> res(
       new SymbolizableObjectFile(Obj, std::move(DICtx)));
   std::unique_ptr<DataExtractor> OpdExtractor;
@@ -244,16 +245,12 @@
 SymbolizableObjectFile::symbolizeCode(object::SectionedAddress ModuleOffset,
                                       FunctionNameKind FNKind,
                                       bool UseSymbolTable) const {
-  DILineInfo LineInfo;
-
   if (ModuleOffset.SectionIndex == object::SectionedAddress::UndefSection)
     ModuleOffset.SectionIndex =
         getModuleSectionIndexForAddress(ModuleOffset.Address);
+  DILineInfo LineInfo = DebugInfoContext->getLineInfoForAddress(
+      ModuleOffset, getDILineInfoSpecifier(FNKind));
 
-  if (DebugInfoContext) {
-    LineInfo = DebugInfoContext->getLineInfoForAddress(
-        ModuleOffset, getDILineInfoSpecifier(FNKind));
-  }
   // Override function name from symbol table if necessary.
   if (shouldOverrideWithSymbolTable(FNKind, UseSymbolTable)) {
     std::string FunctionName;
@@ -269,15 +266,12 @@
 DIInliningInfo SymbolizableObjectFile::symbolizeInlinedCode(
     object::SectionedAddress ModuleOffset, FunctionNameKind FNKind,
     bool UseSymbolTable) const {
-  DIInliningInfo InlinedContext;
-
   if (ModuleOffset.SectionIndex == object::SectionedAddress::UndefSection)
     ModuleOffset.SectionIndex =
         getModuleSectionIndexForAddress(ModuleOffset.Address);
+  DIInliningInfo InlinedContext = DebugInfoContext->getInliningInfoForAddress(
+      ModuleOffset, getDILineInfoSpecifier(FNKind));
 
-  if (DebugInfoContext)
-    InlinedContext = DebugInfoContext->getInliningInfoForAddress(
-        ModuleOffset, getDILineInfoSpecifier(FNKind));
   // Make sure there is at least one frame in context.
   if (InlinedContext.getNumberOfFrames() == 0)
     InlinedContext.addFrame(DILineInfo());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63298.204647.patch
Type: text/x-patch
Size: 2879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190613/08fa180e/attachment.bin>


More information about the llvm-commits mailing list