Skip to content

Commit a3345e4

Browse files
committed
merge main into amd-staging
Change-Id: I70de45fb43870d72c8a58a3d7742e6e9414390eb
2 parents 2448b78 + 4c43648 commit a3345e4

File tree

74 files changed

+3174
-861
lines changed

Some content is hidden

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

74 files changed

+3174
-861
lines changed

.github/workflows/commit-access-review.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,47 @@ def check_manual_requests(
6767
) -> list[str]:
6868
"""
6969
Return a list of users who have been asked since ``start_date`` if they
70-
want to keep their commit access.
70+
want to keep their commit access or if they have applied for commit
71+
access since ``start_date``
7172
"""
73+
7274
query = """
73-
query ($query: String!) {
74-
search(query: $query, type: ISSUE, first: 100) {
75+
query ($query: String!, $after: String) {
76+
search(query: $query, type: ISSUE, first: 100, after: $after) {
7577
nodes {
7678
... on Issue {
77-
body
78-
comments (first: 100) {
79-
nodes {
80-
author {
81-
login
82-
}
83-
}
79+
author {
80+
login
8481
}
82+
body
8583
}
8684
}
85+
pageInfo {
86+
hasNextPage
87+
endCursor
88+
}
8789
}
8890
}
8991
"""
9092
formatted_start_date = start_date.strftime("%Y-%m-%dT%H:%M:%S")
9193
variables = {
92-
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access"
94+
"query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access,infra:commit-access-request"
9395
}
9496

95-
res_header, res_data = gh._Github__requester.graphql_query(
96-
query=query, variables=variables
97-
)
98-
data = res_data["data"]
97+
has_next_page = True
9998
users = []
100-
for issue in data["search"]["nodes"]:
101-
users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])])
102-
99+
while has_next_page:
100+
res_header, res_data = gh._Github__requester.graphql_query(
101+
query=query, variables=variables
102+
)
103+
data = res_data["data"]
104+
for issue in data["search"]["nodes"]:
105+
users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])])
106+
if issue["author"]:
107+
users.append(issue["author"]["login"])
108+
has_next_page = data["search"]["pageInfo"]["hasNextPage"]
109+
if has_next_page:
110+
variables["after"] = data["search"]["pageInfo"]["endCursor"]
103111
return users
104112

105113

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Install clang-format
6161
uses: aminya/setup-cpp@v1
6262
with:
63-
clangformat: 18.1.7
63+
clangformat: 19.1.6
6464

6565
- name: Setup Python env
6666
uses: actions/setup-python@v5

clang/lib/Sema/SemaOpenACC.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -498,12 +498,9 @@ bool checkAlreadyHasClauseOfKind(
498498
bool checkValidAfterDeviceType(
499499
SemaOpenACC &S, const OpenACCDeviceTypeClause &DeviceTypeClause,
500500
const SemaOpenACC::OpenACCParsedClause &NewClause) {
501-
// This is only a requirement on compute, combined, data and loop constructs
502-
// so far, so this is fine otherwise.
503-
if (!isOpenACCComputeDirectiveKind(NewClause.getDirectiveKind()) &&
504-
!isOpenACCCombinedDirectiveKind(NewClause.getDirectiveKind()) &&
505-
NewClause.getDirectiveKind() != OpenACCDirectiveKind::Loop &&
506-
NewClause.getDirectiveKind() != OpenACCDirectiveKind::Data)
501+
// This is implemented for everything but 'routine', so treat as 'fine' for
502+
// that.
503+
if (NewClause.getDirectiveKind() == OpenACCDirectiveKind::Routine)
507504
return false;
508505

509506
// OpenACC3.3: Section 2.4: Clauses that precede any device_type clause are
@@ -578,6 +575,21 @@ bool checkValidAfterDeviceType(
578575
default:
579576
break;
580577
}
578+
} else if (NewClause.getDirectiveKind() == OpenACCDirectiveKind::Set ||
579+
NewClause.getDirectiveKind() == OpenACCDirectiveKind::Init ||
580+
NewClause.getDirectiveKind() == OpenACCDirectiveKind::Shutdown) {
581+
// There are no restrictions on 'set', 'init', or 'shutdown'.
582+
return false;
583+
} else if (NewClause.getDirectiveKind() == OpenACCDirectiveKind::Update) {
584+
// OpenACC3.3 section 2.14.4: Only the async and wait clauses may follow a
585+
// device_type clause.
586+
switch (NewClause.getClauseKind()) {
587+
case OpenACCClauseKind::Async:
588+
case OpenACCClauseKind::Wait:
589+
return false;
590+
default:
591+
break;
592+
}
581593
}
582594
S.Diag(NewClause.getBeginLoc(), diag::err_acc_clause_after_device_type)
583595
<< NewClause.getClauseKind() << DeviceTypeClause.getClauseKind()
@@ -1178,11 +1190,8 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitWaitClause(
11781190

11791191
OpenACCClause *SemaOpenACCClauseVisitor::VisitDeviceTypeClause(
11801192
SemaOpenACC::OpenACCParsedClause &Clause) {
1181-
// Restrictions only properly implemented on 'compute', 'combined', 'data' and
1182-
// 'loop' constructs, and 'compute'/'combined'/'data'/'loop' constructs are
1183-
// the only construct that can do anything with this yet, so skip/treat as
1184-
// unimplemented in this case.
1185-
if (!isDirectiveKindImplemented(Clause.getDirectiveKind()))
1193+
// Restrictions implemented properly on everything except 'routine'.
1194+
if (Clause.getDirectiveKind() == OpenACCDirectiveKind::Routine)
11861195
return isNotImplemented();
11871196

11881197
// OpenACC 3.3 2.14.3: Two instances of the same clause may not appear on the

clang/test/AST/ast-print-openacc-update-construct.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@ void uses(bool cond) {
2929

3030
// CHECK: #pragma acc update wait(devnum: I : queues: *iPtr, I) if(I == array[I]) async(I)
3131
#pragma acc update wait(devnum:I:queues:*iPtr, I) if(I == array[I]) async(I)
32+
33+
// CHECK: #pragma acc update device_type(I) dtype(H)
34+
#pragma acc update device_type(I) dtype(H)
35+
36+
// CHECK: #pragma acc update device_type(J) dtype(K)
37+
#pragma acc update device_type(J) dtype(K)
3238
}

clang/test/SemaOpenACC/update-construct-ast.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ void NormalFunc() {
2727
// CHECK-NEXT: ImplicitCastExpr
2828
// CHECK-NEXT: DeclRefExpr{{.*}}'some_long' 'long ()'
2929

30-
#pragma acc update wait async
30+
#pragma acc update wait async device_type(A) dtype(B)
3131
// CHECK-NEXT: OpenACCUpdateConstruct{{.*}}update
3232
// CHECK-NEXT: wait clause
3333
// CHECK-NEXT: <<<NULL>>>
3434
// CHECK-NEXT: async clause
35+
// CHECK-NEXT: device_type(A)
36+
// CHECK-NEXT: dtype(B)
3537
#pragma acc update wait(some_int(), some_long()) async(some_int())
3638
// CHECK-NEXT: OpenACCUpdateConstruct{{.*}}update
3739
// CHECK-NEXT: wait clause
@@ -87,11 +89,13 @@ void TemplFunc(T t) {
8789
// CHECK-NEXT: NestedNameSpecifier TypeSpec 'T'
8890
// CHECK-NEXT: DeclRefExpr{{.*}}'t' 'T'
8991

90-
#pragma acc update wait async
92+
#pragma acc update wait async device_type(T) dtype(U)
9193
// CHECK-NEXT: OpenACCUpdateConstruct{{.*}}update
9294
// CHECK-NEXT: wait clause
9395
// CHECK-NEXT: <<<NULL>>>
9496
// CHECK-NEXT: async clause
97+
// CHECK-NEXT: device_type(T)
98+
// CHECK-NEXT: dtype(U)
9599
#pragma acc update wait(T::value, t) async(T::value)
96100
// CHECK-NEXT: OpenACCUpdateConstruct{{.*}}update
97101
// CHECK-NEXT: wait clause
@@ -144,6 +148,8 @@ void TemplFunc(T t) {
144148
// CHECK-NEXT: wait clause
145149
// CHECK-NEXT: <<<NULL>>>
146150
// CHECK-NEXT: async clause
151+
// CHECK-NEXT: device_type(T)
152+
// CHECK-NEXT: dtype(U)
147153

148154
// CHECK-NEXT: OpenACCUpdateConstruct{{.*}}update
149155
// CHECK-NEXT: wait clause

clang/test/SemaOpenACC/update-construct.cpp

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ void uses() {
88
#pragma acc update async self(Var)
99
// expected-warning@+1{{OpenACC clause 'self' not yet implemented}}
1010
#pragma acc update wait self(Var)
11-
// expected-warning@+2{{OpenACC clause 'self' not yet implemented}}
12-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
11+
// expected-warning@+1{{OpenACC clause 'self' not yet implemented}}
1312
#pragma acc update self(Var) device_type(I)
1413
// expected-warning@+1{{OpenACC clause 'self' not yet implemented}}
1514
#pragma acc update if(true) self(Var)
@@ -22,46 +21,41 @@ void uses() {
2221
// expected-warning@+1{{OpenACC clause 'device' not yet implemented}}
2322
#pragma acc update device(Var)
2423

25-
// TODO: OpenACC: These all should diagnose as they aren't allowed after
26-
// device_type.
27-
// expected-warning@+3{{OpenACC clause 'self' not yet implemented}}
28-
// expected-warning@+2{{OpenACC clause 'device_type' not yet implemented}}
29-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
30-
#pragma acc update self(Var) device_type(I) device_type(I)
31-
// expected-warning@+2{{OpenACC clause 'self' not yet implemented}}
32-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
24+
// expected-warning@+3{{OpenACC clause 'self' not yet implemented}}
25+
// expected-error@+2{{OpenACC clause 'if' may not follow a 'device_type' clause in a 'update' construct}}
26+
// expected-note@+1{{previous clause is here}}
3327
#pragma acc update self(Var) device_type(I) if(true)
34-
// expected-warning@+2{{OpenACC clause 'self' not yet implemented}}
35-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
28+
// expected-warning@+3{{OpenACC clause 'self' not yet implemented}}
29+
// expected-error@+2{{OpenACC clause 'if_present' may not follow a 'device_type' clause in a 'update' construct}}
30+
// expected-note@+1{{previous clause is here}}
3631
#pragma acc update self(Var) device_type(I) if_present
37-
// expected-warning@+2{{OpenACC clause 'device_type' not yet implemented}}
38-
// expected-warning@+1{{OpenACC clause 'self' not yet implemented}}
32+
// expected-error@+2{{OpenACC clause 'self' may not follow a 'device_type' clause in a 'update' construct}}
33+
// expected-note@+1{{previous clause is here}}
3934
#pragma acc update device_type(I) self(Var)
40-
// expected-warning@+2{{OpenACC clause 'device_type' not yet implemented}}
41-
// expected-warning@+1{{OpenACC clause 'host' not yet implemented}}
35+
// expected-error@+2{{OpenACC clause 'host' may not follow a 'device_type' clause in a 'update' construct}}
36+
// expected-note@+1{{previous clause is here}}
4237
#pragma acc update device_type(I) host(Var)
43-
// expected-warning@+2{{OpenACC clause 'device_type' not yet implemented}}
44-
// expected-warning@+1{{OpenACC clause 'device' not yet implemented}}
38+
// expected-error@+2{{OpenACC clause 'device' may not follow a 'device_type' clause in a 'update' construct}}
39+
// expected-note@+1{{previous clause is here}}
4540
#pragma acc update device_type(I) device(Var)
4641
// These 2 are OK.
47-
// expected-warning@+2{{OpenACC clause 'self' not yet implemented}}
48-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
42+
// expected-warning@+1{{OpenACC clause 'self' not yet implemented}}
4943
#pragma acc update self(Var) device_type(I) async
50-
// expected-warning@+2{{OpenACC clause 'self' not yet implemented}}
51-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
44+
// expected-warning@+1{{OpenACC clause 'self' not yet implemented}}
5245
#pragma acc update self(Var) device_type(I) wait
46+
// Unless otherwise specified, we assume 'device_type' can happen after itself.
47+
// expected-warning@+1{{OpenACC clause 'self' not yet implemented}}
48+
#pragma acc update self(Var) device_type(I) device_type(I)
5349

5450
// TODO: OpenACC: These should diagnose because there isn't at least 1 of
5551
// 'self', 'host', or 'device'.
5652
#pragma acc update async
5753
#pragma acc update wait
58-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
5954
#pragma acc update device_type(I)
6055
#pragma acc update if(true)
6156
#pragma acc update if_present
6257

63-
// expected-error@+2{{value of type 'struct NotConvertible' is not contextually convertible to 'bool'}}
64-
// expected-warning@+1{{OpenACC clause 'device_type' not yet implemented}}
58+
// expected-error@+1{{value of type 'struct NotConvertible' is not contextually convertible to 'bool'}}
6559
#pragma acc update if (NC) device_type(I)
6660

6761
// expected-error@+2{{OpenACC 'if' clause cannot appear more than once on a 'update' directive}}

compiler-rt/cmake/base-config-ix.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ else()
8989
set(COMPILER_RT_TEST_COMPILER_ID GNU)
9090
endif()
9191

92+
# AppleClang expects 'Clang' as compiler-rt test compiler ID.
93+
if ("${COMPILER_RT_TEST_COMPILER_ID}" STREQUAL "AppleClang")
94+
set(COMPILER_RT_TEST_COMPILER_ID Clang)
95+
endif()
96+
9297
if(NOT DEFINED COMPILER_RT_OS_DIR)
9398
if(ANDROID)
9499
# The CMAKE_SYSTEM_NAME for Android is Android, but the OS is Linux and the

libc/config/baremetal/config.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,5 @@
3030
"LIBC_CONF_MATH_OPTIMIZATIONS": {
3131
"value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)"
3232
}
33-
},
34-
"codegen": {
35-
"LIBC_CONF_KEEP_FRAME_POINTER": {
36-
"value": false
37-
}
3833
}
3934
}

libc/include/__llvm-libc-common.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@
5050
#define __END_C_DECLS
5151

5252
#undef __restrict
53-
#define __restrict restrict // C99 and above support the restrict keyword.
53+
#if __STDC_VERSION__ >= 199901L
54+
// C99 and above support the restrict keyword.
55+
#define __restrict restrict
56+
#elif !defined(__GNUC__)
57+
// GNU-compatible compilers accept the __ spelling in all modes.
58+
// Otherwise, omit the qualifier for pure C89 compatibility.
59+
#define __restrict
60+
#endif
5461

5562
#undef _Noreturn
5663
#if __STDC_VERSION__ >= 201112L

libcxx/docs/Hardening.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ ABI configuration.
311311
ABI options
312312
-----------
313313

314-
Vendors can use the following ABI options to enable additional hardening checks:
314+
Vendors can use some ABI options at CMake configuration time (when building libc++
315+
itself) to enable additional hardening checks. This is done by passing these
316+
macros as ``-DLIBCXX_ABI_DEFINES="_LIBCPP_ABI_FOO;_LIBCPP_ABI_BAR;etc"`` at
317+
CMake configuration time. The available options are:
315318

316319
- ``_LIBCPP_ABI_BOUNDED_ITERATORS`` -- changes the iterator type of select
317320
containers (see below) to a bounded iterator that keeps track of whether it's
@@ -341,7 +344,7 @@ Vendors can use the following ABI options to enable additional hardening checks:
341344

342345
ABI impact: changes the iterator type of ``vector`` (except ``vector<bool>``).
343346

344-
- ``_LIBCPP_ABI_BOUNDED_UNIQUE_PTR``` -- tracks the bounds of the array stored inside
347+
- ``_LIBCPP_ABI_BOUNDED_UNIQUE_PTR`` -- tracks the bounds of the array stored inside
345348
a ``std::unique_ptr<T[]>``, allowing it to trap when accessed out-of-bounds. This
346349
requires the ``std::unique_ptr`` to be created using an API like ``std::make_unique``
347350
or ``std::make_unique_for_overwrite``, otherwise the bounds information is not available

libcxx/include/__vector/vector_bool.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
279279
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __n) const {
280280
return __make_ref(__n);
281281
}
282-
_LIBCPP_HIDE_FROM_ABI reference at(size_type __n);
283-
_LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const;
282+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference at(size_type __n);
283+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference at(size_type __n) const;
284284

285285
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() { return __make_ref(0); }
286286
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const { return __make_ref(0); }
@@ -853,14 +853,15 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void vector<bool, _Allocator>::shrink_to_fit() _NO
853853
}
854854

855855
template <class _Allocator>
856-
typename vector<bool, _Allocator>::reference vector<bool, _Allocator>::at(size_type __n) {
856+
_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<bool, _Allocator>::reference vector<bool, _Allocator>::at(size_type __n) {
857857
if (__n >= size())
858858
this->__throw_out_of_range();
859859
return (*this)[__n];
860860
}
861861

862862
template <class _Allocator>
863-
typename vector<bool, _Allocator>::const_reference vector<bool, _Allocator>::at(size_type __n) const {
863+
_LIBCPP_CONSTEXPR_SINCE_CXX20 typename vector<bool, _Allocator>::const_reference
864+
vector<bool, _Allocator>::at(size_type __n) const {
864865
if (__n >= size())
865866
this->__throw_out_of_range();
866867
return (*this)[__n];

libcxx/src/filesystem/operations.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,16 @@
3939
#include <fcntl.h> /* values for fchmodat */
4040
#include <time.h>
4141

42-
// since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc and musl
43-
#if (defined(__linux__) && (defined(__GLIBC__) || _LIBCPP_HAS_MUSL_LIBC)) || defined(__FreeBSD__)
42+
// since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc >= 2.27 and musl
43+
#if defined(__linux__)
44+
# if defined(_LIBCPP_GLIBC_PREREQ)
45+
# if _LIBCPP_GLIBC_PREREQ(2, 27)
46+
# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
47+
# endif
48+
# elif _LIBCPP_HAS_MUSL_LIBC
49+
# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
50+
# endif
51+
#elif defined(__FreeBSD__)
4452
# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
4553
#endif
4654
#if __has_include(<sys/sendfile.h>)

0 commit comments

Comments
 (0)