summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/CodeView
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-12-05 23:58:18 +0000
committerZachary Turner <zturner@google.com>2017-12-05 23:58:18 +0000
commit376d437776fc5c6a8f3d0923f9b5a061708a422f (patch)
tree042e022791070a61c192f339322b65700226c5d6 /llvm/lib/DebugInfo/CodeView
parent251720194f7897f8dfa7f97dbb6d7ba49592d8de (diff)
downloadbcm5719-llvm-376d437776fc5c6a8f3d0923f9b5a061708a422f.tar.gz
bcm5719-llvm-376d437776fc5c6a8f3d0923f9b5a061708a422f.zip
Teach llvm-pdbutil to dump types from object files.
llvm-svn: 319859
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView')
-rw-r--r--llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp b/llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp
index bad291e8381..ca8007411ca 100644
--- a/llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp
+++ b/llvm/lib/DebugInfo/CodeView/LazyRandomTypeCollection.cpp
@@ -58,21 +58,27 @@ LazyRandomTypeCollection::LazyRandomTypeCollection(const CVTypeArray &Types,
uint32_t NumRecords)
: LazyRandomTypeCollection(Types, NumRecords, PartialOffsetArray()) {}
-void LazyRandomTypeCollection::reset(StringRef Data, uint32_t RecordCountHint) {
+void LazyRandomTypeCollection::reset(BinaryStreamReader &Reader,
+ uint32_t RecordCountHint) {
Count = 0;
PartialOffsets = PartialOffsetArray();
- BinaryStreamReader Reader(Data, support::little);
- error(Reader.readArray(Types, Reader.getLength()));
+ error(Reader.readArray(Types, Reader.bytesRemaining()));
// Clear and then resize, to make sure existing data gets destroyed.
Records.clear();
Records.resize(RecordCountHint);
}
+void LazyRandomTypeCollection::reset(StringRef Data, uint32_t RecordCountHint) {
+ BinaryStreamReader Reader(Data, support::little);
+ reset(Reader, RecordCountHint);
+}
+
void LazyRandomTypeCollection::reset(ArrayRef<uint8_t> Data,
uint32_t RecordCountHint) {
- reset(toStringRef(Data), RecordCountHint);
+ BinaryStreamReader Reader(Data, support::little);
+ reset(Reader, RecordCountHint);
}
uint32_t LazyRandomTypeCollection::getOffsetOfType(TypeIndex Index) {
OpenPOWER on IntegriCloud