1 //===- Streamutil.h - PDB stream utilities ----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H
11 #define LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/ADT/StringRef.h"
22 enum class StreamPurpose
{ NamedStream
, ModuleStream
, Symbols
, Other
};
28 uint32_t getModuleIndex() const { return *ModuleIndex
; }
29 StreamPurpose
getPurpose() const { return Purpose
; }
30 StringRef
getShortName() const { return Name
; }
31 uint32_t getStreamIndex() const { return StreamIndex
; }
32 std::string
getLongName() const;
34 static StreamInfo
createStream(StreamPurpose Purpose
, StringRef Name
,
35 uint32_t StreamIndex
);
36 static StreamInfo
createModuleStream(StringRef Module
, uint32_t StreamIndex
,
40 StreamPurpose Purpose
;
43 Optional
<uint32_t> ModuleIndex
;
46 void discoverStreamPurposes(PDBFile
&File
,
47 SmallVectorImpl
<StreamInfo
> &Streams
);