LLVM: lib/DebugInfo/PDB/DIA/DIASourceFile.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
15
16using namespace llvm;
18
20 CComPtr DiaSourceFile)
21 : Session(PDBSession), SourceFile(DiaSourceFile) {}
22
26
28 DWORD Id;
29 return (S_OK == SourceFile->get_uniqueId(&Id)) ? Id : 0;
30}
31
33 DWORD ByteSize = 0;
34 HRESULT Result = SourceFile->get_checksum(0, &ByteSize, nullptr);
35 if (ByteSize == 0)
36 return std::string();
37 std::vector ChecksumBytes(ByteSize);
38 Result = SourceFile->get_checksum(ByteSize, &ByteSize, &ChecksumBytes[0]);
39 if (S_OK != Result)
40 return std::string();
41 return std::string(ChecksumBytes.begin(), ChecksumBytes.end());
42}
43
46 HRESULT Result = SourceFile->get_checksumType(&Type);
47 if (S_OK != Result)
50}
51
52std::unique_ptr<IPDBEnumChildren>
54 CComPtr DiaEnumerator;
55 HRESULT Result = SourceFile->get_compilands(&DiaEnumerator);
56 if (S_OK != Result)
57 return nullptr;
58
59 auto Enumerator = std::unique_ptr(
61 return std::unique_ptr<IPDBEnumChildren>(
63}
std::string invokeBstrMethod(Obj &Object, HRESULT(__stdcall Obj::*Func)(BSTR *))
uint32_t getUniqueId() const override
Definition DIASourceFile.cpp:27
std::string getFileName() const override
Definition DIASourceFile.cpp:23
std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > getCompilands() const override
Definition DIASourceFile.cpp:53
DIASourceFile(const DIASession &Session, CComPtr< IDiaSourceFile > DiaSourceFile)
Definition DIASourceFile.cpp:19
std::string getChecksum() const override
Definition DIASourceFile.cpp:32
PDB_Checksum getChecksumType() const override
Definition DIASourceFile.cpp:44
PDB_Checksum
Specifies the hash algorithm that a source file from a PDB was hashed with.
This is an optimization pass for GlobalISel generic memory operations.