blob: f98bf9b18fc77ec51a2d1705af52c515c0bc5f89 [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"
Zachary Turner52c9f882015-02-14 03:53:56 +000011
Zachary Turnera5549172015-02-10 22:43:25 +000012#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,
21 PDB_DumpLevel Level) const {
22 if (Level == PDB_DumpLevel::Compact) {
23 OS.indent(Indent);
24 PDB_Checksum ChecksumType = getChecksumType();
25 OS << "[";
26 if (ChecksumType != PDB_Checksum::None) {
27 OS << ChecksumType << ": ";
28 std::string Checksum = getChecksum();
29 for (uint8_t c : Checksum)
30 OS << format_hex_no_prefix(c, 2, true);
31 } else
32 OS << "No checksum";
33 OS << "] " << getFileName() << "\n";
34 }
35}