Eugene Zelenko | 570e39a | 2016-11-23 23:16:32 +0000 | [diff] [blame] | 1 | //===- IPDBSourceFile.cpp - base interface for a PDB source file ----------===// |
Zachary Turner | a554917 | 2015-02-10 22:43:25 +0000 | [diff] [blame] | 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 Turner | a554917 | 2015-02-10 22:43:25 +0000 | [diff] [blame] | 11 | #include "llvm/DebugInfo/PDB/PDBExtras.h" |
Eugene Zelenko | 570e39a | 2016-11-23 23:16:32 +0000 | [diff] [blame] | 12 | #include "llvm/DebugInfo/PDB/PDBTypes.h" |
Zachary Turner | a554917 | 2015-02-10 22:43:25 +0000 | [diff] [blame] | 13 | #include "llvm/Support/Format.h" |
| 14 | #include "llvm/Support/raw_ostream.h" |
Eugene Zelenko | 570e39a | 2016-11-23 23:16:32 +0000 | [diff] [blame] | 15 | #include <cstdint> |
| 16 | #include <string> |
Zachary Turner | a554917 | 2015-02-10 22:43:25 +0000 | [diff] [blame] | 17 | |
| 18 | using namespace llvm; |
Zachary Turner | ec28fc3 | 2016-05-04 20:32:13 +0000 | [diff] [blame] | 19 | using namespace llvm::pdb; |
Zachary Turner | a554917 | 2015-02-10 22:43:25 +0000 | [diff] [blame] | 20 | |
Eugene Zelenko | 570e39a | 2016-11-23 23:16:32 +0000 | [diff] [blame] | 21 | IPDBSourceFile::~IPDBSourceFile() = default; |
Zachary Turner | a554917 | 2015-02-10 22:43:25 +0000 | [diff] [blame] | 22 | |
Zachary Turner | bc42da0 | 2015-02-23 05:59:14 +0000 | [diff] [blame] | 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"; |
Zachary Turner | a554917 | 2015-02-10 22:43:25 +0000 | [diff] [blame] | 35 | } |