• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- IPDBStreamData.h - Base interface for PDB Stream Data ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_IPDBSTREAMDATA_H
11 #define LLVM_DEBUGINFO_PDB_RAW_IPDBSTREAMDATA_H
12 
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/Support/Endian.h"
15 
16 namespace llvm {
17 namespace pdb {
18 /// IPDBStream abstracts the notion of PDB stream data.  Although we already
19 /// have another stream abstraction (namely in the form of StreamInterface
20 /// and MappedBlockStream), they assume that the stream data is referenced
21 /// the same way.  Namely, by looking in the directory to get the list of
22 /// stream blocks, and by looking in the array of stream lengths to get the
23 /// length.  This breaks down for the directory itself, however, since its
24 /// length and list of blocks are stored elsewhere.  By abstracting the
25 /// notion of stream data further, we can use a MappedBlockStream to read
26 /// from the directory itself, or from an indexed stream which references
27 /// the directory.
28 class IPDBStreamData {
29 public:
~IPDBStreamData()30   virtual ~IPDBStreamData() {}
31 
32   virtual uint32_t getLength() = 0;
33   virtual ArrayRef<support::ulittle32_t> getStreamBlocks() = 0;
34 };
35 }
36 }
37 
38 #endif
39