Skip to content

Commit 8bf3602

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:50c298fd174f into amd-gfx:ed8d3fbeeabb
Local branch amd-gfx ed8d3fb Merged main:cf1bde33423d into amd-gfx:af24aa3aae84 Remote branch main 50c298f [CVP] Regenerate test checks (NFC)
2 parents ed8d3fb + 50c298f commit 8bf3602

File tree

103 files changed

+1006
-566
lines changed

Some content is hidden

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

103 files changed

+1006
-566
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ env:
4343

4444
jobs:
4545
stage1:
46+
if: github.repository_owner == 'llvm'
4647
runs-on:
4748
group: libcxx-runners-8
4849
continue-on-error: false
@@ -81,6 +82,7 @@ jobs:
8182
**/CMakeOutput.log
8283
**/crash_diagnostics/*
8384
stage2:
85+
if: github.repository_owner == 'llvm'
8486
runs-on:
8587
group: libcxx-runners-8
8688
needs: [ stage1 ]
@@ -130,6 +132,7 @@ jobs:
130132
**/CMakeOutput.log
131133
**/crash_diagnostics/*
132134
stage3:
135+
if: github.repository_owner == 'llvm'
133136
needs: [ stage1, stage2 ]
134137
continue-on-error: false
135138
strategy:

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ Non-comprehensive list of changes in this release
225225
determined at runtime.
226226
* The ``__datasizeof`` keyword has been added. It is similar to ``sizeof``
227227
except that it returns the size of a type ignoring tail padding.
228-
* ``__builtin_classify_type()`` now classifies ``_BitInt`` values as the return value ``18``,
229-
to match GCC 14's behavior.
228+
* ``__builtin_classify_type()`` now classifies ``_BitInt`` values as the return value ``18``
229+
and vector types as return value ``19``, to match GCC 14's behavior.
230230

231231
New Compiler Flags
232232
------------------

clang/include/clang/Basic/AttrDocs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7585,7 +7585,7 @@ def CoroLifetimeBoundDoc : Documentation {
75857585
let Category = DocCatDecl;
75867586
let Content = [{
75877587
The ``[[clang::coro_lifetimebound]]`` is a class attribute which can be applied
7588-
to a `coroutine return type (`CRT`_) (i.e.
7588+
to a coroutine return type (`CRT`_) (i.e.
75897589
it should also be annotated with ``[[clang::coro_return_type]]``).
75907590

75917591
All parameters of a function are considered to be lifetime bound. See `documentation`_

clang/lib/AST/ASTImporter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,6 +3513,14 @@ class IsTypeDeclaredInsideVisitor
35133513
return {};
35143514
}
35153515

3516+
std::optional<bool>
3517+
VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
3518+
// The "associated declaration" can be the same as ParentDC.
3519+
if (isAncestorDeclContextOf(ParentDC, T->getAssociatedDecl()))
3520+
return true;
3521+
return {};
3522+
}
3523+
35163524
std::optional<bool> VisitConstantArrayType(const ConstantArrayType *T) {
35173525
if (T->getSizeExpr() && isAncestorDeclContextOf(ParentDC, T->getSizeExpr()))
35183526
return true;
@@ -3573,6 +3581,8 @@ class IsTypeDeclaredInsideVisitor
35733581
};
35743582
} // namespace
35753583

3584+
/// This function checks if the function has 'auto' return type that contains
3585+
/// a reference (in any way) to a declaration inside the same function.
35763586
bool ASTNodeImporter::hasAutoReturnTypeDeclaredInside(FunctionDecl *D) {
35773587
QualType FromTy = D->getType();
35783588
const auto *FromFPT = FromTy->getAs<FunctionProtoType>();

clang/lib/AST/ExprConstShared.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ enum class GCCTypeClass {
4949
// literals.
5050
// Lang = 16,
5151
// OpaqueType = 17,
52-
BitInt = 18
52+
BitInt = 18,
53+
Vector = 19
5354
};
5455

5556
GCCTypeClass EvaluateBuiltinClassifyType(QualType T,

clang/lib/AST/ExprConstant.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11615,16 +11615,18 @@ GCCTypeClass EvaluateBuiltinClassifyType(QualType T,
1161511615
return EvaluateBuiltinClassifyType(
1161611616
CanTy->castAs<AtomicType>()->getValueType(), LangOpts);
1161711617

11618-
case Type::BlockPointer:
1161911618
case Type::Vector:
1162011619
case Type::ExtVector:
11620+
return GCCTypeClass::Vector;
11621+
11622+
case Type::BlockPointer:
1162111623
case Type::ConstantMatrix:
1162211624
case Type::ObjCObject:
1162311625
case Type::ObjCInterface:
1162411626
case Type::ObjCObjectPointer:
1162511627
case Type::Pipe:
11626-
// GCC classifies vectors as None. We follow its lead and classify all
11627-
// other types that don't fit into the regular classification the same way.
11628+
// Classify all other types that don't fit into the regular
11629+
// classification the same way.
1162811630
return GCCTypeClass::None;
1162911631

1163011632
case Type::BitInt:

clang/test/Sema/builtin-classify-type.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ enum gcc_type_class {
1313
record_type_class, union_type_class,
1414
array_type_class, string_type_class,
1515
lang_type_class, opaque_type_class,
16-
bitint_type_class
16+
bitint_type_class, vector_type_class
1717
};
1818

1919
void foo(void) {
@@ -67,8 +67,8 @@ void foo(void) {
6767
int a11[__builtin_classify_type(arr) == pointer_type_class ? 1 : -1];
6868
int a12[__builtin_classify_type("abc") == pointer_type_class ? 1 : -1];
6969
int a13[__builtin_classify_type(block) == no_type_class ? 1 : -1];
70-
int a14[__builtin_classify_type(vec) == no_type_class ? 1 : -1];
71-
int a15[__builtin_classify_type(evec) == no_type_class ? 1 : -1];
70+
int a14[__builtin_classify_type(vec) == vector_type_class ? 1 : -1];
71+
int a15[__builtin_classify_type(evec) == vector_type_class ? 1 : -1];
7272
int a16[__builtin_classify_type(atomic_i) == integer_type_class ? 1 : -1];
7373
int a17[__builtin_classify_type(atomic_d) == real_type_class ? 1 : -1];
7474
int a18[__builtin_classify_type(complex_i) == complex_type_class ? 1 : -1];

clang/test/SemaCXX/builtin-classify-type.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ enum gcc_type_class {
1313
record_type_class, union_type_class,
1414
array_type_class, string_type_class,
1515
lang_type_class, opaque_type_class,
16-
bitint_type_class
16+
bitint_type_class, vector_type_class
1717
};
1818

1919
class cl {
@@ -62,8 +62,8 @@ void foo() {
6262
int a14[__builtin_classify_type(arr) == pointer_type_class ? 1 : -1];
6363
int a15[__builtin_classify_type("abc") == pointer_type_class ? 1 : -1];
6464
int a16[__builtin_classify_type(block) == no_type_class ? 1 : -1];
65-
int a17[__builtin_classify_type(vec) == no_type_class ? 1 : -1];
66-
int a18[__builtin_classify_type(evec) == no_type_class ? 1 : -1];
65+
int a17[__builtin_classify_type(vec) == vector_type_class ? 1 : -1];
66+
int a18[__builtin_classify_type(evec) == vector_type_class ? 1 : -1];
6767
int a19[__builtin_classify_type(atomic_i) == integer_type_class ? 1 : -1];
6868
int a20[__builtin_classify_type(atomic_d) == real_type_class ? 1 : -1];
6969
int a21[__builtin_classify_type(complex_i) == complex_type_class ? 1 : -1];

clang/unittests/AST/ASTImporterTest.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6790,10 +6790,13 @@ TEST_P(ASTImporterOptionSpecificTestBase,
67906790
}
67916791

67926792
struct ImportAutoFunctions : ASTImporterOptionSpecificTestBase {
6793-
void testImport(llvm::StringRef Code, clang::TestLanguage Lang = Lang_CXX14) {
6793+
void testImport(llvm::StringRef Code, clang::TestLanguage Lang = Lang_CXX14,
6794+
bool FindLast = false) {
67946795
Decl *FromTU = getTuDecl(Code, Lang, "input0.cc");
6795-
FunctionDecl *From = FirstDeclMatcher<FunctionDecl>().match(
6796-
FromTU, functionDecl(hasName("foo")));
6796+
FunctionDecl *From = FindLast ? LastDeclMatcher<FunctionDecl>().match(
6797+
FromTU, functionDecl(hasName("foo")))
6798+
: FirstDeclMatcher<FunctionDecl>().match(
6799+
FromTU, functionDecl(hasName("foo")));
67976800

67986801
FunctionDecl *To = Import(From, Lang);
67996802
EXPECT_TRUE(To);
@@ -7232,6 +7235,20 @@ TEST_P(ImportAutoFunctions, ReturnWithTypeInSwitch) {
72327235
Lang_CXX17);
72337236
}
72347237

7238+
TEST_P(ImportAutoFunctions, ReturnWithAutoTemplateType) {
7239+
testImport(
7240+
R"(
7241+
template<class T>
7242+
struct S {};
7243+
template<class T>
7244+
auto foo() {
7245+
return S<T>{};
7246+
}
7247+
auto a = foo<int>();
7248+
)",
7249+
Lang_CXX14, /*FindLast=*/true);
7250+
}
7251+
72357252
struct ImportSourceLocations : ASTImporterOptionSpecificTestBase {};
72367253

72377254
TEST_P(ImportSourceLocations, PreserveFileIDTreeStructure) {

libc/src/__support/FPUtil/FloatProperties.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -218,24 +218,6 @@ template <> struct FloatProperties<float128> {
218218
};
219219
#endif // LIBC_COMPILER_HAS_FLOAT128
220220

221-
// Define the float type corresponding to the BitsType.
222-
template <typename BitsType> struct FloatType;
223-
224-
template <> struct FloatType<uint32_t> {
225-
static_assert(sizeof(uint32_t) == sizeof(float),
226-
"Unexpected size of 'float' type.");
227-
typedef float Type;
228-
};
229-
230-
template <> struct FloatType<uint64_t> {
231-
static_assert(sizeof(uint64_t) == sizeof(double),
232-
"Unexpected size of 'double' type.");
233-
typedef double Type;
234-
};
235-
236-
template <typename BitsType>
237-
using FloatTypeT = typename FloatType<BitsType>::Type;
238-
239221
} // namespace fputil
240222
} // namespace LIBC_NAMESPACE
241223

0 commit comments

Comments
 (0)