Global.cpp 1.1 KB

1234567891011121314151617181920212223242526
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // Global.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. // //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #include "dxc/Support/Global.h"
  11. #include <system_error>
  12. #include "dxc/Support/WinIncludes.h"
  13. void CheckLLVMErrorCode(const std::error_code &ec) {
  14. if (ec) {
  15. DXASSERT(ec.category() == std::system_category(), "unexpected LLVM exception code");
  16. throw hlsl::Exception(HRESULT_FROM_WIN32(ec.value()));
  17. }
  18. }
  19. static_assert(unsigned(DXC_E_OVERLAPPING_SEMANTICS) == 0x80AA0001, "Sanity check for DXC errors failed");