1//===- IPDBSourceFile.cpp - base interface for a PDB source file *- C++ -*-===//
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
10#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
11
12#include "llvm/DebugInfo/PDB/PDBExtras.h"
13#include "llvm/Support/Format.h"
14#include "llvm/Support/raw_ostream.h"
15
16using namespace llvm;
17
18IPDBSourceFile::~IPDBSourceFile() {}
19
20void IPDBSourceFile::dump(raw_ostream &OS, int Indent) const {
21  OS.indent(Indent);
22  PDB_Checksum ChecksumType = getChecksumType();
23  OS << "[";
24  if (ChecksumType != PDB_Checksum::None) {
25    OS << ChecksumType << ": ";
26    std::string Checksum = getChecksum();
27    for (uint8_t c : Checksum)
28      OS << format_hex_no_prefix(c, 2, true);
29  } else
30    OS << "No checksum";
31  OS << "] " << getFileName() << "\n";
32}
33