Skip to content

Commit 578114e

Browse files
authored
[NFC] Update DXC sources for clang-format (microsoft#5593)
One more batch of NFC changes to get DXC ready to clang-format. This change disables clang-format of some include blocks and breaks other include blocks into groups. With this change all of the sources in DXC can be clang-formatted and will continue to build on all supported platforms.
1 parent cd0e32c commit 578114e

File tree

19 files changed

+70
-30
lines changed

19 files changed

+70
-30
lines changed

include/dxc/DxilContainer/DxilRuntimeReflection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#pragma once
1313

1414
#include "dxc/DXIL/DxilConstants.h"
15-
#include "dxc/WinAdapter.h"
15+
#include "dxc/Support/WinIncludes.h"
1616

1717
#define RDAT_NULL_REF ((uint32_t)0xFFFFFFFF)
1818

include/dxc/Support/HLSLOptions.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
#include "llvm/ADT/ArrayRef.h"
1818
#include "llvm/ADT/StringRef.h"
1919
#include "llvm/Option/ArgList.h"
20-
#include "dxc/dxcapi.h"
2120
#include "dxc/Support/HLSLVersion.h"
2221
#include "dxc/Support/SPIRVOptions.h"
2322
#include "dxc/Support/DxcOptToggles.h"
23+
24+
#include "dxc/Support/WinIncludes.h"
25+
26+
#include "dxc/dxcapi.h"
27+
2428
#include <map>
2529
#include <set>
2630

include/dxc/Test/DxcTestUtils.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@
1111

1212
#pragma once
1313

14-
#include <string>
15-
#include <vector>
16-
#include <map>
14+
15+
#include "dxc/Support/WinIncludes.h"
16+
1717
#include "dxc/dxcapi.h"
1818
#include "dxc/Support/dxcapi.use.h"
1919
#include "llvm/ADT/ArrayRef.h"
2020
#include "llvm/ADT/StringRef.h"
2121
#include "llvm/ADT/StringMap.h"
2222

23+
#include <string>
24+
#include <vector>
25+
#include <map>
26+
2327
namespace hlsl {
2428
namespace options {
2529
class DxcOpts;

lib/DxcSupport/HLSLOptions.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// //
99
///////////////////////////////////////////////////////////////////////////////
1010

11+
#include "dxc/Support/WinIncludes.h"
12+
13+
#include "dxc/Support/dxcapi.use.h"
14+
1115
#include "llvm/ADT/STLExtras.h"
1216
#include "llvm/Option/OptTable.h"
1317
#include "llvm/Option/Option.h"
@@ -16,10 +20,8 @@
1620
#include "llvm/ADT/APInt.h"
1721
#include "llvm/ADT/StringSwitch.h"
1822
#include "dxc/Support/Global.h"
19-
#include "dxc/Support/WinIncludes.h"
2023
#include "dxc/Support/HLSLOptions.h"
2124
#include "dxc/Support/Unicode.h"
22-
#include "dxc/Support/dxcapi.use.h"
2325
#include "dxc/DXIL/DxilShaderModel.h"
2426

2527
using namespace llvm::opt;

lib/DxcSupport/dxcapi.use.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
///////////////////////////////////////////////////////////////////////////////
1111

1212
#include "dxc/Support/WinIncludes.h"
13+
1314
#include "dxc/Support/dxcapi.use.h"
15+
1416
#include "dxc/Support/Global.h"
1517
#include "dxc/Support/Unicode.h"
1618
#include "dxc/Support/FileIOHelper.h"

projects/dxilconv/include/DxbcConverter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef __DXBC_CONVERTER__H__
1313
#define __DXBC_CONVERTER__H__
1414

15+
#include "dxc/dxcapi.h"
16+
1517
#ifndef _MSC_VER
1618
extern "C"
1719
#endif

projects/dxilconv/include/DxilConvPasses/ScopeNest.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
#pragma once
4040

41+
#include "llvm/Pass.h"
42+
4143
namespace llvm {
4244

4345
struct ScopeNestEvent {

projects/dxilconv/lib/DxbcConverter/DxbcConverter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
// //
1010
///////////////////////////////////////////////////////////////////////////////
1111

12-
#include "llvm/Support/Debug.h"
12+
#include "llvm/Support/Debug.h" // Must be included first.
13+
1314
#include "DxbcConverterImpl.h"
1415
#include "DxilConvPasses/DxilCleanup.h"
1516
#include "dxc/DxilContainer/DxilContainer.h"

projects/dxilconv/lib/DxbcConverter/DxbcUtil.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#pragma once
1313

14+
#include "Support/DXIncludes.h"
15+
1416
#include "dxc/DXIL/DxilShaderModel.h"
1517
#include "dxc/DXIL/DxilSemantic.h"
1618
#include "dxc/DXIL/DxilInterpolationMode.h"

projects/dxilconv/tools/dxilconv/dxilconv.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
#include "llvm/Support/ManagedStatic.h"
1313
#include "llvm/Support/FileSystem.h"
1414
#include "llvm/Support/MD5.h"
15+
1516
#include "dxc/Support/WinIncludes.h"
1617
#include "dxc/Support/Global.h"
18+
1719
#include "Tracing/DxcRuntimeEtw.h"
1820

1921
#define DXC_API_IMPORT

0 commit comments

Comments
 (0)