Path: blob/main/contrib/llvm-project/llvm/tools/llvm-pdbutil/StreamUtil.h
35260 views
//===- Streamutil.h - PDB stream utilities ----------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H9#define LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H1011#include "llvm/ADT/SmallVector.h"12#include "llvm/ADT/StringRef.h"1314#include <string>15#include <optional>1617namespace llvm {18namespace pdb {19class PDBFile;20enum class StreamPurpose {21NamedStream,22ModuleStream,23Symbols,24PDB,25DBI,26TPI,27IPI,28GlobalHash,29PublicHash,30TpiHash,31IpiHash,32Other33};3435struct StreamInfo {36public:37StreamInfo() {}3839uint32_t getModuleIndex() const { return *ModuleIndex; }40StreamPurpose getPurpose() const { return Purpose; }41StringRef getShortName() const { return Name; }42uint32_t getStreamIndex() const { return StreamIndex; }43std::string getLongName() const;4445static StreamInfo createStream(StreamPurpose Purpose, StringRef Name,46uint32_t StreamIndex);47static StreamInfo createModuleStream(StringRef Module, uint32_t StreamIndex,48uint32_t Modi);4950private:51StreamPurpose Purpose;52uint32_t StreamIndex;53std::string Name;54std::optional<uint32_t> ModuleIndex;55};5657void discoverStreamPurposes(PDBFile &File,58SmallVectorImpl<StreamInfo> &Streams);59}60}6162#endif636465