DxilDiaTableSourceFiles.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // DxilDiaTableSourceFiles.h //
  4. // Copyright (C) Microsoft Corporation. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. // DIA API implementation for DXIL modules. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. #include "dxc/Support/WinIncludes.h"
  13. #include <vector>
  14. #include "dia2.h"
  15. #include "llvm/ADT/StringRef.h"
  16. #include "llvm/IR/Metadata.h"
  17. #include "dxc/Support/Global.h"
  18. #include "dxc/Support/microcom.h"
  19. #include "DxilDia.h"
  20. #include "DxilDiaTable.h"
  21. namespace dxil_dia {
  22. class Session;
  23. class SourceFile : public IDiaSourceFile {
  24. private:
  25. DXC_MICROCOM_TM_REF_FIELDS()
  26. CComPtr<Session> m_pSession;
  27. DWORD m_index;
  28. public:
  29. DXC_MICROCOM_TM_ADDREF_RELEASE_IMPL()
  30. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject) {
  31. return DoBasicQueryInterface<IDiaSourceFile>(this, iid, ppvObject);
  32. }
  33. SourceFile(IMalloc *pMalloc, Session *pSession, DWORD index);
  34. llvm::MDTuple *NameContent() const;
  35. llvm::StringRef Name() const;
  36. STDMETHODIMP get_uniqueId(
  37. /* [retval][out] */ DWORD *pRetVal) override;
  38. STDMETHODIMP get_fileName(
  39. /* [retval][out] */ BSTR *pRetVal) override;
  40. STDMETHODIMP get_checksumType(
  41. /* [retval][out] */ DWORD *pRetVal) override { return ENotImpl(); }
  42. STDMETHODIMP get_compilands(
  43. /* [retval][out] */ IDiaEnumSymbols **pRetVal) override { return ENotImpl(); }
  44. STDMETHODIMP get_checksum(
  45. /* [in] */ DWORD cbData,
  46. /* [out] */ DWORD *pcbData,
  47. /* [size_is][out] */ BYTE *pbData) override { return ENotImpl(); }
  48. };
  49. class SourceFilesTable : public impl::TableBase<IDiaEnumSourceFiles, IDiaSourceFile> {
  50. public:
  51. SourceFilesTable(IMalloc *pMalloc, Session *pSession);
  52. SourceFilesTable(IMalloc *pMalloc, Session *pSession,
  53. std::vector<CComPtr<IDiaSourceFile>> &&items);
  54. HRESULT GetItem(DWORD index, IDiaSourceFile **ppItem) override;
  55. private:
  56. std::vector<CComPtr<IDiaSourceFile>> m_items;
  57. };
  58. } // namespace dxil_dia