llvm.org GIT mirror llvm / 1125505
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348631 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 5 months ago
3 changed file(s) with 26 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
4949
5050 /// Given a symbol P for which symbolOpensScope(P) == true, return the
5151 /// corresponding end offset.
52 uint32_t getScopeEndOffset(const CVSymbol &symbol);
52 uint32_t getScopeEndOffset(const CVSymbol &Symbol);
53
54 CVSymbolArray limitSymbolArrayToScope(const CVSymbolArray &Symbols,
55 uint32_t ScopeBegin);
56
5357 } // namespace codeview
5458 } // namespace llvm
5559
111111 Iterator end() const { return Iterator(E); }
112112
113113 bool empty() const { return Stream.getLength() == 0; }
114
115 VarStreamArray substream(uint32_t Begin,
116 uint32_t End) const {
117 assert(Begin >= Skew);
118 // We should never cut off the beginning of the stream since it might be
119 // skewed, meaning the initial bytes are important.
120 BinaryStreamRef NewStream = Stream.slice(0, End);
121 return {NewStream, E, Begin};
122 }
114123
115124 /// given an offset into the array's underlying stream, return an
116125 /// iterator to the record at that offset. This is considered unsafe
4949 assert(false && "Unknown record type");
5050 return 0;
5151 }
52 }
52 }
53
54 CVSymbolArray
55 llvm::codeview::limitSymbolArrayToScope(const CVSymbolArray &Symbols,
56 uint32_t ScopeBegin) {
57 CVSymbol Opener = *Symbols.at(ScopeBegin);
58 assert(symbolOpensScope(Opener.kind()));
59 uint32_t EndOffset = getScopeEndOffset(Opener);
60 CVSymbol Closer = *Symbols.at(EndOffset);
61 EndOffset += Closer.RecordData.size();
62 return Symbols.substream(ScopeBegin, EndOffset);
63 }