Skip to content

Commit ed668e0

Browse files
MrSidimsvladimirlaz
authored andcommitted
Revert sync with llvm xf672b6170ce
Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
1 parent 1e05d93 commit ed668e0

File tree

4,492 files changed

+410543
-99708
lines changed

Some content is hidden

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

4,492 files changed

+410543
-99708
lines changed

clang-tools-extra/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
include(CMakeDependentOption)
2-
31
add_subdirectory(clang-apply-replacements)
42
add_subdirectory(clang-reorder-fields)
53
add_subdirectory(modularize)
@@ -11,6 +9,7 @@ add_subdirectory(clang-doc)
119
add_subdirectory(clang-include-fixer)
1210
add_subdirectory(clang-move)
1311
add_subdirectory(clang-query)
12+
add_subdirectory(clangd)
1413
add_subdirectory(pp-trace)
1514
add_subdirectory(tool-template)
1615

@@ -26,9 +25,3 @@ if( CLANG_TOOLS_EXTRA_INCLUDE_DOCS )
2625
add_subdirectory(docs)
2726
endif()
2827

29-
# clangd has its own CMake tree. It requires threads.
30-
CMAKE_DEPENDENT_OPTION(CLANG_ENABLE_CLANGD "Build clangd language server" ON
31-
"LLVM_ENABLE_THREADS" OFF)
32-
if (CLANG_ENABLE_CLANGD)
33-
add_subdirectory(clangd)
34-
endif()

clang-tools-extra/clang-tidy/add_new_check.py

+10-19
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def adapt_cmake(module_path, check_name_camel):
4646

4747

4848
# Adds a header for the new check.
49-
def write_header(module_path, module, namespace, check_name, check_name_camel):
49+
def write_header(module_path, module, check_name, check_name_camel):
5050
check_name_dashes = module + '-' + check_name
5151
filename = os.path.join(module_path, check_name_camel) + '.h'
5252
print('Creating %s...' % filename)
@@ -73,7 +73,7 @@ def write_header(module_path, module, namespace, check_name, check_name_camel):
7373
7474
namespace clang {
7575
namespace tidy {
76-
namespace %(namespace)s {
76+
namespace %(module)s {
7777
7878
/// FIXME: Write a short description.
7979
///
@@ -87,20 +87,19 @@ class %(check_name)s : public ClangTidyCheck {
8787
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
8888
};
8989
90-
} // namespace %(namespace)s
90+
} // namespace %(module)s
9191
} // namespace tidy
9292
} // namespace clang
9393
9494
#endif // %(header_guard)s
9595
""" % {'header_guard': header_guard,
9696
'check_name': check_name_camel,
9797
'check_name_dashes': check_name_dashes,
98-
'module': module,
99-
'namespace': namespace})
98+
'module': module})
10099

101100

102101
# Adds the implementation of the new check.
103-
def write_implementation(module_path, module, namespace, check_name_camel):
102+
def write_implementation(module_path, module, check_name_camel):
104103
filename = os.path.join(module_path, check_name_camel) + '.cpp'
105104
print('Creating %s...' % filename)
106105
with open(filename, 'w') as f:
@@ -125,7 +124,7 @@ def write_implementation(module_path, module, namespace, check_name_camel):
125124
126125
namespace clang {
127126
namespace tidy {
128-
namespace %(namespace)s {
127+
namespace %(module)s {
129128
130129
void %(check_name)s::registerMatchers(MatchFinder *Finder) {
131130
// FIXME: Add matchers.
@@ -143,12 +142,11 @@ def write_implementation(module_path, module, namespace, check_name_camel):
143142
<< FixItHint::CreateInsertion(MatchedDecl->getLocation(), "awesome_");
144143
}
145144
146-
} // namespace %(namespace)s
145+
} // namespace %(module)s
147146
} // namespace tidy
148147
} // namespace clang
149148
""" % {'check_name': check_name_camel,
150-
'module': module,
151-
'namespace': namespace})
149+
'module': module})
152150

153151

154152
# Modifies the module to include the new check.
@@ -377,15 +375,8 @@ def main():
377375

378376
if not adapt_cmake(module_path, check_name_camel):
379377
return
380-
381-
# Map module names to namespace names that don't conflict with widely used top-level namespaces.
382-
if module == 'llvm':
383-
namespace = module + '_check'
384-
else:
385-
namespace = module
386-
387-
write_header(module_path, module, namespace, check_name, check_name_camel)
388-
write_implementation(module_path, module, namespace, check_name_camel)
378+
write_header(module_path, module, check_name, check_name_camel)
379+
write_implementation(module_path, module, check_name_camel)
389380
adapt_module(module_path, module, check_name, check_name_camel)
390381
add_release_notes(module_path, module, check_name)
391382
test_extension = language_to_extension.get(args.language)

clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp

-226
This file was deleted.

clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.h

-39
This file was deleted.

0 commit comments

Comments
 (0)