19 using namespace llvm::pdb;
22 CComPtr<IDiaSourceFile> DiaSourceFile)
23 : Session(PDBSession), SourceFile(DiaSourceFile) {}
27 HRESULT Result = SourceFile->get_fileName(&FileName16);
31 std::string FileName8;
33 FileName16.ByteLength());
40 return (S_OK == SourceFile->get_uniqueId(&Id)) ? Id : 0;
45 HRESULT Result = SourceFile->get_checksum(0, &ByteSize,
nullptr);
48 std::vector<BYTE> ChecksumBytes(ByteSize);
49 Result = SourceFile->get_checksum(ByteSize, &ByteSize, &ChecksumBytes[0]);
52 return std::string(ChecksumBytes.begin(), ChecksumBytes.end());
57 HRESULT Result = SourceFile->get_checksumType(&Type);
63 std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
65 CComPtr<IDiaEnumSymbols> DiaEnumerator;
66 HRESULT Result = SourceFile->get_compilands(&DiaEnumerator);
70 auto Enumerator = std::unique_ptr<IPDBEnumSymbols>(
72 return std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>(
std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > getCompilands() const override
PDB_Checksum
Specifies the hash algorithm that a source file from a PDB was hashed with.
uint32_t getUniqueId() const override
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
std::string getChecksum() const override
bool convertUTF16ToUTF8String(ArrayRef< char > SrcBytes, std::string &Out)
Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
PDB_Checksum getChecksumType() const override
DIASourceFile(const DIASession &Session, CComPtr< IDiaSourceFile > DiaSourceFile)
std::string getFileName() const override