From 52e639230e9f1e1dd8f65e17ccedc93ad736375b Mon Sep 17 00:00:00 2001 From: Greg Roth Date: Tue, 28 Feb 2023 11:41:50 -0700 Subject: [PATCH 1/2] Move WinAdapter into interface directory (#5066) Since it is shipped and relied upon, the WinAdapter header belongs in the release directory. This removes the need to include the Support directory for building purposes revises fix to #4918 (cherry picked from commit 5eb7c77d7c8ee0f513e27170c6fed855ac21de80) --- CMakeLists.txt | 1 - include/dxc/DxilContainer/DxilContainer.h | 2 +- include/dxc/DxilContainer/DxilPipelineStateValidation.h | 2 +- include/dxc/DxilContainer/DxilRuntimeReflection.h | 2 +- include/dxc/DxilRootSignature/DxilRootSignature.h | 2 +- include/dxc/HLSL/DxilValidation.h | 2 +- include/dxc/Support/Global.h | 2 +- include/dxc/Support/WinFunctions.h | 2 +- include/dxc/Support/WinIncludes.h | 2 +- include/dxc/Support/exception.h | 2 +- include/dxc/Test/WEXAdapter.h | 2 +- include/dxc/{Support => }/WinAdapter.h | 0 include/llvm-c/Core.h | 2 +- include/llvm-c/Disassembler.h | 2 +- include/llvm/ADT/STLExtras.h | 2 +- include/llvm/Analysis/ConstantFolding.h | 2 +- include/llvm/MC/MCStreamer.h | 2 +- include/llvm/Support/ConvertUTF.h | 2 +- include/llvm/Support/FileSystem.h | 2 +- include/llvm/Support/Format.h | 2 +- include/llvm/Support/MathExtras.h | 2 +- include/llvm/TableGen/Main.h | 2 +- lib/DXIL/DxilModule.cpp | 2 +- lib/DXIL/DxilModuleHelper.cpp | 2 +- lib/DxilContainer/DxilContainerReader.cpp | 2 +- lib/HLSL/DxilContainerReflection.cpp | 2 +- lib/HLSL/HLModule.cpp | 2 +- lib/MSSupport/MSFileSystemImpl.cpp | 2 +- lib/Support/ConvertUTFWrapper.cpp | 2 +- lib/Support/regerror.c | 2 +- lib/Support/regex_impl.h | 2 +- tools/clang/include/clang/AST/HlslTypes.h | 2 +- tools/clang/lib/Sema/SemaHLSL.cpp | 2 +- tools/clang/tools/dxcompiler/dxillib.h | 2 +- tools/clang/unittests/HLSL/HLSLTestOptions.cpp | 2 +- 35 files changed, 33 insertions(+), 34 deletions(-) rename include/dxc/{Support => }/WinAdapter.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6e06d1f2..4a9a60c2ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -608,7 +608,6 @@ endif() include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) -include_directories( ${LLVM_MAIN_INCLUDE_DIR}/dxc/Support) # HLSL Change include_directories( ${LLVM_INCLUDE_DIR}/dxc/Tracing) # HLSL Change # when crosscompiling import the executable targets from a file diff --git a/include/dxc/DxilContainer/DxilContainer.h b/include/dxc/DxilContainer/DxilContainer.h index 5dca11ceb3..6f24c163de 100644 --- a/include/dxc/DxilContainer/DxilContainer.h +++ b/include/dxc/DxilContainer/DxilContainer.h @@ -17,7 +17,7 @@ #include #include #include "dxc/DXIL/DxilConstants.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" struct IDxcContainerReflection; diff --git a/include/dxc/DxilContainer/DxilPipelineStateValidation.h b/include/dxc/DxilContainer/DxilPipelineStateValidation.h index febf49bb55..2cf401c28a 100644 --- a/include/dxc/DxilContainer/DxilPipelineStateValidation.h +++ b/include/dxc/DxilContainer/DxilPipelineStateValidation.h @@ -14,7 +14,7 @@ #include #include -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" // Don't include assert.h here. // Since this header is included from multiple environments, diff --git a/include/dxc/DxilContainer/DxilRuntimeReflection.h b/include/dxc/DxilContainer/DxilRuntimeReflection.h index 80d93d5b91..3ed49d403f 100644 --- a/include/dxc/DxilContainer/DxilRuntimeReflection.h +++ b/include/dxc/DxilContainer/DxilRuntimeReflection.h @@ -12,7 +12,7 @@ #pragma once #include "dxc/DXIL/DxilConstants.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #define RDAT_NULL_REF ((uint32_t)0xFFFFFFFF) diff --git a/include/dxc/DxilRootSignature/DxilRootSignature.h b/include/dxc/DxilRootSignature/DxilRootSignature.h index 87d0bf9b0f..d3104f366e 100644 --- a/include/dxc/DxilRootSignature/DxilRootSignature.h +++ b/include/dxc/DxilRootSignature/DxilRootSignature.h @@ -16,7 +16,7 @@ #include -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/DXIL/DxilConstants.h" struct IDxcBlob; diff --git a/include/dxc/HLSL/DxilValidation.h b/include/dxc/HLSL/DxilValidation.h index e57cfff0bb..6a9cdd1bee 100644 --- a/include/dxc/HLSL/DxilValidation.h +++ b/include/dxc/HLSL/DxilValidation.h @@ -13,7 +13,7 @@ #include "dxc/Support/Global.h" #include "dxc/DXIL/DxilConstants.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include namespace llvm { diff --git a/include/dxc/Support/Global.h b/include/dxc/Support/Global.h index 317f38c42d..3b88ed6836 100644 --- a/include/dxc/Support/Global.h +++ b/include/dxc/Support/Global.h @@ -27,7 +27,7 @@ typedef _Return_type_success_(return >= 0) long HRESULT; #include #include #include "dxc/Support/exception.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" /////////////////////////////////////////////////////////////////////////////// // Memory allocation support. diff --git a/include/dxc/Support/WinFunctions.h b/include/dxc/Support/WinFunctions.h index 0f1efe3e6e..28c826f75f 100644 --- a/include/dxc/Support/WinFunctions.h +++ b/include/dxc/Support/WinFunctions.h @@ -17,7 +17,7 @@ #ifndef _WIN32 -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" HRESULT StringCchCopyEx(LPSTR pszDest, size_t cchDest, LPCSTR pszSrc, LPSTR *ppszDestEnd, size_t *pcchRemaining, DWORD dwFlags); diff --git a/include/dxc/Support/WinIncludes.h b/include/dxc/Support/WinIncludes.h index 80178d5093..a0c611c484 100644 --- a/include/dxc/Support/WinIncludes.h +++ b/include/dxc/Support/WinIncludes.h @@ -59,7 +59,7 @@ template void swap(CComHeapPtr &a, CComHeapPtr &b) { #else // _MSC_VER -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #ifdef __cplusplus // Define operator overloads to enable bit operations on enum values that are diff --git a/include/dxc/Support/exception.h b/include/dxc/Support/exception.h index ff3f32109d..bff4e73064 100644 --- a/include/dxc/Support/exception.h +++ b/include/dxc/Support/exception.h @@ -11,7 +11,7 @@ #pragma once #include "dxc/Support/ErrorCodes.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include #include diff --git a/include/dxc/Test/WEXAdapter.h b/include/dxc/Test/WEXAdapter.h index 8389ca5c04..c9eba87dc5 100644 --- a/include/dxc/Test/WEXAdapter.h +++ b/include/dxc/Test/WEXAdapter.h @@ -6,7 +6,7 @@ #include #include -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/Support/WinFunctions.h" #include "gtest/gtest.h" diff --git a/include/dxc/Support/WinAdapter.h b/include/dxc/WinAdapter.h similarity index 100% rename from include/dxc/Support/WinAdapter.h rename to include/dxc/WinAdapter.h diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index ec6be5d0d2..b0c49dfcf7 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -15,7 +15,7 @@ #ifndef LLVM_C_CORE_H #define LLVM_C_CORE_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm-c/Support.h" #ifdef __cplusplus diff --git a/include/llvm-c/Disassembler.h b/include/llvm-c/Disassembler.h index 7c12236c2d..7cc8f88145 100644 --- a/include/llvm-c/Disassembler.h +++ b/include/llvm-c/Disassembler.h @@ -15,7 +15,7 @@ #ifndef LLVM_C_DISASSEMBLER_H #define LLVM_C_DISASSEMBLER_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/Support/DataTypes.h" #include diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index aa88db01bb..5144c598d5 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -17,7 +17,7 @@ #ifndef LLVM_ADT_STLEXTRAS_H #define LLVM_ADT_STLEXTRAS_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/Support/Compiler.h" #include // for std::all_of #include diff --git a/include/llvm/Analysis/ConstantFolding.h b/include/llvm/Analysis/ConstantFolding.h index cc457e723b..292d0a05c6 100644 --- a/include/llvm/Analysis/ConstantFolding.h +++ b/include/llvm/Analysis/ConstantFolding.h @@ -20,7 +20,7 @@ #ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H #define LLVM_ANALYSIS_CONSTANTFOLDING_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change namespace llvm { class Constant; diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 507328e292..f7b2c8279d 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -14,7 +14,7 @@ #ifndef LLVM_MC_MCSTREAMER_H #define LLVM_MC_MCSTREAMER_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCDirectives.h" diff --git a/include/llvm/Support/ConvertUTF.h b/include/llvm/Support/ConvertUTF.h index 3ad4275ebc..0513a72e46 100644 --- a/include/llvm/Support/ConvertUTF.h +++ b/include/llvm/Support/ConvertUTF.h @@ -180,7 +180,7 @@ unsigned getNumBytesForUTF8(UTF8 firstByte); /*************************************************************************/ /* Below are LLVM-specific wrappers of the functions above. */ -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index 208336f50a..4ccd2954b8 100644 --- a/include/llvm/Support/FileSystem.h +++ b/include/llvm/Support/FileSystem.h @@ -27,7 +27,7 @@ #ifndef LLVM_SUPPORT_FILESYSTEM_H #define LLVM_SUPPORT_FILESYSTEM_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" diff --git a/include/llvm/Support/Format.h b/include/llvm/Support/Format.h index 94190ecac6..67ee193e2b 100644 --- a/include/llvm/Support/Format.h +++ b/include/llvm/Support/Format.h @@ -23,7 +23,7 @@ #ifndef LLVM_SUPPORT_FORMAT_H #define LLVM_SUPPORT_FORMAT_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index a97139fb73..8aed823e27 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -14,7 +14,7 @@ #ifndef LLVM_SUPPORT_MATHEXTRAS_H #define LLVM_SUPPORT_MATHEXTRAS_H -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/Support/Compiler.h" #include "llvm/Support/SwapByteOrder.h" #include diff --git a/include/llvm/TableGen/Main.h b/include/llvm/TableGen/Main.h index 4fff09c35e..664bb6ba3f 100644 --- a/include/llvm/TableGen/Main.h +++ b/include/llvm/TableGen/Main.h @@ -18,7 +18,7 @@ #ifdef _WIN32 #include #else -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #endif // HLSL Change Ends diff --git a/lib/DXIL/DxilModule.cpp b/lib/DXIL/DxilModule.cpp index 2166cc71c9..e39080041a 100644 --- a/lib/DXIL/DxilModule.cpp +++ b/lib/DXIL/DxilModule.cpp @@ -14,7 +14,7 @@ #include "dxc/DXIL/DxilShaderModel.h" #include "dxc/DXIL/DxilSignatureElement.h" #include "dxc/DXIL/DxilFunctionProps.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/DXIL/DxilEntryProps.h" #include "dxc/DXIL/DxilSubobject.h" #include "dxc/DXIL/DxilInstructions.h" diff --git a/lib/DXIL/DxilModuleHelper.cpp b/lib/DXIL/DxilModuleHelper.cpp index 3bdf87293a..898faee3f6 100644 --- a/lib/DXIL/DxilModuleHelper.cpp +++ b/lib/DXIL/DxilModuleHelper.cpp @@ -14,7 +14,7 @@ #include "dxc/DXIL/DxilShaderModel.h" #include "dxc/DXIL/DxilSignatureElement.h" #include "dxc/DXIL/DxilFunctionProps.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/DXIL/DxilEntryProps.h" #include "dxc/DXIL/DxilSubobject.h" #include "dxc/DXIL/DxilInstructions.h" diff --git a/lib/DxilContainer/DxilContainerReader.cpp b/lib/DxilContainer/DxilContainerReader.cpp index 6db65335a9..bf0084788a 100644 --- a/lib/DxilContainer/DxilContainerReader.cpp +++ b/lib/DxilContainer/DxilContainerReader.cpp @@ -10,7 +10,7 @@ /////////////////////////////////////////////////////////////////////////////// #include "dxc/Support/Global.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/DxilContainer/DxilContainer.h" #include "dxc/DxilContainer/DxilContainerReader.h" diff --git a/lib/HLSL/DxilContainerReflection.cpp b/lib/HLSL/DxilContainerReflection.cpp index 5f7ae48e16..4df43c7649 100644 --- a/lib/HLSL/DxilContainerReflection.cpp +++ b/lib/HLSL/DxilContainerReflection.cpp @@ -42,7 +42,7 @@ #else // Dummy D3D11 struct to allow nix-dead code to compile struct D3D11_SHADER_INPUT_BIND_DESC {int dummy;}; -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #endif #include "dxc/DxilContainer/DxilRuntimeReflection.h" diff --git a/lib/HLSL/HLModule.cpp b/lib/HLSL/HLModule.cpp index 117c25f7c3..ac6a2d217f 100644 --- a/lib/HLSL/HLModule.cpp +++ b/lib/HLSL/HLModule.cpp @@ -15,7 +15,7 @@ #include "dxc/HLSL/HLModule.h" #include "dxc/DXIL/DxilTypeSystem.h" #include "dxc/DXIL/DxilUtil.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "llvm/ADT/STLExtras.h" #include "llvm/IR/Constants.h" diff --git a/lib/MSSupport/MSFileSystemImpl.cpp b/lib/MSSupport/MSFileSystemImpl.cpp index f37c6aff3b..b7a77ad3fd 100644 --- a/lib/MSSupport/MSFileSystemImpl.cpp +++ b/lib/MSSupport/MSFileSystemImpl.cpp @@ -26,7 +26,7 @@ #include #include "dxc/Support/WinIncludes.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "llvm/Support/MSFileSystem.h" /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/lib/Support/ConvertUTFWrapper.cpp b/lib/Support/ConvertUTFWrapper.cpp index 20477bd930..aab7d2cfe4 100644 --- a/lib/Support/ConvertUTFWrapper.cpp +++ b/lib/Support/ConvertUTFWrapper.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/SwapByteOrder.h" #include diff --git a/lib/Support/regerror.c b/lib/Support/regerror.c index 95b3ae89c8..782b75deaf 100644 --- a/lib/Support/regerror.c +++ b/lib/Support/regerror.c @@ -45,7 +45,7 @@ #include "regutils.h" -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #ifdef _MSC_VER #define snprintf _snprintf diff --git a/lib/Support/regex_impl.h b/lib/Support/regex_impl.h index bbf64cfb2d..1b05eaad1f 100644 --- a/lib/Support/regex_impl.h +++ b/lib/Support/regex_impl.h @@ -38,7 +38,7 @@ #ifndef _REGEX_IMPL_H_ // HLSL Change #define _REGEX_IMPL_H_ // HLSL Change -#include "dxc/Support/WinAdapter.h" // HLSL Change +#include "dxc/WinAdapter.h" // HLSL Change #include typedef off_t llvm_regoff_t; diff --git a/tools/clang/include/clang/AST/HlslTypes.h b/tools/clang/include/clang/AST/HlslTypes.h index 90766c9f04..3b19bde7e7 100644 --- a/tools/clang/include/clang/AST/HlslTypes.h +++ b/tools/clang/include/clang/AST/HlslTypes.h @@ -20,7 +20,7 @@ #include "clang/Basic/SourceLocation.h" #include "clang/Basic/Specifiers.h" #include "dxc/DXIL/DxilConstants.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "llvm/Support/Casting.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp index eff1b59d80..627c08f611 100644 --- a/tools/clang/lib/Sema/SemaHLSL.cpp +++ b/tools/clang/lib/Sema/SemaHLSL.cpp @@ -36,7 +36,7 @@ #include "llvm/Support/raw_ostream.h" #include "dxc/Support/Global.h" #include "dxc/Support/WinIncludes.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/dxcapi.internal.h" #include "dxc/HlslIntrinsicOp.h" #include "gen_intrin_main_tables_15.h" diff --git a/tools/clang/tools/dxcompiler/dxillib.h b/tools/clang/tools/dxcompiler/dxillib.h index 5d4caea0f7..39e0bbe8e3 100644 --- a/tools/clang/tools/dxcompiler/dxillib.h +++ b/tools/clang/tools/dxcompiler/dxillib.h @@ -13,7 +13,7 @@ #ifndef __DXC_DXILLIB__ #define __DXC_DXILLIB__ -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/Support/WinIncludes.h" // Initialize Dxil library. diff --git a/tools/clang/unittests/HLSL/HLSLTestOptions.cpp b/tools/clang/unittests/HLSL/HLSLTestOptions.cpp index a56dc161cd..15963ec526 100644 --- a/tools/clang/unittests/HLSL/HLSLTestOptions.cpp +++ b/tools/clang/unittests/HLSL/HLSLTestOptions.cpp @@ -14,7 +14,7 @@ #include "HLSLTestOptions.h" #include "dxc/Test/WEXAdapter.h" -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" namespace clang { namespace hlsl { From d3baa77980bbeac3e79ceec47cb119197ff7a8c9 Mon Sep 17 00:00:00 2001 From: Greg Roth Date: Tue, 28 Feb 2023 11:40:33 -0800 Subject: [PATCH 2/2] Addon refernce in file not present in main --- lib/DxcSupport/WinAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DxcSupport/WinAdapter.cpp b/lib/DxcSupport/WinAdapter.cpp index 81a27b5979..8ed47bfc84 100644 --- a/lib/DxcSupport/WinAdapter.cpp +++ b/lib/DxcSupport/WinAdapter.cpp @@ -9,7 +9,7 @@ #ifndef _WIN32 -#include "dxc/Support/WinAdapter.h" +#include "dxc/WinAdapter.h" #include "dxc/Support/WinFunctions.h" //===--------------------------- CAllocator -------------------------------===//