LLVM  7.0.0svn
IPDBSourceFile.cpp
Go to the documentation of this file.
1 //===- IPDBSourceFile.cpp - base interface for a PDB source file ----------===//
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 
13 #include "llvm/Support/Format.h"
15 #include <cstdint>
16 #include <string>
17 
18 using namespace llvm;
19 using namespace llvm::pdb;
20 
22 
23 void IPDBSourceFile::dump(raw_ostream &OS, int Indent) const {
24  OS.indent(Indent);
25  PDB_Checksum ChecksumType = getChecksumType();
26  OS << "[";
27  if (ChecksumType != PDB_Checksum::None) {
28  OS << ChecksumType << ": ";
29  std::string Checksum = getChecksum();
30  for (uint8_t c : Checksum)
31  OS << format_hex_no_prefix(c, 2, true);
32  } else
33  OS << "No checksum";
34  OS << "] " << getFileName() << "\n";
35 }
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
raw_ostream & indent(unsigned NumSpaces)
indent - Insert &#39;NumSpaces&#39; spaces.
PDB_Checksum
Specifies the hash algorithm that a source file from a PDB was hashed with.
Definition: PDBTypes.h:114
void dump(raw_ostream &OS, int Indent) const
virtual std::string getChecksum() const =0
virtual PDB_Checksum getChecksumType() const =0
FormattedNumber format_hex_no_prefix(uint64_t N, unsigned Width, bool Upper=false)
format_hex_no_prefix - Output N as a fixed width hexadecimal.
Definition: Format.h:199
Definition: JSON.cpp:592
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
virtual std::string getFileName() const =0