Skip to content

Commit c168eb2

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into AddSupportForLLVMFPIntrinsic
2 parents 04f7ecb + e9423ff commit c168eb2

File tree

1,936 files changed

+141476
-24828
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,936 files changed

+141476
-24828
lines changed

.github/workflows/main-branch-sync.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ jobs:
1212
- name: Checkout Code
1313
uses: actions/checkout@v2
1414
with:
15+
# persist-credentials: false allows us to use our own credentials for
16+
# pushing to the repository. Otherwise, the default github actions token
17+
# is used.
18+
persist-credentials: false
1519
fetch-depth: 0
1620

1721
- name: Update branch
1822
env:
1923
LLVMBOT_TOKEN: ${{ secrets.LLVMBOT_MAIN_SYNC }}
2024
run: |
21-
git push https://[email protected]/${{ github.repository }} HEAD:temp-test-main
25+
git push https://[email protected]/${{ github.repository }} HEAD:main

clang-tools-extra/clang-move/Move.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,10 @@ void ClangMoveTool::addIncludes(llvm::StringRef IncludeHeader, bool IsAngled,
691691
llvm::StringRef FileName,
692692
CharSourceRange IncludeFilenameRange,
693693
const SourceManager &SM) {
694-
SmallVector<char, 128> HeaderWithSearchPath;
694+
SmallString<128> HeaderWithSearchPath;
695695
llvm::sys::path::append(HeaderWithSearchPath, SearchPath, IncludeHeader);
696696
std::string AbsoluteIncludeHeader =
697-
MakeAbsolutePath(SM, llvm::StringRef(HeaderWithSearchPath.data(),
698-
HeaderWithSearchPath.size()));
697+
MakeAbsolutePath(SM, HeaderWithSearchPath);
699698
std::string IncludeLine =
700699
IsAngled ? ("#include <" + IncludeHeader + ">\n").str()
701700
: ("#include \"" + IncludeHeader + "\"\n").str();

clang-tools-extra/clang-tidy/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ add_subdirectory(altera)
5555
add_subdirectory(boost)
5656
add_subdirectory(bugprone)
5757
add_subdirectory(cert)
58+
add_subdirectory(concurrency)
5859
add_subdirectory(cppcoreguidelines)
5960
add_subdirectory(darwin)
6061
add_subdirectory(fuchsia)
@@ -81,6 +82,7 @@ set(ALL_CLANG_TIDY_CHECKS
8182
clangTidyBoostModule
8283
clangTidyBugproneModule
8384
clangTidyCERTModule
85+
clangTidyConcurrencyModule
8486
clangTidyCppCoreGuidelinesModule
8587
clangTidyDarwinModule
8688
clangTidyFuchsiaModule

clang-tools-extra/clang-tidy/ClangTidyForceLinker.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ extern volatile int CERTModuleAnchorSource;
4545
static int LLVM_ATTRIBUTE_UNUSED CERTModuleAnchorDestination =
4646
CERTModuleAnchorSource;
4747

48+
// This anchor is used to force the linker to link the ConcurrencyModule.
49+
extern volatile int ConcurrencyModuleAnchorSource;
50+
static int LLVM_ATTRIBUTE_UNUSED ConcurrencyModuleAnchorDestination =
51+
ConcurrencyModuleAnchorSource;
52+
4853
// This anchor is used to force the linker to link the CppCoreGuidelinesModule.
4954
extern volatile int CppCoreGuidelinesModuleAnchorSource;
5055
static int LLVM_ATTRIBUTE_UNUSED CppCoreGuidelinesModuleAnchorDestination =

clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ using ::clang::transformer::cat;
2929
using ::clang::transformer::change;
3030
using ::clang::transformer::makeRule;
3131
using ::clang::transformer::node;
32+
using ::clang::transformer::RewriteRule;
3233

3334
static const char DefaultStringLikeClasses[] = "::std::basic_string;"
3435
"::std::basic_string_view;"
@@ -69,7 +70,7 @@ MakeRule(const LangOptions &LangOpts,
6970
hasArgument(1, cxxDefaultArgExpr())),
7071
onImplicitObjectArgument(expr().bind("string_being_searched")));
7172

72-
tooling::RewriteRule rule = applyFirst(
73+
RewriteRule rule = applyFirst(
7374
{makeRule(binaryOperator(hasOperatorName("=="),
7475
hasOperands(ignoringParenImpCasts(StringNpos),
7576
ignoringParenImpCasts(StringFind))),
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set(LLVM_LINK_COMPONENTS
2+
FrontendOpenMP
3+
Support
4+
)
5+
6+
add_clang_library(clangTidyConcurrencyModule
7+
ConcurrencyTidyModule.cpp
8+
MtUnsafeCheck.cpp
9+
10+
LINK_LIBS
11+
clangTidy
12+
clangTidyUtils
13+
)
14+
15+
clang_target_link_libraries(clangTidyConcurrencyModule
16+
PRIVATE
17+
clangAnalysis
18+
clangAST
19+
clangASTMatchers
20+
clangBasic
21+
clangLex
22+
clangSerialization
23+
clangTooling
24+
)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//===--- ConcurrencyTidyModule.cpp - clang-tidy ---------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "../ClangTidy.h"
10+
#include "../ClangTidyModule.h"
11+
#include "../ClangTidyModuleRegistry.h"
12+
#include "MtUnsafeCheck.h"
13+
14+
namespace clang {
15+
namespace tidy {
16+
namespace concurrency {
17+
18+
class ConcurrencyModule : public ClangTidyModule {
19+
public:
20+
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
21+
CheckFactories.registerCheck<concurrency::MtUnsafeCheck>(
22+
"concurrency-mt-unsafe");
23+
}
24+
};
25+
26+
} // namespace concurrency
27+
28+
// Register the ConcurrencyTidyModule using this statically initialized variable.
29+
static ClangTidyModuleRegistry::Add<concurrency::ConcurrencyModule>
30+
X("concurrency-module", "Adds concurrency checks.");
31+
32+
// This anchor is used to force the linker to link in the generated object file
33+
// and thus register the ConcurrencyModule.
34+
volatile int ConcurrencyModuleAnchorSource = 0;
35+
36+
} // namespace tidy
37+
} // namespace clang

0 commit comments

Comments
 (0)