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