mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 22:36:06 +00:00

This adds support for dumping a summary of module symbols and CodeView debug chunks. This option prints a table for each module of all of the symbols that occurred in the module and the number of times it occurred and total byte size. Then at the end it prints the totals for the entire file. Additionally, this patch adds the -jmc (just my code) option, which suppresses modules which are from external libraries or linker imports, so that you can focus only on the object files and libraries that originate from your own source code. llvm-svn: 311338
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
//===- Streamutil.h - PDB stream utilities ----------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H
|
|
#define LLVM_TOOLS_LLVMPDBDUMP_STREAMUTIL_H
|
|
|
|
#include "llvm/ADT/Optional.h"
|
|
#include "llvm/ADT/SmallVector.h"
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
#include <string>
|
|
|
|
namespace llvm {
|
|
namespace pdb {
|
|
class PDBFile;
|
|
enum class StreamPurpose { NamedStream, ModuleStream, Symbols, Other };
|
|
|
|
struct StreamInfo {
|
|
public:
|
|
StreamInfo() {}
|
|
|
|
uint32_t getModuleIndex() const { return *ModuleIndex; }
|
|
StreamPurpose getPurpose() const { return Purpose; }
|
|
StringRef getShortName() const { return Name; }
|
|
uint32_t getStreamIndex() const { return StreamIndex; }
|
|
std::string getLongName() const;
|
|
|
|
static StreamInfo createStream(StreamPurpose Purpose, StringRef Name,
|
|
uint32_t StreamIndex);
|
|
static StreamInfo createModuleStream(StringRef Module, uint32_t StreamIndex,
|
|
uint32_t Modi);
|
|
|
|
private:
|
|
StreamPurpose Purpose;
|
|
uint32_t StreamIndex;
|
|
std::string Name;
|
|
Optional<uint32_t> ModuleIndex;
|
|
};
|
|
|
|
void discoverStreamPurposes(PDBFile &File,
|
|
SmallVectorImpl<StreamInfo> &Streams);
|
|
}
|
|
}
|
|
|
|
#endif
|