Skip to content

Commit 736bedb

Browse files
Merge branch 'main' into progress-bar-premerge-tests
2 parents 675bd57 + 281e6d2 commit 736bedb

File tree

210 files changed

+22587
-1241
lines changed

Some content is hidden

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

210 files changed

+22587
-1241
lines changed

.ci/compute_projects.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
"libc", # No Windows Support.
101101
"lldb", # TODO(issues/132800): Needs environment setup.
102102
"bolt", # No Windows Support.
103+
"libcxx",
104+
"libcxxabi",
105+
"libunwind",
103106
}
104107

105108
# These are projects that we should test if the project itself is changed but
@@ -118,6 +121,9 @@
118121
"lldb",
119122
"openmp",
120123
"polly",
124+
"libcxx",
125+
"libcxxabi",
126+
"libunwind",
121127
}
122128

123129
PROJECT_CHECK_TARGETS = {

.ci/compute_projects_test.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ def test_llvm_windows(self):
4545
env_variables["project_check_targets"],
4646
"check-clang check-clang-tools check-lld check-llvm check-mlir check-polly",
4747
)
48-
self.assertEqual(
49-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
50-
)
48+
self.assertEqual(env_variables["runtimes_to_build"], "")
5149
self.assertEqual(
5250
env_variables["runtimes_check_targets"],
5351
"",
5452
)
5553
self.assertEqual(
5654
env_variables["runtimes_check_targets_needs_reconfig"],
57-
"check-cxx check-cxxabi check-unwind",
55+
"",
5856
)
5957

6058
def test_llvm_mac(self):
@@ -69,16 +67,14 @@ def test_llvm_mac(self):
6967
env_variables["project_check_targets"],
7068
"check-clang check-clang-tools check-lld check-llvm check-mlir",
7169
)
72-
self.assertEqual(
73-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
74-
)
70+
self.assertEqual(env_variables["runtimes_to_build"], "")
7571
self.assertEqual(
7672
env_variables["runtimes_check_targets"],
7773
"",
7874
)
7975
self.assertEqual(
8076
env_variables["runtimes_check_targets_needs_reconfig"],
81-
"check-cxx check-cxxabi check-unwind",
77+
"",
8278
)
8379

8480
def test_clang(self):
@@ -119,16 +115,14 @@ def test_clang_windows(self):
119115
self.assertEqual(
120116
env_variables["project_check_targets"], "check-clang check-clang-tools"
121117
)
122-
self.assertEqual(
123-
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
124-
)
118+
self.assertEqual(env_variables["runtimes_to_build"], "")
125119
self.assertEqual(
126120
env_variables["runtimes_check_targets"],
127121
"",
128122
)
129123
self.assertEqual(
130124
env_variables["runtimes_check_targets_needs_reconfig"],
131-
"check-cxx check-cxxabi check-unwind",
125+
"",
132126
)
133127
self.assertEqual(env_variables["enable_cir"], "OFF")
134128

@@ -298,18 +292,15 @@ def test_windows_ci(self):
298292
)
299293
self.assertEqual(
300294
env_variables["runtimes_to_build"],
301-
"libcxx;libcxxabi;libunwind",
295+
"",
302296
)
303297
self.assertEqual(
304298
env_variables["runtimes_check_targets"],
305299
"",
306300
)
307-
# TODO(boomanaiden154): We should not be emitting these on Windows.
308-
# It does not currently impact anything because we do not build the
309-
# runtimes on Windows though.
310301
self.assertEqual(
311302
env_variables["runtimes_check_targets_needs_reconfig"],
312-
"check-cxx check-cxxabi check-unwind",
303+
"",
313304
)
314305

315306
def test_lldb(self):

clang-tools-extra/test/clang-tidy/infrastructure/diagnostic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// use it after failing to parse commands from the command line:
1616
//
1717
// RUN: mkdir -p %t.dir/diagnostics/
18-
// RUN: echo '[{"directory": "%/t.dir/diagnostics/","command": "clang++ -fan-option-from-compilation-database -c %/T/diagnostics/input.cpp", "file": "%/T/diagnostics/input.cpp"}]' > %t.dir/diagnostics/compile_commands.json
18+
// RUN: echo '[{"directory": "%/t.dir/diagnostics/","command": "clang++ -fan-option-from-compilation-database -c %/t.dir/diagnostics/input.cpp", "file": "%/t.dir/diagnostics/input.cpp"}]' > %t.dir/diagnostics/compile_commands.json
1919
// RUN: cat %s > %t.dir/diagnostics/input.cpp
2020
// RUN: not clang-tidy -checks='-*,modernize-use-override' %t.dir/diagnostics/nonexistent.cpp -- 2>&1 | FileCheck -check-prefix=CHECK1 -implicit-check-not='{{warning:|error:}}' %s
2121
// RUN: not clang-tidy -checks='-*,clang-diagnostic-*,google-explicit-constructor' %t.dir/diagnostics/input.cpp -- -fan-unknown-option 2>&1 | FileCheck -check-prefix=CHECK2 -implicit-check-not='{{warning:|error:}}' %s

clang-tools-extra/test/clang-tidy/infrastructure/export-relpath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: rm -rf %t.dir/clang-tidy/export-relpath
33
// RUN: mkdir -p %t.dir/clang-tidy/export-relpath/subdir
44
// RUN: cp %s %t.dir/clang-tidy/export-relpath/subdir/source.cpp
5-
// RUN: echo '[{ "directory": "%/t.dir/clang-tidy/export-relpath/subdir", "command": "clang++ source.cpp", "file": "%/T/clang-tidy/export-relpath/subdir/source.cpp"}]' > %t.dir/clang-tidy/export-relpath/subdir/compile_commands.json
5+
// RUN: echo '[{ "directory": "%/t.dir/clang-tidy/export-relpath/subdir", "command": "clang++ source.cpp", "file": "%/t.dir/clang-tidy/export-relpath/subdir/source.cpp"}]' > %t.dir/clang-tidy/export-relpath/subdir/compile_commands.json
66
//
77
// Check that running clang-tidy in './subdir' and storing results
88
// in './fixes.yaml' works as expected.

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ Bug Fixes to C++ Support
182182
- Fix a crash when deleting a pointer to an incomplete array (#GH150359).
183183
- Fix an assertion failure when expression in assumption attribute
184184
(``[[assume(expr)]]``) creates temporary objects.
185+
- Fix the dynamic_cast to final class optimization to correctly handle
186+
casts that are guaranteed to fail (#GH137518).
185187

186188
Bug Fixes to AST Handling
187189
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/OpenACCClause.h

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -876,21 +876,32 @@ class OpenACCPrivateClause final
876876
}
877877
};
878878

879+
// A 'pair' to stand in for the recipe. RecipeDecl is the main declaration, and
880+
// InitFromTemporary is the 'temp' declaration we put in to be 'copied from'.
881+
struct OpenACCFirstPrivateRecipe {
882+
VarDecl *RecipeDecl, *InitFromTemporary;
883+
OpenACCFirstPrivateRecipe(VarDecl *R, VarDecl *T)
884+
: RecipeDecl(R), InitFromTemporary(T) {}
885+
OpenACCFirstPrivateRecipe(std::pair<VarDecl *, VarDecl *> p)
886+
: RecipeDecl(p.first), InitFromTemporary(p.second) {}
887+
};
888+
879889
class OpenACCFirstPrivateClause final
880890
: public OpenACCClauseWithVarList,
881891
private llvm::TrailingObjects<OpenACCFirstPrivateClause, Expr *,
882-
VarDecl *> {
892+
OpenACCFirstPrivateRecipe> {
883893
friend TrailingObjects;
884894

885895
OpenACCFirstPrivateClause(SourceLocation BeginLoc, SourceLocation LParenLoc,
886896
ArrayRef<Expr *> VarList,
887-
ArrayRef<VarDecl *> InitRecipes,
897+
ArrayRef<OpenACCFirstPrivateRecipe> InitRecipes,
888898
SourceLocation EndLoc)
889899
: OpenACCClauseWithVarList(OpenACCClauseKind::FirstPrivate, BeginLoc,
890900
LParenLoc, EndLoc) {
891901
assert(VarList.size() == InitRecipes.size());
892902
setExprs(getTrailingObjects<Expr *>(VarList.size()), VarList);
893-
llvm::uninitialized_copy(InitRecipes, getTrailingObjects<VarDecl *>());
903+
llvm::uninitialized_copy(InitRecipes,
904+
getTrailingObjects<OpenACCFirstPrivateRecipe>());
894905
}
895906

896907
public:
@@ -900,19 +911,20 @@ class OpenACCFirstPrivateClause final
900911

901912
// Gets a list of 'made up' `VarDecl` objects that can be used by codegen to
902913
// ensure that we properly initialize each of these variables.
903-
ArrayRef<VarDecl *> getInitRecipes() {
904-
return ArrayRef<VarDecl *>{getTrailingObjects<VarDecl *>(),
905-
getExprs().size()};
914+
ArrayRef<OpenACCFirstPrivateRecipe> getInitRecipes() {
915+
return ArrayRef<OpenACCFirstPrivateRecipe>{
916+
getTrailingObjects<OpenACCFirstPrivateRecipe>(), getExprs().size()};
906917
}
907918

908-
ArrayRef<VarDecl *> getInitRecipes() const {
909-
return ArrayRef<VarDecl *>{getTrailingObjects<VarDecl *>(),
910-
getExprs().size()};
919+
ArrayRef<OpenACCFirstPrivateRecipe> getInitRecipes() const {
920+
return ArrayRef<OpenACCFirstPrivateRecipe>{
921+
getTrailingObjects<OpenACCFirstPrivateRecipe>(), getExprs().size()};
911922
}
912923

913924
static OpenACCFirstPrivateClause *
914925
Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
915-
ArrayRef<Expr *> VarList, ArrayRef<VarDecl *> InitRecipes,
926+
ArrayRef<Expr *> VarList,
927+
ArrayRef<OpenACCFirstPrivateRecipe> InitRecipes,
916928
SourceLocation EndLoc);
917929

918930
size_t numTrailingObjects(OverloadToken<Expr *>) const {

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13531,6 +13531,11 @@ def err_acc_invalid_default_type
1353113531
def err_acc_device_type_multiple_archs
1353213532
: Error<"OpenACC 'device_type' clause on a 'set' construct only permits "
1353313533
"one architecture">;
13534+
def warn_acc_var_referenced_non_const_array
13535+
: Warning<"variable of array type %0 referenced in OpenACC '%1' clause "
13536+
"does not have constant bounds; initialization will happen after "
13537+
"decay to pointer">,
13538+
InGroup<DiagGroup<"openacc-var-non-const-array">>;
1353413539
def warn_acc_var_referenced_lacks_op
1353513540
: Warning<"variable of type %0 referenced in OpenACC '%1' clause does not "
1353613541
"have a %enum_select<AccVarReferencedReason>{%DefCtor{default "

clang/include/clang/Sema/SemaOpenACC.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,11 @@ class SemaOpenACC : public SemaBase {
240240
// Creates a VarDecl with a proper default init for the purposes of a
241241
// `private`/'firstprivate'/'reduction' clause, so it can be used to generate
242242
// a recipe later.
243-
VarDecl *CreateInitRecipe(OpenACCClauseKind CK, const Expr *VarExpr);
243+
// The first entry is the recipe itself, the second is any required
244+
// 'temporary' created for the init (in the case of a copy), such as with
245+
// firstprivate.
246+
std::pair<VarDecl *, VarDecl *> CreateInitRecipe(OpenACCClauseKind CK,
247+
const Expr *VarExpr);
244248

245249
public:
246250
ComputeConstructInfo &getActiveComputeConstructInfo() {

clang/lib/AST/OpenACCClause.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,11 @@ OpenACCPrivateClause::Create(const ASTContext &C, SourceLocation BeginLoc,
329329

330330
OpenACCFirstPrivateClause *OpenACCFirstPrivateClause::Create(
331331
const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
332-
ArrayRef<Expr *> VarList, ArrayRef<VarDecl *> InitRecipes,
332+
ArrayRef<Expr *> VarList, ArrayRef<OpenACCFirstPrivateRecipe> InitRecipes,
333333
SourceLocation EndLoc) {
334-
void *Mem =
335-
C.Allocate(OpenACCFirstPrivateClause::totalSizeToAlloc<Expr *, VarDecl *>(
334+
void *Mem = C.Allocate(
335+
OpenACCFirstPrivateClause::totalSizeToAlloc<Expr *,
336+
OpenACCFirstPrivateRecipe>(
336337
VarList.size(), InitRecipes.size()));
337338
return new (Mem) OpenACCFirstPrivateClause(BeginLoc, LParenLoc, VarList,
338339
InitRecipes, EndLoc);

clang/lib/AST/StmtProfile.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,8 +2645,10 @@ void OpenACCClauseProfiler::VisitFirstPrivateClause(
26452645
const OpenACCFirstPrivateClause &Clause) {
26462646
VisitClauseWithVarList(Clause);
26472647

2648-
for (auto *VD : Clause.getInitRecipes())
2649-
Profiler.VisitDecl(VD);
2648+
for (auto &Recipe : Clause.getInitRecipes()) {
2649+
Profiler.VisitDecl(Recipe.RecipeDecl);
2650+
Profiler.VisitDecl(Recipe.InitFromTemporary);
2651+
}
26502652
}
26512653

26522654
void OpenACCClauseProfiler::VisitAttachClause(

0 commit comments

Comments
 (0)