Skip to content

Commit 7a86532

Browse files
committed
[AutoBump] Merge with 41fecca (Jun 14)
2 parents bba87a0 + 41fecca commit 7a86532

File tree

1,070 files changed

+26686
-14673
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,070 files changed

+26686
-14673
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function compute-projects-to-test() {
7474
fi
7575
;;
7676
clang)
77-
for p in clang-tools-extra compiler-rt lldb cross-project-tests; do
77+
# lldb is temporarily removed to alleviate Linux pre-commit CI waiting times
78+
for p in clang-tools-extra compiler-rt cross-project-tests; do
7879
echo $p
7980
done
8081
;;

.github/workflows/restart-preempted-libcxx-jobs.yaml renamed to .github/workflows/libcxx-restart-preempted-jobs.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
script: |
3535
const failure_regex = /Process completed with exit code 1./
3636
const preemption_regex = /The runner has received a shutdown signal/
37-
37+
3838
const wf_run = context.payload.workflow_run
3939
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
4040
@@ -80,30 +80,30 @@ jobs:
8080
}
8181
check_run_ids.push(check_run.id);
8282
}
83-
83+
8484
has_preempted_job = false;
8585
8686
for (check_run_id of check_run_ids) {
8787
console.log('Listing annotations for check run: ' + check_run_id);
88-
88+
8989
annotations = await github.rest.checks.listAnnotations({
9090
owner: context.repo.owner,
9191
repo: context.repo.repo,
9292
check_run_id: check_run_id
9393
})
94-
94+
9595
for (annotation of annotations.data) {
9696
if (annotation.annotation_level != 'failure') {
9797
continue;
9898
}
99-
99+
100100
const preemption_match = annotation.message.match(preemption_regex);
101-
101+
102102
if (preemption_match != null) {
103103
console.log('Found preemption message: ' + annotation.message);
104104
has_preempted_job = true;
105105
}
106-
106+
107107
const failure_match = annotation.message.match(failure_regex);
108108
if (failure_match != null) {
109109
// We only want to restart the workflow if all of the failures were due to preemption.
@@ -115,20 +115,18 @@ jobs:
115115
return;
116116
}
117117
}
118-
}
119-
118+
}
119+
120120
if (!has_preempted_job) {
121121
core.notice('No preempted jobs found. Not restarting workflow.');
122122
await create_check_run('neutral', 'No preempted jobs found. Not restarting workflow.')
123123
return;
124124
}
125-
125+
126126
core.notice("Restarted workflow: " + context.payload.workflow_run.id);
127127
await github.rest.actions.reRunWorkflowFailedJobs({
128128
owner: context.repo.owner,
129129
repo: context.repo.repo,
130130
run_id: context.payload.workflow_run.id
131131
})
132132
await create_check_run('success', 'Restarted workflow run due to preempted job')
133-
134-

bolt/lib/Rewrite/LinuxKernelRewriter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,8 +1479,9 @@ Error LinuxKernelRewriter::tryReadAltInstructions(uint32_t AltInstFeatureSize,
14791479
}
14801480
}
14811481

1482-
BC.outs() << "BOLT-INFO: parsed " << EntryID
1483-
<< " alternative instruction entries\n";
1482+
if (!ParseOnly)
1483+
BC.outs() << "BOLT-INFO: parsed " << EntryID
1484+
<< " alternative instruction entries\n";
14841485

14851486
return Error::success();
14861487
}

clang-tools-extra/clang-doc/tool/CMakeLists.txt

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,38 @@ target_link_libraries(clang-doc
1818
clangDoc
1919
)
2020

21-
install(FILES ../assets/clang-doc-default-stylesheet.css
22-
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
23-
COMPONENT clang-doc)
2421

25-
install(FILES ../assets/index.js
26-
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
27-
COMPONENT clang-doc)
22+
set(assets
23+
index.js
24+
clang-doc-default-stylesheet.css
25+
)
26+
27+
set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
28+
set(resource_dir "${CMAKE_BINARY_DIR}/share/clang")
29+
set(out_files)
30+
31+
function(copy_files_to_dst src_dir dst_dir file)
32+
set(src "${src_dir}/${file}")
33+
set(dst "${dst_dir}/${file}")
34+
add_custom_command(OUTPUT ${dst}
35+
DEPENDS ${src}
36+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
37+
COMMENT "Copying ${file} to ${dst_dir}"
38+
)
39+
list(APPEND out_files ${dst})
40+
set(out_files ${out_files} PARENT_SCOPE)
41+
endfunction(copy_files_to_dst)
42+
43+
foreach(f ${assets})
44+
install(FILES ${asset_dir}/${f}
45+
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
46+
COMPONENT clang-doc)
47+
copy_files_to_dst(${asset_dir} ${resource_dir} ${f})
48+
endforeach(f)
49+
50+
add_custom_target(copy-clang-doc-assets
51+
DEPENDS ${out_files}
52+
COMMENT "Copying Clang-Doc Assets"
53+
)
54+
set_target_properties(copy-clang-doc-assets PROPERTIES FOLDER "Clang-Doc/Assets")
55+
add_dependencies(clang-doc copy-clang-doc-assets)

clang-tools-extra/clangd/TidyProvider.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ TidyProvider addTidyChecks(llvm::StringRef Checks,
195195
}
196196

197197
TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
198-
constexpr llvm::StringLiteral Seperator(",");
198+
constexpr llvm::StringLiteral Separator(",");
199199
static const std::string BadChecks = llvm::join_items(
200-
Seperator,
201-
// We want this list to start with a seperator to
200+
Separator,
201+
// We want this list to start with a separator to
202202
// simplify appending in the lambda. So including an
203203
// empty string here will force that.
204204
"",
@@ -227,7 +227,7 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
227227
for (const std::string &Str : ExtraBadChecks) {
228228
if (Str.empty())
229229
continue;
230-
Size += Seperator.size();
230+
Size += Separator.size();
231231
if (LLVM_LIKELY(Str.front() != '-'))
232232
++Size;
233233
Size += Str.size();
@@ -238,7 +238,7 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
238238
for (const std::string &Str : ExtraBadChecks) {
239239
if (Str.empty())
240240
continue;
241-
DisableGlob += Seperator;
241+
DisableGlob += Separator;
242242
if (LLVM_LIKELY(Str.front() != '-'))
243243
DisableGlob.push_back('-');
244244
DisableGlob += Str;

clang-tools-extra/include-cleaner/lib/IncludeSpeller.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "clang-include-cleaner/IncludeSpeller.h"
1010
#include "clang-include-cleaner/Types.h"
1111
#include "llvm/ADT/SmallVector.h"
12+
#include "llvm/ADT/StringRef.h"
1213
#include "llvm/Support/ErrorHandling.h"
1314
#include "llvm/Support/Registry.h"
1415
#include <memory>
@@ -30,8 +31,14 @@ class DefaultIncludeSpeller : public IncludeSpeller {
3031
return Input.H.verbatim().str();
3132
case Header::Physical:
3233
bool IsAngled = false;
34+
std::string WorkingDir;
35+
if (auto WD = Input.HS.getFileMgr()
36+
.getVirtualFileSystem()
37+
.getCurrentWorkingDirectory())
38+
WorkingDir = *WD;
3339
std::string FinalSpelling = Input.HS.suggestPathToFileForDiagnostics(
34-
Input.H.physical(), Input.Main->tryGetRealPathName(), &IsAngled);
40+
Input.H.resolvedPath(), WorkingDir, Input.Main->tryGetRealPathName(),
41+
&IsAngled);
3542
return IsAngled ? "<" + FinalSpelling + ">" : "\"" + FinalSpelling + "\"";
3643
}
3744
llvm_unreachable("Unknown clang::include_cleaner::Header::Kind enum");
@@ -60,4 +67,4 @@ std::string spellHeader(const IncludeSpeller::Input &Input) {
6067
return Spelling;
6168
}
6269

63-
} // namespace clang::include_cleaner
70+
} // namespace clang::include_cleaner

clang-tools-extra/include-cleaner/unittests/IncludeSpellerTest.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ TEST(IncludeSpeller, CanOverrideSystemHeaders) {
8989
HS, MainFile}));
9090
}
9191

92+
TEST(IncludeSpeller, RelativeIncludeSearchPath) {
93+
TestInputs Inputs;
94+
95+
Inputs.WorkingDir = "/root/inner";
96+
Inputs.ExtraArgs.push_back("-I..");
97+
Inputs.ExtraFiles["/root/foo.h"] = "";
98+
TestAST AST{Inputs};
99+
100+
auto &FM = AST.fileManager();
101+
auto &HS = AST.preprocessor().getHeaderSearchInfo();
102+
const auto *MainFile = AST.sourceManager().getFileEntryForID(
103+
AST.sourceManager().getMainFileID());
104+
105+
EXPECT_EQ("\"foo.h\"",
106+
spellHeader(
107+
{Header{*FM.getOptionalFileRef("/root/foo.h")}, HS, MainFile}));
108+
}
109+
92110
IncludeSpellingStrategy::Add<DummyIncludeSpeller>
93111
Speller("dummy", "Dummy Include Speller");
94112

clang/bindings/python/clang/cindex.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ def name(self):
649649

650650
@classmethod
651651
def from_id(cls, id):
652-
if id >= len(cls._kinds) or cls._kinds[id] is None:
652+
if id < 0 or id >= len(cls._kinds) or cls._kinds[id] is None:
653653
raise ValueError("Unknown template argument kind %d" % id)
654654
return cls._kinds[id]
655655

@@ -1336,7 +1336,7 @@ def __repr__(self):
13361336
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(271)
13371337

13381338
# OpenMP teams distribute simd directive.
1339-
CursorKind.OMP_TEAMS_DISTRIBUTE_DIRECTIVE = CursorKind(272)
1339+
CursorKind.OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE = CursorKind(272)
13401340

13411341
# OpenMP teams distribute parallel for simd directive.
13421342
CursorKind.OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE = CursorKind(273)
@@ -2215,7 +2215,7 @@ def name(self):
22152215

22162216
@staticmethod
22172217
def from_id(id):
2218-
if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
2218+
if id < 0 or id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
22192219
raise ValueError("Unknown storage class %d" % id)
22202220
return StorageClass._kinds[id]
22212221

@@ -2395,7 +2395,7 @@ def __repr__(self):
23952395
TypeKind.OCLRESERVEID = TypeKind(160)
23962396

23972397
TypeKind.OBJCOBJECT = TypeKind(161)
2398-
TypeKind.OBJCCLASS = TypeKind(162)
2398+
TypeKind.OBJCTYPEPARAM = TypeKind(162)
23992399
TypeKind.ATTRIBUTED = TypeKind(163)
24002400

24012401
TypeKind.OCLINTELSUBGROUPAVCMCEPAYLOAD = TypeKind(164)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import unittest
2+
3+
from clang.cindex import (
4+
CursorKind,
5+
TemplateArgumentKind,
6+
ExceptionSpecificationKind,
7+
AvailabilityKind,
8+
AccessSpecifier,
9+
TypeKind,
10+
RefQualifierKind,
11+
LinkageKind,
12+
TLSKind,
13+
StorageClass,
14+
)
15+
16+
17+
class TestCursorKind(unittest.TestCase):
18+
enums = [
19+
CursorKind,
20+
TemplateArgumentKind,
21+
ExceptionSpecificationKind,
22+
AvailabilityKind,
23+
AccessSpecifier,
24+
TypeKind,
25+
RefQualifierKind,
26+
LinkageKind,
27+
TLSKind,
28+
StorageClass,
29+
]
30+
31+
def test_from_id(self):
32+
"""Check that kinds can be constructed from valid IDs"""
33+
for enum in self.enums:
34+
self.assertEqual(enum.from_id(2), enum._kinds[2])
35+
with self.assertRaises(ValueError):
36+
enum.from_id(len(enum._kinds))
37+
with self.assertRaises(ValueError):
38+
enum.from_id(-1)
39+
40+
def test_unique_kinds(self):
41+
"""Check that no kind name has been used multiple times"""
42+
for enum in self.enums:
43+
for id in range(len(enum._kinds)):
44+
try:
45+
enum.from_id(id).name
46+
except ValueError:
47+
pass

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ if(FUCHSIA_SDK)
300300
set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
301301
endif()
302302

303-
foreach(target armv6m-unknown-eabi)
303+
foreach(target armv6m-unknown-eabi;armv7m-unknown-eabi;armv8m-unknown-eabi)
304304
list(APPEND BUILTIN_TARGETS "${target}")
305305
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
306306
set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
307307
set(BUILTINS_${target}_CMAKE_SYSROOT "" CACHE STRING "")
308308
set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
309309
foreach(lang C;CXX;ASM)
310-
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
310+
set(BUILTINS_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb" CACHE STRING "")
311311
endforeach()
312312
foreach(type SHARED;MODULE;EXE)
313313
set(BUILTINS_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
@@ -321,7 +321,7 @@ foreach(target armv6m-unknown-eabi)
321321
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
322322
set(RUNTIMES_${target}_CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
323323
foreach(lang C;CXX;ASM)
324-
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mcpu=cortex-m0plus -mthumb" CACHE STRING "")
324+
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -mthumb" CACHE STRING "")
325325
endforeach()
326326
foreach(type SHARED;MODULE;EXE)
327327
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")

0 commit comments

Comments
 (0)