diff --git a/CMakeLists.txt b/CMakeLists.txt index 458716faa5..5c26012deb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,21 +107,27 @@ endif() option(DXC_DISABLE_ALLOCATOR_OVERRIDES "Disable usage of allocator overrides" OFF) mark_as_advanced(DXC_DISABLE_ALLOCATOR_OVERRIDES) -# adjust link option to enable debugging from kernel mode; not compatible with incremental linking -if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32 AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC") - add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO) -endif() - -# enable control flow guard -if(WIN32) -add_compile_options(/guard:cf) -add_link_options(/guard:cf) -endif(WIN32) - -# Enable CET Shadow Stack -if(WIN32 AND NOT (CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*")) - add_link_options(/CETCOMPAT) -endif() +#------------------ +# Mach change start +#------------------ +# # adjust link option to enable debugging from kernel mode; not compatible with incremental linking +# if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32 AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC") +# add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO) +# endif() + +# # enable control flow guard +# if(WIN32) +# add_compile_options(/guard:cf) +# add_link_options(/guard:cf) +# endif(WIN32) + +# # Enable CET Shadow Stack +# if(WIN32 AND NOT (CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*")) +# add_link_options(/CETCOMPAT) +# endif() +#------------------ +# Mach change end +#------------------ # HLSL Change Ends @@ -804,9 +810,16 @@ endif() include(CoverageReport) -# HLSL Change begin - Set default distribution value. -set(LLVM_DISTRIBUTION_COMPONENTS "dxc;dxcompiler;dxc-headers" CACHE STRING "") -# HLSL Change end - Set default distribution value. +#------------------ +# Mach change start +#------------------ +# # HLSL Change begin - Set default distribution value. +# set(LLVM_DISTRIBUTION_COMPONENTS "dxc;dxcompiler;dxc-headers" CACHE STRING "") +# # HLSL Change end - Set default distribution value. +set(LLVM_DISTRIBUTION_COMPONENTS "dxcompiler;dxc-headers" CACHE STRING "") +#------------------ +# Mach change end +#------------------ # This must be at the end of the LLVM root CMakeLists file because it must run # after all targets are created. diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 32820635e8..d4aad7436c 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -16,7 +16,13 @@ function(llvm_update_compile_flags name) endif() else() if(LLVM_COMPILER_IS_GCC_COMPATIBLE) - list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions") + #------------------ + # Mach change start + #------------------ + # list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions") + #------------------ + # Mach change end + #------------------ elseif(MSVC) list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0) list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-") diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index b779739856..2606fc94fa 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -81,7 +81,13 @@ if (${ENABLE_SPIRV_CODEGEN}) # Avoid exception handling warning from MSVC. # This add_compile_options() will only affect the current directory and its subdirectories. if (WIN32) - add_compile_options(/EHs) + #------------------ + # Mach change start + #------------------ + # add_compile_options(/EHs) + #------------------ + # Mach change end + #------------------ else(WIN32) # Disable all warnings in subproject RE2 add_compile_options(-w) diff --git a/include/dxc/Tracing/CMakeLists.txt b/include/dxc/Tracing/CMakeLists.txt index 6e601c4598..7ddc261303 100644 --- a/include/dxc/Tracing/CMakeLists.txt +++ b/include/dxc/Tracing/CMakeLists.txt @@ -4,29 +4,53 @@ # Create the header in a temporary file and only update when necessary, # to avoid invalidating targets that depend on it. +#------------------ +# Mach change start +#------------------ +# add_custom_command( +# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h +# COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcEtw_ -um -z tmpdxcetw ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man +# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man +# COMMENT "Building instrumentation manifest ..." +# ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h - COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcEtw_ -um -z tmpdxcetw ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man COMMENT "Building instrumentation manifest ..." ) +#------------------ +# Mach change end +#------------------ +#------------------ +# Mach change start +#------------------ +# add_custom_command( +# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h +# ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.rc +# ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetwTEMP.bin +# ${CMAKE_CURRENT_BINARY_DIR}/dxcetwTEMP.bin +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw_MSG00001.bin +# ${CMAKE_CURRENT_BINARY_DIR}/MSG00001.bin +# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h +# COMMENT "Updating instrumentation manifest ..." +# ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h - ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.rc - ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetwTEMP.bin - ${CMAKE_CURRENT_BINARY_DIR}/dxcetwTEMP.bin - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw_MSG00001.bin - ${CMAKE_CURRENT_BINARY_DIR}/MSG00001.bin + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h COMMENT "Updating instrumentation manifest ..." ) +#------------------ +# Mach change end +#------------------ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h PROPERTIES GENERATED 1) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc PROPERTIES GENERATED 1) diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h index 8304c6026e..eaae6395fa 100644 --- a/include/llvm/Support/Host.h +++ b/include/llvm/Support/Host.h @@ -20,7 +20,13 @@ #include #else #if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32) -#include +//#------------------ +//# Mach change start +//#------------------ +// #include +//#------------------ +//# Mach change end +//#------------------ #endif #endif diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 41c3269872..f1a2a1945d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -27,7 +27,13 @@ add_subdirectory(DXIL) # HLSL Change add_subdirectory(DxilContainer) # HLSL Change add_subdirectory(DxilPdbInfo) # HLSL Change add_subdirectory(DxilPIXPasses) # HLSL Change -add_subdirectory(DxilDia) # HLSL Change +#------------------ +# Mach change start +#------------------ +# add_subdirectory(DxilDia) # HLSL Change +#------------------ +# Mach change end +#------------------ add_subdirectory(DxilRootSignature) # HLSL Change add_subdirectory(DxcBindingTable) # HLSL Change add_subdirectory(DxrFallback) # HLSL Change diff --git a/lib/DxilDia/DxilDiaDataSource.cpp b/lib/DxilDia/DxilDiaDataSource.cpp index 1a3a2c0fd3..26044be0c1 100644 --- a/lib/DxilDia/DxilDiaDataSource.cpp +++ b/lib/DxilDia/DxilDiaDataSource.cpp @@ -59,7 +59,14 @@ getMemBufferFromStream(IStream *pStream, std::vector &DataContainer, STATSTG statstg; IFT(pStream->Stat(&statstg, STATFLAG_NONAME)); - size_t size = statstg.cbSize.LowPart; + //#------------------ + //# Mach change start + //#------------------ + // size_t size = statstg.cbSize.LowPart; + size_t size = statstg.cbSize.u.LowPart; + //#------------------ + //# Mach change end + //#------------------ DataContainer.resize(size); ULONG read; diff --git a/lib/HLSL/DxilContainerReflection.cpp b/lib/HLSL/DxilContainerReflection.cpp index 7d593a01df..618988b5f5 100644 --- a/lib/HLSL/DxilContainerReflection.cpp +++ b/lib/HLSL/DxilContainerReflection.cpp @@ -1478,7 +1478,13 @@ void CShaderReflectionConstantBuffer::Initialize( } static unsigned CalcResTypeSize(DxilModule &M, DxilResource &R) { - UNREFERENCED_PARAMETER(M); + //#------------------ + //# Mach change start + //#------------------ + // UNREFERENCED_PARAMETER(M); + //#------------------ + //# Mach change end + //#------------------ Type *Ty = R.GetHLSLType()->getPointerElementType(); if (R.IsStructuredBuffer()) { Ty = dxilutil::StripArrayTypes(Ty); diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt index 396878aa2b..9a8164d3dc 100644 --- a/lib/Support/CMakeLists.txt +++ b/lib/Support/CMakeLists.txt @@ -145,8 +145,14 @@ add_llvm_library(LLVMSupport ) set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}") -if(WIN32) -set_property(TARGET LLVMSupport PROPERTY COMPILE_FLAGS /EHsc ) -endif(WIN32) +#------------------ +# Mach change start +#------------------ +# if(WIN32) +# set_property(TARGET LLVMSupport PROPERTY COMPILE_FLAGS /EHsc ) +# endif(WIN32) +#------------------ +# Mach change end +#------------------ target_link_libraries(LLVMSupport PUBLIC LLVMMSSupport) # HLSL Change diff --git a/lib/Support/MSFileSystemBasic.cpp b/lib/Support/MSFileSystemBasic.cpp index b8cbb47900..0a030ce973 100644 --- a/lib/Support/MSFileSystemBasic.cpp +++ b/lib/Support/MSFileSystemBasic.cpp @@ -70,8 +70,16 @@ static HRESULT CopyStatStg(const STATSTG *statStg, lpFindFileData->ftCreationTime = statStg->ctime; lpFindFileData->ftLastAccessTime = statStg->atime; lpFindFileData->ftLastWriteTime = statStg->mtime; - lpFindFileData->nFileSizeLow = statStg->cbSize.LowPart; - lpFindFileData->nFileSizeHigh = statStg->cbSize.HighPart; + //#------------------ + //# Mach change start + //#------------------ + // lpFindFileData->nFileSizeLow = statStg->cbSize.LowPart; + // lpFindFileData->nFileSizeHigh = statStg->cbSize.HighPart; + lpFindFileData->nFileSizeLow = statStg->cbSize.u.LowPart; + lpFindFileData->nFileSizeHigh = statStg->cbSize.u.HighPart; + //#------------------ + //# Mach change end + //#------------------ if (statStg->pwcsName != nullptr) { IFC(StringCchCopyW(lpFindFileData->cFileName, _countof(lpFindFileData->cFileName), statStg->pwcsName)); @@ -842,8 +850,16 @@ long MSFileSystemForIface::lseek(int fd, long offset, int origin) throw() { } GetHandleStream(GetHandleForFD(fd), &stream); - li.HighPart = 0; - li.LowPart = offset; + //#------------------ + //# Mach change start + //#------------------ + // li.HighPart = 0; + // li.LowPart = offset; + li.u.HighPart = 0; + li.u.LowPart = offset; + //#------------------ + //# Mach change end + //#------------------ IFC(stream->Seek(li, origin, &uli)); Cleanup: @@ -852,12 +868,26 @@ long MSFileSystemForIface::lseek(int fd, long offset, int origin) throw() { return -1; } - if (uli.HighPart > 0) { + //#------------------ + //# Mach change start + //#------------------ + // if (uli.HighPart > 0) { + if (uli.u.HighPart > 0) { + //#------------------ + //# Mach change end + //#------------------ errno = EOVERFLOW; return -1; } - return uli.LowPart; + //#------------------ + //# Mach change start + //#------------------ + // return uli.LowPart; + return uli.u.LowPart; + //#------------------ + //# Mach change end + //#------------------ } int MSFileSystemForIface::setmode(int fd, int mode) throw() { return 0; } diff --git a/lib/Support/Windows/MSFileSystem.inc.cpp b/lib/Support/Windows/MSFileSystem.inc.cpp index 628cda9c73..3c766176a6 100644 --- a/lib/Support/Windows/MSFileSystem.inc.cpp +++ b/lib/Support/Windows/MSFileSystem.inc.cpp @@ -334,8 +334,16 @@ UniqueID file_status::getUniqueID() const { TimeValue file_status::getLastModificationTime() const { ULARGE_INTEGER UI; - UI.LowPart = LastWriteTimeLow; - UI.HighPart = LastWriteTimeHigh; + //#------------------ + //# Mach change start + //#------------------ + // UI.LowPart = LastWriteTimeLow; + // UI.HighPart = LastWriteTimeHigh; + UI.u.LowPart = LastWriteTimeLow; + UI.u.HighPart = LastWriteTimeHigh; + //#------------------ + //# Mach change end + //#------------------ TimeValue Ret; Ret.fromWin32Time(UI.QuadPart); @@ -703,8 +711,16 @@ error_code setLastModificationAndAccessTime(int FD, TimeValue Time) { ULARGE_INTEGER UI; UI.QuadPart = Time.toWin32Time(); FILETIME FT; - FT.dwLowDateTime = UI.LowPart; - FT.dwHighDateTime = UI.HighPart; + //#------------------ + //# Mach change start + //#------------------ + // FT.dwLowDateTime = UI.LowPart; + // FT.dwHighDateTime = UI.HighPart; + FT.dwLowDateTime = UI.u.LowPart; + FT.dwHighDateTime = UI.u.HighPart; + //#------------------ + //# Mach change end + //#------------------ HANDLE FileHandle = reinterpret_cast(fsr->get_osfhandle(FD)); if (!fsr->SetFileTime(FileHandle, NULL, &FT, &FT)) return mapWindowsError(::GetLastError()); diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index 0e582258a3..7e011008bb 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -154,8 +154,16 @@ UniqueID file_status::getUniqueID() const { TimeValue file_status::getLastModificationTime() const { ULARGE_INTEGER UI; - UI.LowPart = LastWriteTimeLow; - UI.HighPart = LastWriteTimeHigh; + //#------------------ + //# Mach change start + //#------------------ + // UI.LowPart = LastWriteTimeLow; + // UI.HighPart = LastWriteTimeHigh; + UI.u.LowPart = LastWriteTimeLow; + UI.u.HighPart = LastWriteTimeHigh; + //#------------------ + //# Mach change end + //#------------------ TimeValue Ret; Ret.fromWin32Time(UI.QuadPart); @@ -449,8 +457,16 @@ std::error_code setLastModificationAndAccessTime(int FD, TimeValue Time) { ULARGE_INTEGER UI; UI.QuadPart = Time.toWin32Time(); FILETIME FT; - FT.dwLowDateTime = UI.LowPart; - FT.dwHighDateTime = UI.HighPart; + //#------------------ + //# Mach change start + //#------------------ + // FT.dwLowDateTime = UI.LowPart; + // FT.dwHighDateTime = UI.HighPart; + FT.dwLowDateTime = UI.u.LowPart; + FT.dwHighDateTime = UI.u.HighPart; + //#------------------ + //# Mach change end + //#------------------ HANDLE FileHandle = reinterpret_cast(_get_osfhandle(FD)); if (!SetFileTime(FileHandle, NULL, &FT, &FT)) return mapWindowsError(::GetLastError()); diff --git a/lib/Support/Windows/Process.inc b/lib/Support/Windows/Process.inc index d2eb3abec1..1d83e3dcfd 100644 --- a/lib/Support/Windows/Process.inc +++ b/lib/Support/Windows/Process.inc @@ -51,8 +51,16 @@ using namespace sys; static TimeValue getTimeValueFromFILETIME(FILETIME Time) { ULARGE_INTEGER TimeInteger; - TimeInteger.LowPart = Time.dwLowDateTime; - TimeInteger.HighPart = Time.dwHighDateTime; + //#------------------ + //# Mach change start + //#------------------ + // TimeInteger.LowPart = Time.dwLowDateTime; + // TimeInteger.HighPart = Time.dwHighDateTime; + TimeInteger.u.LowPart = Time.dwLowDateTime; + TimeInteger.u.HighPart = Time.dwHighDateTime; + //#------------------ + //# Mach change end + //#------------------ // FILETIME's are # of 100 nanosecond ticks (1/10th of a microsecond) return TimeValue( diff --git a/lib/Support/Windows/WindowsSupport.h b/lib/Support/Windows/WindowsSupport.h index c7dd0bb3ee..69026babcc 100644 --- a/lib/Support/Windows/WindowsSupport.h +++ b/lib/Support/Windows/WindowsSupport.h @@ -43,6 +43,13 @@ These values need to be the same everywhere that windows headers are included. #include "dxc/Support/WinIncludes.h" #include #include +//#------------------ +//# Mach change start +//#------------------ +#include +//#------------------ +//# Mach change end +//#------------------ #include #include #include diff --git a/lib/Support/assert.cpp b/lib/Support/assert.cpp index 10094205bd..2041c2e920 100644 --- a/lib/Support/assert.cpp +++ b/lib/Support/assert.cpp @@ -14,6 +14,16 @@ #include "dxc/Support/Global.h" #include "windows.h" +//#------------------ +//# Mach change start +//#------------------ +#ifdef __clang__ // Zig +#define OutputDebugFormatA(...) fprintf(stderr, __VA_ARGS__) +#endif // __clang__ // Zig +//#------------------ +//# Mach change end +//#------------------ + void llvm_assert(const char *_Message, const char *_File, unsigned _Line, const char *_Function) { OutputDebugFormatA("Error: assert(%s)\nFile:\n%s(%d)\nFunc:\t%s\n", _Message, diff --git a/projects/dxilconv/include/ShaderBinary/ShaderBinary.h b/projects/dxilconv/include/ShaderBinary/ShaderBinary.h index 38f0dae598..49fc37f157 100644 --- a/projects/dxilconv/include/ShaderBinary/ShaderBinary.h +++ b/projects/dxilconv/include/ShaderBinary/ShaderBinary.h @@ -11,6 +11,14 @@ #pragma once +//#------------------ +//# Mach change start +//#------------------ +#include "dxc/Support/WinIncludes.h" +//#------------------ +//# Mach change end +//#------------------ + // has dependencies on D3D10TokenizedProgramFormat.hpp! make sure to include // that too! diff --git a/projects/dxilconv/include/Support/DXIncludes.h b/projects/dxilconv/include/Support/DXIncludes.h index 4ff1ea7345..904206f9d0 100644 --- a/projects/dxilconv/include/Support/DXIncludes.h +++ b/projects/dxilconv/include/Support/DXIncludes.h @@ -30,6 +30,13 @@ #include "dxc/Support/d3dx12.h" #include "DxbcSignatures.h" #include +//#------------------ +//# Mach change start +//#------------------ +#include +//#------------------ +//# Mach change end +//#------------------ #include #ifndef DECODE_D3D10_SB_TOKENIZED_PROGRAM_TYPE diff --git a/projects/include/Tracing/CMakeLists.txt b/projects/include/Tracing/CMakeLists.txt index f234c10daf..bd6f0b205f 100644 --- a/projects/include/Tracing/CMakeLists.txt +++ b/projects/include/Tracing/CMakeLists.txt @@ -4,29 +4,53 @@ # Create the header in a temporary file and only update when necessary, # to avoid invalidating targets that depend on it. +#------------------ +# Mach change start +#------------------ +# add_custom_command( +# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h +# COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcRuntimeEtw_ -um -z tmpdxcruntimeetw ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man +# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man +# COMMENT "Building instrumentation manifest ..." +# ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h - COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcRuntimeEtw_ -um -z tmpdxcruntimeetw ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man COMMENT "Building instrumentation manifest ..." ) +#------------------ +# Mach change end +#------------------ +#------------------ +# Mach change start +#------------------ +# add_custom_command( +# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h +# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.rc +# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.rc +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetwTEMP.bin +# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtwtemp.BIN +# COMMAND ${CMAKE_COMMAND} -E copy_if_different +# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw_msg00001.bin +# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw_msg00001.bin +# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h +# COMMENT "Updating instrumentation manifest ..." +# ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h - ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.rc - ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.rc - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetwTEMP.bin - ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtwtemp.BIN - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw_msg00001.bin - ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw_msg00001.bin + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h COMMENT "Updating instrumentation manifest ..." ) +#------------------ +# Mach change end +#------------------ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h PROPERTIES GENERATED 1) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.rc PROPERTIES GENERATED 1) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 2c96814c44..32738568e0 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -20,12 +20,18 @@ add_llvm_tool_subdirectory(llvm-as) # HLSL Change add_llvm_tool_subdirectory(llvm-dis) # HLSL Change # add_llvm_tool_subdirectory(llvm-mc) # HLSL Change -# HLSL Change Begins -if (WIN32) -# This target can currently only be built on Windows. -add_llvm_tool_subdirectory(dxexp) -endif (WIN32) -# HLSL Change ends +#------------------ +# Mach change start +#------------------ +# # HLSL Change Begins +# if (WIN32) +# # This target can currently only be built on Windows. +# add_llvm_tool_subdirectory(dxexp) +# endif (WIN32) +# # HLSL Change ends +#------------------ +# Mach change end +#------------------ # add_llvm_tool_subdirectory(llc) # HLSL Change # add_llvm_tool_subdirectory(llvm-ar) # HLSL Change diff --git a/tools/clang/CMakeLists.txt b/tools/clang/CMakeLists.txt index 71190336ca..22d9c98882 100644 --- a/tools/clang/CMakeLists.txt +++ b/tools/clang/CMakeLists.txt @@ -499,9 +499,15 @@ if( CLANG_INCLUDE_TESTS OR HLSL_INCLUDE_TESTS ) # HLSL Change clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg ) endif() - if (CLANG_INCLUDE_TESTS) # HLSL Change - respect variable for clang tests - add_subdirectory(test) - endif() + #------------------ + # Mach change start + #------------------ + # if (CLANG_INCLUDE_TESTS) # HLSL Change - respect variable for clang tests + # add_subdirectory(test) + # endif() + #------------------ + # Mach change end + #------------------ if(CLANG_BUILT_STANDALONE) # Add a global check rule now that all subdirectories have been traversed diff --git a/tools/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt b/tools/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt index df40a68654..289faa1703 100644 --- a/tools/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt +++ b/tools/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt @@ -12,6 +12,12 @@ add_clang_library(clangDynamicASTMatchers clangBasic ) -# HLSL Changes Start -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # otherwise will hit fatal error C1128 on x64 -# HLSL Changes End +#------------------ +# Mach change start +#------------------ +# # HLSL Changes Start +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # otherwise will hit fatal error C1128 on x64 +# # HLSL Changes End +#------------------ +# Mach change end +#------------------ diff --git a/tools/clang/lib/Sema/CMakeLists.txt b/tools/clang/lib/Sema/CMakeLists.txt index 3fd53759ed..d966d79c0a 100644 --- a/tools/clang/lib/Sema/CMakeLists.txt +++ b/tools/clang/lib/Sema/CMakeLists.txt @@ -67,10 +67,16 @@ add_clang_library(clangSema clangLex ) -# HLSL Change Begin -# Sema got too big for debug builds on arm64ec, which means it will hit -# other targets too eventually. -if(WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") -endif(WIN32) -# HLSL Change End +#------------------ +# Mach change start +#------------------ +# # HLSL Change Begin +# # Sema got too big for debug builds on arm64ec, which means it will hit +# # other targets too eventually. +# if(WIN32) +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") +# endif(WIN32) +# # HLSL Change End +#------------------ +# Mach change end +#------------------ diff --git a/tools/clang/tools/CMakeLists.txt b/tools/clang/tools/CMakeLists.txt index 144135db49..a8fb732bdc 100644 --- a/tools/clang/tools/CMakeLists.txt +++ b/tools/clang/tools/CMakeLists.txt @@ -25,19 +25,23 @@ add_llvm_external_project(clang-tools-extra extra) # HLSL Change Starts add_subdirectory(dxcompiler) add_subdirectory(dxclib) -add_subdirectory(dxc) -add_subdirectory(dxa) -add_subdirectory(dxopt) -add_subdirectory(dxl) -add_subdirectory(dxr) -add_subdirectory(dxv) +#------------------ +# Mach change start +#------------------ +# add_subdirectory(dxc) +# add_subdirectory(dxa) +# add_subdirectory(dxopt) +# add_subdirectory(dxl) +# add_subdirectory(dxr) +# add_subdirectory(dxv) -# These targets can currently only be built on Windows. -if (WIN32) -add_subdirectory(d3dcomp) -add_subdirectory(dxrfallbackcompiler) -add_subdirectory(dxlib-sample) -# UI powered by .NET. -add_subdirectory(dotnetc) -endif (WIN32) +# # These targets can currently only be built on Windows. +# if (WIN32) +# add_subdirectory(d3dcomp) +# add_subdirectory(dxrfallbackcompiler) +# add_subdirectory(dxlib-sample) +# endif (WIN32) +#------------------ +# Mach change end +#------------------ # HLSL Change Ends diff --git a/tools/clang/tools/dxcompiler/CMakeLists.txt b/tools/clang/tools/dxcompiler/CMakeLists.txt index 8cddfcc941..f7ff4986e0 100644 --- a/tools/clang/tools/dxcompiler/CMakeLists.txt +++ b/tools/clang/tools/dxcompiler/CMakeLists.txt @@ -54,7 +54,13 @@ set(SOURCES dxcompilerobj.cpp dxcvalidator.cpp DXCompiler.cpp - DXCompiler.rc + #------------------ + # Mach change start + #------------------ + # DXCompiler.rc + #------------------ + # Mach change end + #------------------ DXCompiler.def dxcfilesystem.cpp dxillib.cpp @@ -104,11 +110,17 @@ set(LIBRARIES libclang ) -if(WIN32) - set(LIBRARIES - ${LIBRARIES} - LLVMDxilDia) -endif(WIN32) +#------------------ +# Mach change start +#------------------ +# if(WIN32) +# set(LIBRARIES +# ${LIBRARIES} +# LLVMDxilDia) +# endif(WIN32) +#------------------ +# Mach change end +#------------------ set(GENERATED_HEADERS ClangAttrClasses @@ -125,7 +137,14 @@ if (WIN32) find_package(DiaSDK REQUIRED) # Used for constants and declarations. endif (WIN32) -add_clang_library(dxcompiler SHARED ${SOURCES}) +#------------------ +# Mach change start +#------------------ +# add_clang_library(dxcompiler SHARED ${SOURCES}) +add_clang_library(dxcompiler STATIC ${SOURCES}) +#------------------ +# Mach change end +#------------------ add_dependencies(dxcompiler TablegenHLSLOptions) if (WIN32) # No DxcEtw on non-Windows platforms. diff --git a/tools/clang/tools/dxrfallbackcompiler/CMakeLists.txt b/tools/clang/tools/dxrfallbackcompiler/CMakeLists.txt index a52cac112a..11ac9aaab8 100644 --- a/tools/clang/tools/dxrfallbackcompiler/CMakeLists.txt +++ b/tools/clang/tools/dxrfallbackcompiler/CMakeLists.txt @@ -45,7 +45,13 @@ set(LLVM_LINK_COMPONENTS set(SOURCES dxcapi.cpp DXCompiler.cpp - DXCompiler.rc + #------------------ + # Mach change start + #------------------ + # DXCompiler.rc + #------------------ + # Mach change end + #------------------ DXCompiler.def dxillib.cpp dxcutil.cpp diff --git a/tools/dxexp/dxexp.cpp b/tools/dxexp/dxexp.cpp index b237dea077..f211e04c9e 100644 --- a/tools/dxexp/dxexp.cpp +++ b/tools/dxexp/dxexp.cpp @@ -13,7 +13,16 @@ #define NOMINMAX #define WIN32_LEAN_AND_MEAN +//#------------------ +//# Mach change start +//#------------------ +// #include +#ifndef __clang__ // Zig #include +#endif // __clang__ // Zig +//#------------------ +//# Mach change end +//#------------------ #include #include #include diff --git a/tools/opt/CMakeLists.txt b/tools/opt/CMakeLists.txt index 693e25c6b5..d4cbf7d91b 100644 --- a/tools/opt/CMakeLists.txt +++ b/tools/opt/CMakeLists.txt @@ -31,28 +31,34 @@ set(LLVM_NO_DEAD_STRIP 1) set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} mssupport dxcbindingtable hlsl) # HLSL Change -add_llvm_tool(opt - AnalysisWrappers.cpp - BreakpointPrinter.cpp - GraphPrinters.cpp - NewPMDriver.cpp - PrintSCC.cpp - opt.cpp -) +#------------------ +# Mach change start +#------------------ +# add_llvm_tool(opt +# AnalysisWrappers.cpp +# BreakpointPrinter.cpp +# GraphPrinters.cpp +# NewPMDriver.cpp +# PrintSCC.cpp +# opt.cpp +# ) -if(WIN32 AND HLSL_BUILD_DXILCONV) - add_compile_definitions(HAS_DXILCONV) - target_link_libraries(opt DxilConvPasses) - add_dependencies(opt DxilConvPasses) -endif(WIN32 AND HLSL_BUILD_DXILCONV) +# if(WIN32 AND HLSL_BUILD_DXILCONV) +# add_compile_definitions(HAS_DXILCONV) +# target_link_libraries(opt DxilConvPasses) +# add_dependencies(opt DxilConvPasses) +# endif(WIN32 AND HLSL_BUILD_DXILCONV) -export_executable_symbols(opt) +# export_executable_symbols(opt) -if(WITH_POLLY AND LINK_POLLY_INTO_TOOLS) - target_link_libraries(opt Polly) - if(POLLY_LINK_LIBS) - foreach(lib ${POLLY_LINK_LIBS}) - target_link_libraries(opt ${lib}) - endforeach(lib) - endif(POLLY_LINK_LIBS) -endif(WITH_POLLY AND LINK_POLLY_INTO_TOOLS) +# if(WITH_POLLY AND LINK_POLLY_INTO_TOOLS) +# target_link_libraries(opt Polly) +# if(POLLY_LINK_LIBS) +# foreach(lib ${POLLY_LINK_LIBS}) +# target_link_libraries(opt ${lib}) +# endforeach(lib) +# endif(POLLY_LINK_LIBS) +# endif(WITH_POLLY AND LINK_POLLY_INTO_TOOLS) +#------------------ +# Mach change end +#------------------ diff --git a/utils/KillTheDoctor/KillTheDoctor.cpp b/utils/KillTheDoctor/KillTheDoctor.cpp index b26a96db28..dc4468713a 100644 --- a/utils/KillTheDoctor/KillTheDoctor.cpp +++ b/utils/KillTheDoctor/KillTheDoctor.cpp @@ -396,10 +396,20 @@ int main(int argc, char **argv) { << ec.message() << '\n'; return -1; } - a.LowPart = KernelTime.dwLowDateTime; - a.HighPart = KernelTime.dwHighDateTime; - b.LowPart = UserTime.dwLowDateTime; - b.HighPart = UserTime.dwHighDateTime; + //#------------------ + //# Mach change start + //#------------------ + // a.LowPart = KernelTime.dwLowDateTime; + // a.HighPart = KernelTime.dwHighDateTime; + // b.LowPart = UserTime.dwLowDateTime; + // b.HighPart = UserTime.dwHighDateTime; + a.u.LowPart = KernelTime.dwLowDateTime; + a.u.HighPart = KernelTime.dwHighDateTime; + b.u.LowPart = UserTime.dwLowDateTime; + b.u.HighPart = UserTime.dwHighDateTime; + //#------------------ + //# Mach change end + //#------------------ // Convert 100-nanosecond units to milliseconds. uint64_t TotalTimeMiliseconds = (a.QuadPart + b.QuadPart) / 10000; // Handle the case where the process has been running for more than 49