1 //===- Streamutil.h - PDB stream utilities ----------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H
10 #define LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/ADT/StringRef.h"
21 enum class StreamPurpose
{
40 uint32_t getModuleIndex() const { return *ModuleIndex
; }
41 StreamPurpose
getPurpose() const { return Purpose
; }
42 StringRef
getShortName() const { return Name
; }
43 uint32_t getStreamIndex() const { return StreamIndex
; }
44 std::string
getLongName() const;
46 static StreamInfo
createStream(StreamPurpose Purpose
, StringRef Name
,
47 uint32_t StreamIndex
);
48 static StreamInfo
createModuleStream(StringRef Module
, uint32_t StreamIndex
,
52 StreamPurpose Purpose
;
55 std::optional
<uint32_t> ModuleIndex
;
58 void discoverStreamPurposes(PDBFile
&File
,
59 SmallVectorImpl
<StreamInfo
> &Streams
);