blob: 8cb1fbef51f402ff3b3dde9a84a5b7acea21f86a [file] [log] [blame]
Eugene Zelenko570e39a2016-11-23 23:16:32 +00001//===- IPDBSourceFile.cpp - base interface for a PDB source file ----------===//
Zachary Turnera5549172015-02-10 22:43:25 +00002//
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 Turnera5549172015-02-10 22:43:25 +000011#include "llvm/DebugInfo/PDB/PDBExtras.h"
Eugene Zelenko570e39a2016-11-23 23:16:32 +000012#include "llvm/DebugInfo/PDB/PDBTypes.h"
Zachary Turnera5549172015-02-10 22:43:25 +000013#include "llvm/Support/Format.h"
14#include "llvm/Support/raw_ostream.h"
Eugene Zelenko570e39a2016-11-23 23:16:32 +000015#include <cstdint>
16#include <string>
Zachary Turnera5549172015-02-10 22:43:25 +000017
18using namespace llvm;
Zachary Turnerec28fc32016-05-04 20:32:13 +000019using namespace llvm::pdb;
Zachary Turnera5549172015-02-10 22:43:25 +000020
Eugene Zelenko570e39a2016-11-23 23:16:32 +000021IPDBSourceFile::~IPDBSourceFile() = default;
Zachary Turnera5549172015-02-10 22:43:25 +000022
Zachary Turnerbc42da02015-02-23 05:59:14 +000023void 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";
Zachary Turnera5549172015-02-10 22:43:25 +000035}