IPDBSourceFile.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. //===- IPDBSourceFile.cpp - base interface for a PDB source file ----------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
  9. #include "llvm/DebugInfo/PDB/PDBExtras.h"
  10. #include "llvm/DebugInfo/PDB/PDBTypes.h"
  11. #include "llvm/Support/Format.h"
  12. #include "llvm/Support/raw_ostream.h"
  13. #include <cstdint>
  14. #include <string>
  15. using namespace llvm;
  16. using namespace llvm::pdb;
  17. IPDBSourceFile::~IPDBSourceFile() = default;
  18. void IPDBSourceFile::dump(raw_ostream &OS, int Indent) const {
  19. OS.indent(Indent);
  20. PDB_Checksum ChecksumType = getChecksumType();
  21. OS << "[";
  22. if (ChecksumType != PDB_Checksum::None) {
  23. OS << ChecksumType << ": ";
  24. std::string Checksum = getChecksum();
  25. for (uint8_t c : Checksum)
  26. OS << format_hex_no_prefix(c, 2, true);
  27. } else
  28. OS << "No checksum";
  29. OS << "] " << getFileName() << "\n";
  30. }