diff options
author | Sterling Augustine <saugustine@google.com> | 2020-03-19 17:26:13 -0700 |
---|---|---|
committer | Sterling Augustine <saugustine@google.com> | 2020-03-20 10:29:57 -0700 |
commit | 5de4ba1770f4815dd36d449a9b64b0aec783159d (patch) | |
tree | 142fd4136043240e0b5e87c56acecafdffe6465e /llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | |
parent | 3205d1a860367f7ab77d331f03086eeed194e44c (diff) | |
download | llvm-5de4ba1770f4815dd36d449a9b64b0aec783159d.zip llvm-5de4ba1770f4815dd36d449a9b64b0aec783159d.tar.gz llvm-5de4ba1770f4815dd36d449a9b64b0aec783159d.tar.bz2 |
Cleanup the plumbing for DILineInfoSpecifier. [NFC - Try 2]
Diffstat (limited to 'llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp index b4d49d9..9835fc0 100644 --- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp +++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp @@ -35,12 +35,6 @@ using namespace llvm; using namespace object; using namespace symbolize; -static DILineInfoSpecifier -getDILineInfoSpecifier(FunctionNameKind FNKind) { - return DILineInfoSpecifier( - DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, FNKind); -} - ErrorOr<std::unique_ptr<SymbolizableObjectFile>> SymbolizableObjectFile::create(const object::ObjectFile *Obj, std::unique_ptr<DIContext> DICtx, @@ -251,16 +245,16 @@ bool SymbolizableObjectFile::shouldOverrideWithSymbolTable( DILineInfo SymbolizableObjectFile::symbolizeCode(object::SectionedAddress ModuleOffset, - FunctionNameKind FNKind, + DILineInfoSpecifier LineInfoSpecifier, bool UseSymbolTable) const { if (ModuleOffset.SectionIndex == object::SectionedAddress::UndefSection) ModuleOffset.SectionIndex = getModuleSectionIndexForAddress(ModuleOffset.Address); - DILineInfo LineInfo = DebugInfoContext->getLineInfoForAddress( - ModuleOffset, getDILineInfoSpecifier(FNKind)); + DILineInfo LineInfo = + DebugInfoContext->getLineInfoForAddress(ModuleOffset, LineInfoSpecifier); // Override function name from symbol table if necessary. - if (shouldOverrideWithSymbolTable(FNKind, UseSymbolTable)) { + if (shouldOverrideWithSymbolTable(LineInfoSpecifier.FNKind, UseSymbolTable)) { std::string FunctionName; uint64_t Start, Size; if (getNameFromSymbolTable(SymbolRef::ST_Function, ModuleOffset.Address, @@ -272,20 +266,20 @@ SymbolizableObjectFile::symbolizeCode(object::SectionedAddress ModuleOffset, } DIInliningInfo SymbolizableObjectFile::symbolizeInlinedCode( - object::SectionedAddress ModuleOffset, FunctionNameKind FNKind, - bool UseSymbolTable) const { + object::SectionedAddress ModuleOffset, + DILineInfoSpecifier LineInfoSpecifier, bool UseSymbolTable) const { if (ModuleOffset.SectionIndex == object::SectionedAddress::UndefSection) ModuleOffset.SectionIndex = getModuleSectionIndexForAddress(ModuleOffset.Address); DIInliningInfo InlinedContext = DebugInfoContext->getInliningInfoForAddress( - ModuleOffset, getDILineInfoSpecifier(FNKind)); + ModuleOffset, LineInfoSpecifier); // Make sure there is at least one frame in context. if (InlinedContext.getNumberOfFrames() == 0) InlinedContext.addFrame(DILineInfo()); // Override the function name in lower frame with name from symbol table. - if (shouldOverrideWithSymbolTable(FNKind, UseSymbolTable)) { + if (shouldOverrideWithSymbolTable(LineInfoSpecifier.FNKind, UseSymbolTable)) { std::string FunctionName; uint64_t Start, Size; if (getNameFromSymbolTable(SymbolRef::ST_Function, ModuleOffset.Address, |