diff options
author | Zachary Turner <zturner@google.com> | 2018-12-07 19:34:02 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-12-07 19:34:02 +0000 |
commit | a42bbe3981645c03222161e7d292fdb794f14f56 (patch) | |
tree | 6f454ff41cc5ba7696a5101b49fd00fcede0e089 /llvm/lib/DebugInfo/CodeView | |
parent | 992fc88111578d04b21ed1f9c5ade82a502423d5 (diff) | |
download | bcm5719-llvm-a42bbe3981645c03222161e7d292fdb794f14f56.tar.gz bcm5719-llvm-a42bbe3981645c03222161e7d292fdb794f14f56.zip |
[NativePDB] Reconstruct function declarations from debug info.
Previously we would create an lldb::Function object for each function
parsed, but we would not add these to the clang AST. This is a first
step towards getting local variable support working, as we first need an
AST decl so that when we create local variable entries, they have the
proper DeclContext.
Differential Revision: https://reviews.llvm.org/D55384
llvm-svn: 348631
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView')
-rw-r--r-- | llvm/lib/DebugInfo/CodeView/SymbolRecordHelpers.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/SymbolRecordHelpers.cpp b/llvm/lib/DebugInfo/CodeView/SymbolRecordHelpers.cpp index f44fc8f01df..79f39591929 100644 --- a/llvm/lib/DebugInfo/CodeView/SymbolRecordHelpers.cpp +++ b/llvm/lib/DebugInfo/CodeView/SymbolRecordHelpers.cpp @@ -50,4 +50,15 @@ llvm::codeview::getScopeEndOffset(const llvm::codeview::CVSymbol &Sym) { assert(false && "Unknown record type"); return 0; } -}
\ No newline at end of file +} + +CVSymbolArray +llvm::codeview::limitSymbolArrayToScope(const CVSymbolArray &Symbols, + uint32_t ScopeBegin) { + CVSymbol Opener = *Symbols.at(ScopeBegin); + assert(symbolOpensScope(Opener.kind())); + uint32_t EndOffset = getScopeEndOffset(Opener); + CVSymbol Closer = *Symbols.at(EndOffset); + EndOffset += Closer.RecordData.size(); + return Symbols.substream(ScopeBegin, EndOffset); +} |