Skip to content

Commit 9b844a5

Browse files
author
z1.cciauto
committed
merge main into amd-staging
2 parents 40d8571 + afbf86e commit 9b844a5

File tree

304 files changed

+2604
-1098
lines changed

Some content is hidden

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

304 files changed

+2604
-1098
lines changed

.ci/compute_projects_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
22
# See https://llvm.org/LICENSE.txt for license information.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4-
"""Does some stuff."""
4+
"""Tests for compute_projects.py"""
55

66
import unittest
77

.ci/metrics/metrics.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
"""Collects Github metrics and uploads them to Grafana.
5+
6+
This script contains machinery that will pull metrics periodically from Github
7+
about workflow runs. It will upload the collected metrics to the specified
8+
Grafana instance.
9+
"""
10+
111
import collections
212
import datetime
313
import github

clang/lib/Sema/SemaDecl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3267,6 +3267,14 @@ void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old,
32673267
if (isa<UsedAttr>(I) || isa<RetainAttr>(I))
32683268
continue;
32693269

3270+
if (isa<InferredNoReturnAttr>(I)) {
3271+
if (auto *FD = dyn_cast<FunctionDecl>(New)) {
3272+
if (FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
3273+
continue; // Don't propagate inferred noreturn attributes to explicit
3274+
// specializations.
3275+
}
3276+
}
3277+
32703278
if (mergeDeclAttribute(*this, New, I, LocalAMK))
32713279
foundAny = true;
32723280
}

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,13 @@ void clang::inferNoReturnAttr(Sema &S, const Decl *D) {
19701970
if (!FD)
19711971
return;
19721972

1973+
// Skip explicit specializations here as they may have
1974+
// a user-provided definition that may deliberately differ from the primary
1975+
// template. If an explicit specialization truly never returns, the user
1976+
// should explicitly mark it with [[noreturn]].
1977+
if (FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
1978+
return;
1979+
19731980
auto *NonConstFD = const_cast<FunctionDecl *>(FD);
19741981
DiagnosticsEngine &Diags = S.getDiagnostics();
19751982
if (Diags.isIgnored(diag::warn_falloff_nonvoid, FD->getLocation()) &&

clang/test/SemaCXX/wreturn-always-throws.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type -verify %s
1+
// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type -Winvalid-noreturn -verify %s
22
// expected-no-diagnostics
33

44
namespace std {
@@ -44,3 +44,22 @@ void testTemplates() {
4444
throwErrorTemplate("ERROR");
4545
(void)ensureZeroTemplate(42);
4646
}
47+
48+
// Ensure that explicit specialization of a member function does not inherit
49+
// the warning from the primary template.
50+
51+
template<typename T>
52+
struct S {
53+
void f();
54+
void g();
55+
};
56+
57+
template<typename T>
58+
void S<T>::f() { throw 0; }
59+
template<>
60+
void S<int>::f() {}
61+
62+
template<typename T>
63+
void S<T>::g() {}
64+
template<>
65+
void S<int>::g() { throw 0; }

libc/benchmarks/gpu/BenchmarkLogger.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "benchmarks/gpu/BenchmarkLogger.h"
2+
#include "hdr/stdint_proxy.h"
23
#include "src/__support/CPP/string.h"
34
#include "src/__support/CPP/string_view.h"
45
#include "src/__support/OSUtil/io.h" // write_to_stderr
@@ -7,8 +8,6 @@
78
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
89
#include "src/__support/uint128.h"
910

10-
#include <stdint.h>
11-
1211
namespace LIBC_NAMESPACE_DECL {
1312
namespace benchmarks {
1413

libc/benchmarks/gpu/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ add_unittest_framework_library(
4545
LibcGpuBenchmark.h
4646
BenchmarkLogger.h
4747
DEPENDS
48+
libc.hdr.stdint_proxy
4849
libc.src.__support.big_int
4950
libc.src.__support.c_string
5051
libc.src.__support.CPP.string

libc/benchmarks/gpu/LibcGpuBenchmark.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "benchmarks/gpu/BenchmarkLogger.h"
55
#include "benchmarks/gpu/timing/timing.h"
6+
#include "hdr/stdint_proxy.h"
67
#include "src/__support/CPP/array.h"
78
#include "src/__support/CPP/functional.h"
89
#include "src/__support/CPP/limits.h"
@@ -13,8 +14,6 @@
1314
#include "src/stdlib/rand.h"
1415
#include "src/time/clock.h"
1516

16-
#include <stdint.h>
17-
1817
namespace LIBC_NAMESPACE_DECL {
1918

2019
namespace benchmarks {

libc/benchmarks/gpu/src/math/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ add_benchmark(
3131
SRCS
3232
sin_benchmark.cpp
3333
DEPENDS
34+
libc.hdr.stdint_proxy
3435
libc.src.math.sin
3536
libc.src.math.sinf
3637
libc.src.stdlib.srand
@@ -51,6 +52,7 @@ add_benchmark(
5152
SRCS
5253
atan2_benchmark.cpp
5354
DEPENDS
55+
libc.hdr.stdint_proxy
5456
libc.src.math.atan2
5557
libc.src.stdlib.srand
5658
libc.src.stdlib.rand

libc/benchmarks/gpu/src/math/platform.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
//===----------------------------------------------------------------------===//
88
#ifndef LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
99
#define LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
10+
11+
#include "hdr/stdint_proxy.h"
1012
#include "src/__support/macros/attributes.h"
1113
#include "src/__support/macros/config.h"
12-
#include <stdint.h>
1314

1415
namespace LIBC_NAMESPACE_DECL {
1516

0 commit comments

Comments
 (0)