diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-10-30 00:02:55 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-10-30 00:02:55 +0000 |
commit | e46bd74147deea850370ee8a1802543b8486dc10 (patch) | |
tree | 1ee772ea819b4c9b820694e0c761ea98b7749384 /llvm/lib/DebugInfo | |
parent | 14323e02e64416c91a66d27c4abb160a86ccab9b (diff) | |
download | bcm5719-llvm-e46bd74147deea850370ee8a1802543b8486dc10.tar.gz bcm5719-llvm-e46bd74147deea850370ee8a1802543b8486dc10.zip |
[LLVMSymbolize] Simplify SymbolizableObjectFile::symbolizeInlinedCode(). NFC.
llvm-svn: 251672
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp index fb2873e8159..d3a54ca8d47 100644 --- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp +++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp @@ -217,26 +217,18 @@ DIInliningInfo SymbolizableObjectFile::symbolizeInlinedCode( if (InlinedContext.getNumberOfFrames() == 0) InlinedContext.addFrame(DILineInfo()); - if (FNKind != FunctionNameKind::LinkageName || !UseSymbolTable) - return InlinedContext; - // Override the function name in lower frame with name from symbol table. - // We can't directly change the last element of DIInliningInfo, so copy - // all frames into new context, replacing function name in the last one. - DIInliningInfo PatchedInlinedContext; - for (uint32_t i = 0, n = InlinedContext.getNumberOfFrames(); i < n; i++) { - DILineInfo LineInfo = InlinedContext.getFrame(i); - if (i == n - 1) { - std::string FunctionName; - uint64_t Start, Size; - if (getNameFromSymbolTable(SymbolRef::ST_Function, ModuleOffset, - FunctionName, Start, Size)) { - LineInfo.FunctionName = FunctionName; - } + if (FNKind == FunctionNameKind::LinkageName && UseSymbolTable) { + std::string FunctionName; + uint64_t Start, Size; + if (getNameFromSymbolTable(SymbolRef::ST_Function, ModuleOffset, + FunctionName, Start, Size)) { + InlinedContext.getMutableFrame(InlinedContext.getNumberOfFrames() - 1) + ->FunctionName = FunctionName; } - PatchedInlinedContext.addFrame(LineInfo); } - return PatchedInlinedContext; + + return InlinedContext; } DIGlobal SymbolizableObjectFile::symbolizeData(uint64_t ModuleOffset) const { |