Skip to content

Commit dfde4b6

Browse files
author
Sergey Kanaev
committed
Merge branch 'sycl' into private/s-kanaev/kp-cache
2 parents 0142d6a + 6f9e9a7 commit dfde4b6

File tree

4,784 files changed

+560662
-59759
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,784 files changed

+560662
-59759
lines changed

.git-blame-ignore-revs

+9
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ d8f0e6caa91e230a486c948ab643174e40bdf215
3131

3232
# Remove line-endings added by r320089. NFC.
3333
100a0eedc00b2bf48bcdc6c209c000745a4a0e48
34+
35+
# Cleanup __config indention. NFC.
36+
2b772b930e097ed6f06d698a51e291c7fd318baa
37+
38+
# Fixing whitespace problems
39+
94b2dd0998230c758abd92c99d3700c971f7a31a
40+
41+
# Wiped out some non-ascii characters that snuck into the copyright.
42+
5b08a8a43254ed30bd953e869b0fd9fc1e8b82d0

buildbot/dependency.conf

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ ocl_cpu_rt_ver=2020.11.8.0.27
44
# https://github.com/intel/llvm/releases/download/2020-WW36/win-oclcpuexp-2020.11.8.0.27_rel.zip
55
ocl_cpu_rt_ver_win=2020.11.8.0.27
66
# Same GPU driver supports Level Zero and OpenCL:
7-
# https://github.com/intel/compute-runtime/releases/tag/20.35.17767
8-
ocl_gpu_rt_ver=20.35.17767
7+
# https://github.com/intel/compute-runtime/releases/tag/20.37.17906
8+
ocl_gpu_rt_ver=20.37.17906
99
# Same GPU driver supports Level Zero and OpenCL:
10-
# https://downloadmirror.intel.com/29817/a08/igfx_win10_100.8673.zip
11-
ocl_gpu_rt_ver_win=27.20.100.8673
10+
# https://downloadmirror.intel.com/29879/a08/igfx_win10_100.8778.zip
11+
ocl_gpu_rt_ver_win=27.20.100.8778
1212
intel_sycl_ver=build
1313
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.1-beta08/oneapi-tbb-2021.1-beta08-lin.tgz
1414
tbb_ver=2021.1.9.636
@@ -24,8 +24,8 @@ fpga_ver_win=20200811_000006
2424
[DRIVER VERSIONS]
2525
cpu_driver_lin=2020.11.8.0.27
2626
cpu_driver_win=2020.11.8.0.27
27-
gpu_driver_lin=20.35.17767
28-
gpu_driver_win=27.20.100.8673
27+
gpu_driver_lin=20.37.17906
28+
gpu_driver_win=27.20.100.8778
2929
fpga_driver_lin=2020.11.8.0.27
3030
fpga_driver_win=2020.11.8.0.27
3131
# NVidia CUDA driver

buildbot/dependency.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ def do_dependency(args):
5858
# fetch and build OpenCL ICD loader
5959
icd_loader_dir = os.path.join(args.obj_dir, "OpenCL-ICD-Loader")
6060
if not os.path.isdir(icd_loader_dir):
61-
clone_cmd = ["git", "clone", "https://github.com/KhronosGroup/OpenCL-ICD-Loader", "OpenCL-ICD-Loader"]
61+
clone_cmd = ["git", "clone",
62+
"https://github.com/KhronosGroup/OpenCL-ICD-Loader",
63+
"OpenCL-ICD-Loader", "-b", "v2020.06.16"]
64+
6265
subprocess.check_call(clone_cmd, cwd=args.obj_dir)
6366
else:
6467
fetch_cmd = ["git", "pull", "--ff", "--ff-only", "origin"]

clang-tools-extra/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
include(CMakeDependentOption)
22

3+
option(CLANG_TIDY_ENABLE_STATIC_ANALYZER
4+
"Include static analyzer checks in clang-tidy" ON)
5+
36
add_subdirectory(clang-apply-replacements)
47
add_subdirectory(clang-reorder-fields)
58
add_subdirectory(modularize)

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

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ set(LLVM_LINK_COMPONENTS
33
Support
44
)
55

6+
configure_file(
7+
${CMAKE_CURRENT_SOURCE_DIR}/clang-tidy-config.h.cmake
8+
${CMAKE_CURRENT_BINARY_DIR}/clang-tidy-config.h)
9+
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
10+
611
add_clang_library(clangTidy
712
ClangTidy.cpp
813
ClangTidyCheck.cpp
@@ -34,7 +39,7 @@ clang_target_link_libraries(clangTidy
3439
clangToolingCore
3540
)
3641

37-
if(CLANG_ENABLE_STATIC_ANALYZER)
42+
if(CLANG_TIDY_ENABLE_STATIC_ANALYZER)
3843
clang_target_link_libraries(clangTidy
3944
PRIVATE
4045
clangStaticAnalyzerCore
@@ -46,6 +51,7 @@ endif()
4651
# If you add a check, also add it to ClangTidyForceLinker.h in this directory.
4752
add_subdirectory(android)
4853
add_subdirectory(abseil)
54+
add_subdirectory(altera)
4955
add_subdirectory(boost)
5056
add_subdirectory(bugprone)
5157
add_subdirectory(cert)
@@ -59,7 +65,7 @@ add_subdirectory(llvm)
5965
add_subdirectory(llvmlibc)
6066
add_subdirectory(misc)
6167
add_subdirectory(modernize)
62-
if(CLANG_ENABLE_STATIC_ANALYZER)
68+
if(CLANG_TIDY_ENABLE_STATIC_ANALYZER)
6369
add_subdirectory(mpi)
6470
endif()
6571
add_subdirectory(objc)
@@ -71,6 +77,7 @@ add_subdirectory(zircon)
7177
set(ALL_CLANG_TIDY_CHECKS
7278
clangTidyAndroidModule
7379
clangTidyAbseilModule
80+
clangTidyAlteraModule
7481
clangTidyBoostModule
7582
clangTidyBugproneModule
7683
clangTidyCERTModule
@@ -91,7 +98,7 @@ set(ALL_CLANG_TIDY_CHECKS
9198
clangTidyReadabilityModule
9299
clangTidyZirconModule
93100
)
94-
if(CLANG_ENABLE_STATIC_ANALYZER)
101+
if(CLANG_TIDY_ENABLE_STATIC_ANALYZER)
95102
list(APPEND ALL_CLANG_TIDY_CHECKS clangTidyMPIModule)
96103
endif()
97104
set(ALL_CLANG_TIDY_CHECKS ${ALL_CLANG_TIDY_CHECKS} PARENT_SCOPE)

clang-tools-extra/clang-tidy/ClangTidy.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#include "ClangTidyModuleRegistry.h"
2121
#include "ClangTidyProfiling.h"
2222
#include "ExpandModularHeadersPPCallbacks.h"
23+
#include "clang-tidy-config.h"
2324
#include "clang/AST/ASTConsumer.h"
2425
#include "clang/AST/ASTContext.h"
2526
#include "clang/AST/Decl.h"
2627
#include "clang/ASTMatchers/ASTMatchFinder.h"
27-
#include "clang/Config/config.h"
2828
#include "clang/Format/Format.h"
2929
#include "clang/Frontend/ASTConsumers.h"
3030
#include "clang/Frontend/CompilerInstance.h"
@@ -47,10 +47,10 @@
4747
#include <algorithm>
4848
#include <utility>
4949

50-
#if CLANG_ENABLE_STATIC_ANALYZER
50+
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
5151
#include "clang/Analysis/PathDiagnostic.h"
5252
#include "clang/StaticAnalyzer/Frontend/AnalysisConsumer.h"
53-
#endif // CLANG_ENABLE_STATIC_ANALYZER
53+
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
5454

5555
using namespace clang::ast_matchers;
5656
using namespace clang::driver;
@@ -63,7 +63,7 @@ namespace clang {
6363
namespace tidy {
6464

6565
namespace {
66-
#if CLANG_ENABLE_STATIC_ANALYZER
66+
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
6767
static const char *AnalyzerCheckNamePrefix = "clang-analyzer-";
6868

6969
class AnalyzerDiagnosticConsumer : public ento::PathDiagnosticConsumer {
@@ -95,7 +95,7 @@ class AnalyzerDiagnosticConsumer : public ento::PathDiagnosticConsumer {
9595
private:
9696
ClangTidyContext &Context;
9797
};
98-
#endif // CLANG_ENABLE_STATIC_ANALYZER
98+
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
9999

100100
class ErrorReporter {
101101
public:
@@ -324,7 +324,7 @@ ClangTidyASTConsumerFactory::ClangTidyASTConsumerFactory(
324324
}
325325
}
326326

327-
#if CLANG_ENABLE_STATIC_ANALYZER
327+
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
328328
static void setStaticAnalyzerCheckerOpts(const ClangTidyOptions &Opts,
329329
AnalyzerOptionsRef AnalyzerOptions) {
330330
StringRef AnalyzerPrefix(AnalyzerCheckNamePrefix);
@@ -369,7 +369,7 @@ static CheckersList getAnalyzerCheckersAndPackages(ClangTidyContext &Context,
369369
}
370370
return List;
371371
}
372-
#endif // CLANG_ENABLE_STATIC_ANALYZER
372+
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
373373

374374
std::unique_ptr<clang::ASTConsumer>
375375
ClangTidyASTConsumerFactory::CreateASTConsumer(
@@ -424,7 +424,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer(
424424
if (!Checks.empty())
425425
Consumers.push_back(Finder->newASTConsumer());
426426

427-
#if CLANG_ENABLE_STATIC_ANALYZER
427+
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
428428
AnalyzerOptionsRef AnalyzerOptions = Compiler.getAnalyzerOpts();
429429
AnalyzerOptions->CheckersAndPackages = getAnalyzerCheckersAndPackages(
430430
Context, Context.canEnableAnalyzerAlphaCheckers());
@@ -440,7 +440,7 @@ ClangTidyASTConsumerFactory::CreateASTConsumer(
440440
new AnalyzerDiagnosticConsumer(Context));
441441
Consumers.push_back(std::move(AnalysisConsumer));
442442
}
443-
#endif // CLANG_ENABLE_STATIC_ANALYZER
443+
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
444444
return std::make_unique<ClangTidyASTConsumer>(
445445
std::move(Consumers), std::move(Profiling), std::move(Finder),
446446
std::move(Checks));
@@ -453,11 +453,11 @@ std::vector<std::string> ClangTidyASTConsumerFactory::getCheckNames() {
453453
CheckNames.emplace_back(CheckFactory.getKey());
454454
}
455455

456-
#if CLANG_ENABLE_STATIC_ANALYZER
456+
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
457457
for (const auto &AnalyzerCheck : getAnalyzerCheckersAndPackages(
458458
Context, Context.canEnableAnalyzerAlphaCheckers()))
459459
CheckNames.push_back(AnalyzerCheckNamePrefix + AnalyzerCheck.first);
460-
#endif // CLANG_ENABLE_STATIC_ANALYZER
460+
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
461461

462462
llvm::sort(CheckNames);
463463
return CheckNames;

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
1010
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
1111

12-
#include "clang/Config/config.h"
12+
#include "clang-tidy-config.h"
1313
#include "llvm/Support/Compiler.h"
1414

1515
namespace clang {
@@ -20,6 +20,11 @@ extern volatile int AbseilModuleAnchorSource;
2020
static int LLVM_ATTRIBUTE_UNUSED AbseilModuleAnchorDestination =
2121
AbseilModuleAnchorSource;
2222

23+
// This anchor is used to force the linker to link the AlteraModule.
24+
extern volatile int AlteraModuleAnchorSource;
25+
static int LLVM_ATTRIBUTE_UNUSED AlteraModuleAnchorDestination =
26+
AlteraModuleAnchorSource;
27+
2328
// This anchor is used to force the linker to link the AndroidModule.
2429
extern volatile int AndroidModuleAnchorSource;
2530
static int LLVM_ATTRIBUTE_UNUSED AndroidModuleAnchorDestination =
@@ -90,7 +95,7 @@ extern volatile int ModernizeModuleAnchorSource;
9095
static int LLVM_ATTRIBUTE_UNUSED ModernizeModuleAnchorDestination =
9196
ModernizeModuleAnchorSource;
9297

93-
#if CLANG_ENABLE_STATIC_ANALYZER && \
98+
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER && \
9499
!defined(CLANG_TIDY_DISABLE_STATIC_ANALYZER_CHECKS)
95100
// This anchor is used to force the linker to link the MPIModule.
96101
extern volatile int MPIModuleAnchorSource;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ void StringFindStartswithCheck::check(const MatchFinder::MatchResult &Result) {
106106
// Create a preprocessor #include FixIt hint (CreateIncludeInsertion checks
107107
// whether this already exists).
108108
Diagnostic << IncludeInserter.createIncludeInsertion(
109-
Source.getFileID(ComparisonExpr->getBeginLoc()), AbseilStringsMatchHeader,
110-
false);
109+
Source.getFileID(ComparisonExpr->getBeginLoc()),
110+
AbseilStringsMatchHeader);
111111
}
112112

113113
void StringFindStartswithCheck::registerPPCallbacks(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//===--- AlteraTidyModule.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 "StructPackAlignCheck.h"
13+
14+
using namespace clang::ast_matchers;
15+
16+
namespace clang {
17+
namespace tidy {
18+
namespace altera {
19+
20+
class AlteraModule : public ClangTidyModule {
21+
public:
22+
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
23+
CheckFactories.registerCheck<StructPackAlignCheck>(
24+
"altera-struct-pack-align");
25+
}
26+
};
27+
28+
} // namespace altera
29+
30+
// Register the AlteraTidyModule using this statically initialized variable.
31+
static ClangTidyModuleRegistry::Add<altera::AlteraModule>
32+
X("altera-module", "Adds Altera FPGA OpenCL lint checks.");
33+
34+
// This anchor is used to force the linker to link in the generated object file
35+
// and thus register the AlteraModule.
36+
volatile int AlteraModuleAnchorSource = 0;
37+
38+
} // namespace tidy
39+
} // namespace clang
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
set(LLVM_LINK_COMPONENTS
2+
FrontendOpenMP
3+
support
4+
)
5+
6+
add_clang_library(clangTidyAlteraModule
7+
AlteraTidyModule.cpp
8+
StructPackAlignCheck.cpp
9+
10+
LINK_LIBS
11+
clangTidy
12+
clangTidyUtils
13+
)
14+
15+
clang_target_link_libraries(clangTidyAlteraModule
16+
PRIVATE
17+
clangAnalysis
18+
clangAST
19+
clangASTMatchers
20+
clangBasic
21+
clangLex
22+
)

0 commit comments

Comments
 (0)