Skip to content

Commit 744687f

Browse files
authored
Merge branch 'main' into cir_upstream_sizeof_alignof
2 parents 2997d72 + 64f67f8 commit 744687f

File tree

64 files changed

+1319
-330
lines changed

Some content is hidden

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

64 files changed

+1319
-330
lines changed

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,19 +1502,19 @@ static bool compileModuleAndReadASTBehindLock(
15021502

15031503
// Someone else is responsible for building the module. Wait for them to
15041504
// finish.
1505-
switch (Lock.waitForUnlock()) {
1506-
case llvm::LockFileManager::Res_Success:
1505+
switch (Lock.waitForUnlockFor(std::chrono::seconds(90))) {
1506+
case llvm::WaitForUnlockResult::Success:
15071507
break; // The interesting case.
1508-
case llvm::LockFileManager::Res_OwnerDied:
1508+
case llvm::WaitForUnlockResult::OwnerDied:
15091509
continue; // try again to get the lock.
1510-
case llvm::LockFileManager::Res_Timeout:
1510+
case llvm::WaitForUnlockResult::Timeout:
15111511
// Since ModuleCache takes care of correctness, we try waiting for
15121512
// another process to complete the build so clang does not do it done
15131513
// twice. If case of timeout, build it ourselves.
15141514
Diags.Report(ModuleNameLoc, diag::remark_module_lock_timeout)
15151515
<< Module->Name;
15161516
// Clear the lock file so that future invocations can make progress.
1517-
Lock.unsafeRemoveLockFile();
1517+
Lock.unsafeMaybeUnlock();
15181518
continue;
15191519
}
15201520

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10938,8 +10938,7 @@ void Sema::CheckConstructor(CXXConstructorDecl *Constructor) {
1093810938
// parameters have default arguments.
1093910939
if (!Constructor->isInvalidDecl() &&
1094010940
Constructor->hasOneParamOrDefaultArgs() &&
10941-
!Constructor->isFunctionTemplateSpecialization()
10942-
) {
10941+
!Constructor->isFunctionTemplateSpecialization()) {
1094310942
QualType ParamType = Constructor->getParamDecl(0)->getType();
1094410943
QualType ClassTy = Context.getTagDeclType(ClassDecl);
1094510944
if (Context.getCanonicalType(ParamType).getUnqualifiedType() == ClassTy) {

clang/test/C/C2y/n3482.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -ffreestanding %s
2+
3+
/* WG14 N3482: Yes
4+
* Slay Some Earthly Demons XVII
5+
*
6+
* This paper makes it a constraint violation to call va_start in a non-
7+
* variadic function. This is something Clang has always diagnosed.
8+
*/
9+
10+
#include <stdarg.h>
11+
12+
void func(int a) {
13+
va_list list;
14+
va_start(list, a); // expected-error {{'va_start' used in function with fixed args}}
15+
}

clang/test/Driver/print-supported-extensions-riscv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
// CHECK-NEXT: xqcics 0.2 'Xqcics' (Qualcomm uC Conditional Select Extension)
203203
// CHECK-NEXT: xqcicsr 0.2 'Xqcicsr' (Qualcomm uC CSR Extension)
204204
// CHECK-NEXT: xqciint 0.4 'Xqciint' (Qualcomm uC Interrupts Extension)
205+
// CHECK-NEXT: xqcili 0.2 'Xqcili' (Qualcomm uC Load Large Immediate Extension)
205206
// CHECK-NEXT: xqcilia 0.2 'Xqcilia' (Qualcomm uC Large Immediate Arithmetic Extension)
206207
// CHECK-NEXT: xqcilo 0.2 'Xqcilo' (Qualcomm uC Large Offset Load Store Extension)
207208
// CHECK-NEXT: xqcilsm 0.2 'Xqcilsm' (Qualcomm uC Load Store Multiple Extension)

clang/www/c_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ <h2 id="c2y">C2y implementation status</h2>
308308
<tr>
309309
<td>Slay Some Earthly Demons XVII</td>
310310
<td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3482.pdf">N3482</a></td>
311-
<td class="unknown" align="center">Unknown</td>
311+
<td class="full" align="center">Yes</td>
312312
</tr>
313313
<tr>
314314
<td>Clarify the specification of the width macros</td>

flang/include/flang/Lower/BoxAnalyzer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@ class BoxAnalyzer : public fir::details::matcher<BoxAnalyzer> {
403403
continue;
404404
}
405405
} else if (subs.ubound().isStar()) {
406-
assert(Fortran::semantics::IsNamedConstant(sym) &&
407-
"expect implied shape constant");
406+
assert(Fortran::semantics::IsNamedConstant(sym) ||
407+
Fortran::semantics::IsCUDAShared(sym) &&
408+
"expect implied shape constant");
408409
shapes.push_back(fir::SequenceType::getUnknownExtent());
409410
continue;
410411
}

flang/include/flang/Semantics/tools.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ inline bool HasCUDAAttr(const Symbol &sym) {
222222
return false;
223223
}
224224

225+
inline bool IsCUDAShared(const Symbol &sym) {
226+
if (const auto *details{sym.GetUltimate().detailsIf<ObjectEntityDetails>()}) {
227+
if (details->cudaDataAttr() &&
228+
*details->cudaDataAttr() == common::CUDADataAttr::Shared) {
229+
return true;
230+
}
231+
}
232+
return false;
233+
}
234+
225235
inline bool NeedCUDAAlloc(const Symbol &sym) {
226236
if (IsDummy(sym)) {
227237
return false;

flang/lib/Lower/OpenMP/Clauses.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ std::optional<Object> getBaseObject(const Object &object,
165165
// e.g. A(i) is represented as {Symbol(A), Designator(ArrayRef(A, i))}.
166166
// Here we have the Symbol(A), which is what we started with.
167167
assert(&**symRef == object.sym());
168+
[[maybe_unused]] auto *unused = symRef;
168169
return std::nullopt;
169170
}
170171
} else {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s
3+
4+
attributes(global) subroutine sharedstar()
5+
real, shared :: s(*) ! ok. dynamic shared memory.
6+
end subroutine
7+
8+
! CHECK-LABEL: func.func @_QPsharedstar()
9+
! CHECK: hlfir.declare %{{.*}}(%{{.*}}) {data_attr = #cuf.cuda<shared>, uniq_name = "_QFsharedstarEs"} : (!fir.ref<!fir.array<?xf32>>, !fir.shape<1>) -> (!fir.box<!fir.array<?xf32>>, !fir.ref<!fir.array<?xf32>>)

libc/src/stdio/baremetal/printf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ LLVM_LIBC_FUNCTION(int, printf, (const char *__restrict format, ...)) {
3838
constexpr size_t BUFF_SIZE = 1024;
3939
char buffer[BUFF_SIZE];
4040

41-
printf_core::WriteBuffer wb(buffer, BUFF_SIZE, &raw_write_hook, nullptr);
41+
printf_core::WriteBuffer<Mode<WriteMode::FLUSH_TO_STREAM>::value> wb(
42+
buffer, BUFF_SIZE, &raw_write_hook, nullptr);
4243
printf_core::Writer writer(&wb);
4344

4445
int retval = printf_core::printf_main(&writer, format, args);

0 commit comments

Comments
 (0)