Skip to content

Commit 8b57d28

Browse files
clang-format: enable sorting includes
Include files are now grouped and sorted in following order: 1. Header file of the class the current file implements 2. Project files 3. Third party files 4. Standard library Change-Id: If31af05652184169f7fee1d7ad08f1b2ed602cf0 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
1 parent 3eb10d0 commit 8b57d28

File tree

1,208 files changed

+3870
-4021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,208 files changed

+3870
-4021
lines changed

.clang-format

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,24 @@ DerivePointerAlignment: false
4848
DisableFormat: false
4949
ExperimentalAutoDetectBinPacking: false
5050
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
51-
IncludeCategories:
52-
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
53-
Priority: 2
54-
- Regex: '^(<|"(gtest|isl|json)/)'
55-
Priority: 3
56-
- Regex: '.*'
51+
IncludeBlocks: Regroup
52+
IncludeCategories:
53+
- Regex: '^.(common|documentation|elf|manifests|offline_compiler|public|runtime|scripts|unit_tests)/'
54+
Priority: 1
55+
- Regex: '^"test\.h"$'
5756
Priority: 1
57+
- Regex: '(d3d9types|d3d10_1)\.h'
58+
Priority: 4
59+
- Regex: '(gfxEscape|windows)\.h'
60+
Priority: 5
61+
- Regex: '^.(third_party|llvm|llvm-c|clang|clang-c|gtest|isl|json)/'
62+
Priority: 5
63+
- Regex: '^.(gmock|cl|gl|d3d)'
64+
Priority: 5
65+
- Regex: '^<.*>$'
66+
Priority: 10
67+
- Regex: '.*'
68+
Priority: 5
5869
IndentCaseLabels: false
5970
IndentWidth: 4
6071
IndentWrappedFunctionNames: false
@@ -74,7 +85,7 @@ PenaltyExcessCharacter: 1000000
7485
PenaltyReturnTypeOnItsOwnLine: 60
7586
PointerAlignment: Right
7687
ReflowComments: true
77-
SortIncludes: false
88+
SortIncludes: true
7889
SpaceAfterCStyleCast: false
7990
SpaceBeforeAssignmentOperators: true
8091
SpaceBeforeParens: ControlStatements

elf/reader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "reader.h"
9+
910
#include <string.h>
1011

1112
namespace CLElfLib {

elf/writer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "writer.h"
9+
910
#include <cstring>
1011

1112
// Need for linux compatibility with memcpy_s

elf/writer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#pragma once
99
#include "types.h"
10+
1011
#include <queue>
1112
#include <string>
1213

offline_compiler/decoder/binary_decoder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
/*
2-
* Copyright (C) 2018 Intel Corporation
2+
* Copyright (C) 2018-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "binary_decoder.h"
9+
910
#include "elf/reader.h"
10-
#include "helper.h"
1111
#include "runtime/helpers/file_io.h"
1212
#include "runtime/helpers/ptr_math.h"
1313

14+
#include "helper.h"
15+
1416
#include <cstring>
1517
#include <fstream>
1618

offline_compiler/decoder/binary_encoder.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
/*
2-
* Copyright (C) 2018 Intel Corporation
2+
* Copyright (C) 2018-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "binary_encoder.h"
9-
#include "CL/cl.h"
9+
1010
#include "elf/writer.h"
11-
#include "helper.h"
1211
#include "runtime/helpers/file_io.h"
1312

13+
#include "CL/cl.h"
14+
#include "helper.h"
15+
1416
#include <algorithm>
1517
#include <cstring>
1618
#include <fstream>

offline_compiler/decoder/binary_encoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* Copyright (C) 2018 Intel Corporation
2+
* Copyright (C) 2018-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#pragma once
99
#include <sstream>
10-
#include <vector>
1110
#include <string>
11+
#include <vector>
1212

1313
class BinaryEncoder {
1414
public:

offline_compiler/decoder/helper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* Copyright (C) 2018 Intel Corporation
2+
* Copyright (C) 2018-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#pragma once
9+
#include <exception>
910
#include <string>
1011
#include <vector>
11-
#include <exception>
1212

1313
void addSlash(std::string &path);
1414

offline_compiler/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "decoder/binary_encoder.h"
9-
#include "decoder/binary_decoder.h"
108
#include "offline_compiler/offline_compiler.h"
119
#include "offline_compiler/utilities/safety_caller.h"
1210
#include "runtime/os_interface/os_library.h"
1311

12+
#include "decoder/binary_decoder.h"
13+
#include "decoder/binary_encoder.h"
1414
#include <CL/cl.h>
1515

1616
using namespace OCLRT;

offline_compiler/offline_compiler.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,32 @@
55
*
66
*/
77

8+
#include "offline_compiler.h"
9+
10+
#include "elf/writer.h"
11+
#include "runtime/helpers/debug_helpers.h"
12+
#include "runtime/helpers/file_io.h"
13+
#include "runtime/helpers/hw_info.h"
14+
#include "runtime/helpers/string.h"
15+
#include "runtime/helpers/validators.h"
16+
#include "runtime/os_interface/debug_settings_manager.h"
17+
#include "runtime/os_interface/os_inc_base.h"
18+
#include "runtime/os_interface/os_library.h"
19+
#include "runtime/platform/extensions.h"
20+
821
#include "cif/common/cif_main.h"
922
#include "cif/helpers/error.h"
1023
#include "cif/import/library_api.h"
24+
#include "igfxfmid.h"
1125
#include "ocl_igc_interface/code_type.h"
1226
#include "ocl_igc_interface/fcl_ocl_device_ctx.h"
1327
#include "ocl_igc_interface/igc_ocl_device_ctx.h"
1428
#include "ocl_igc_interface/platform_helper.h"
15-
#include "offline_compiler.h"
16-
#include "igfxfmid.h"
17-
#include "runtime/helpers/file_io.h"
18-
#include "runtime/os_interface/debug_settings_manager.h"
19-
#include "runtime/os_interface/os_inc_base.h"
20-
#include "runtime/os_interface/os_library.h"
21-
#include "runtime/helpers/string.h"
22-
#include "runtime/helpers/debug_helpers.h"
23-
#include "runtime/helpers/hw_info.h"
24-
#include "runtime/helpers/validators.h"
25-
#include "runtime/platform/extensions.h"
26-
#include "elf/writer.h"
27-
#include <iomanip>
28-
#include <list>
29+
2930
#include <algorithm>
31+
#include <iomanip>
3032
#include <iostream>
33+
#include <list>
3134

3235
#ifdef _WIN32
3336
#include <direct.h>

0 commit comments

Comments
 (0)