DxilDia.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // DxilDia.cpp //
  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. #include "DxilDia.h"
  12. #include "dxc/Support/Global.h"
  13. #include "dxc/Support/Unicode.h"
  14. HRESULT dxil_dia::StringRefToBSTR(llvm::StringRef value, BSTR *pRetVal) {
  15. try {
  16. wchar_t *wide;
  17. size_t sideSize;
  18. if (!Unicode::UTF8BufferToUTF16Buffer(value.data(), value.size(), &wide,
  19. &sideSize))
  20. return E_FAIL;
  21. *pRetVal = SysAllocString(wide);
  22. delete[] wide;
  23. }
  24. CATCH_CPP_RETURN_HRESULT();
  25. return S_OK;
  26. }
  27. HRESULT dxil_dia::ENotImpl() {
  28. return E_NOTIMPL;
  29. }