llvm.org GIT mirror llvm / 08a3e83
Symbolize: Remove dead code. NFCI. The only caller of SymbolizableObjectFile::create passes a non-null DebugInfoContext and asserts that they do so. Move the assert into SymbolizableObjectFile::create and remove null checks. Differential Revision: https://reviews.llvm.org/D63298 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363334 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 3 months ago
2 changed file(s) with 7 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
4343 ErrorOr>
4444 SymbolizableObjectFile::create(object::ObjectFile *Obj,
4545 std::unique_ptr DICtx) {
46 assert(DICtx);
4647 std::unique_ptr res(
4748 new SymbolizableObjectFile(Obj, std::move(DICtx)));
4849 std::unique_ptr OpdExtractor;
243244 SymbolizableObjectFile::symbolizeCode(object::SectionedAddress ModuleOffset,
244245 FunctionNameKind FNKind,
245246 bool UseSymbolTable) const {
246 DILineInfo LineInfo;
247
248247 if (ModuleOffset.SectionIndex == object::SectionedAddress::UndefSection)
249248 ModuleOffset.SectionIndex =
250249 getModuleSectionIndexForAddress(ModuleOffset.Address);
251
252 if (DebugInfoContext) {
253 LineInfo = DebugInfoContext->getLineInfoForAddress(
254 ModuleOffset, getDILineInfoSpecifier(FNKind));
255 }
250 DILineInfo LineInfo = DebugInfoContext->getLineInfoForAddress(
251 ModuleOffset, getDILineInfoSpecifier(FNKind));
252
256253 // Override function name from symbol table if necessary.
257254 if (shouldOverrideWithSymbolTable(FNKind, UseSymbolTable)) {
258255 std::string FunctionName;
268265 DIInliningInfo SymbolizableObjectFile::symbolizeInlinedCode(
269266 object::SectionedAddress ModuleOffset, FunctionNameKind FNKind,
270267 bool UseSymbolTable) const {
271 DIInliningInfo InlinedContext;
272
273268 if (ModuleOffset.SectionIndex == object::SectionedAddress::UndefSection)
274269 ModuleOffset.SectionIndex =
275270 getModuleSectionIndexForAddress(ModuleOffset.Address);
276
277 if (DebugInfoContext)
278 InlinedContext = DebugInfoContext->getInliningInfoForAddress(
279 ModuleOffset, getDILineInfoSpecifier(FNKind));
271 DIInliningInfo InlinedContext = DebugInfoContext->getInliningInfoForAddress(
272 ModuleOffset, getDILineInfoSpecifier(FNKind));
273
280274 // Make sure there is at least one frame in context.
281275 if (InlinedContext.getNumberOfFrames() == 0)
282276 InlinedContext.addFrame(DILineInfo());
424424 Context =
425425 DWARFContext::create(*Objects.second, nullptr,
426426 DWARFContext::defaultErrorHandler, Opts.DWPName);
427 assert(Context);
428427 auto InfoOrErr =
429428 SymbolizableObjectFile::create(Objects.first, std::move(Context));
430429 std::unique_ptr SymMod;