diff options
author | Sterling Augustine <saugustine@google.com> | 2020-03-18 15:49:49 -0700 |
---|---|---|
committer | Sterling Augustine <saugustine@google.com> | 2020-03-19 16:56:43 -0700 |
commit | 98ff6eb679cd5a2556d990d3d629e6c03c1da6a0 (patch) | |
tree | c6a0f4b2f792a2f560cc9bc8c8b23cf6d1ed1ec7 /llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | |
parent | c999084619a61daffac39f0ec9ea3c801e5a8823 (diff) | |
download | llvm-98ff6eb679cd5a2556d990d3d629e6c03c1da6a0.zip llvm-98ff6eb679cd5a2556d990d3d629e6c03c1da6a0.tar.gz llvm-98ff6eb679cd5a2556d990d3d629e6c03c1da6a0.tar.bz2 |
Cleanup the plumbing for DILineInfoSpecifier. [NFC]
Summary:
1. FileLineInfoSpecifier::Default isn't the default for anything.
Rename to RawValue, which accurately reflects its role.
2. Most functions that take a part of a FileLineInfoSpecifier end up
constructing a full one later or plumb two values through. Make them
all just take a complete FileLineInfoSpecifier.
3. Printing basenames only was handled differently from all other
variants, make it parallel to all the other variants.
Reviewers: jhenderson
Subscribers: hiraditya, MaskRay, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76394
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, |