Skip to content

Commit 3bff720

Browse files
Merge branch 'main' into cfg-switch-default
2 parents 87c8c8e + 5bbf724 commit 3bff720

37 files changed

+1027
-310
lines changed

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13660,7 +13660,7 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation UsingLoc, bool HasTypename,
1366013660

1366113661
if (Cxx20Enumerator) {
1366213662
Diag(NameLoc, diag::warn_cxx17_compat_using_decl_non_member_enumerator)
13663-
<< SS.getRange();
13663+
<< SS.getScopeRep() << SS.getRange();
1366413664
return false;
1366513665
}
1366613666

clang/test/CodeGen/X86/avx512ifma-builtins.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512ifma -emit-llvm -o - -Wall -Werror | FileCheck %s
44
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx512ifma -emit-llvm -o - -Wall -Werror | FileCheck %s
55

6+
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512ifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
7+
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx512ifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
8+
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512ifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
9+
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +avx512ifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
10+
611

712
#include <immintrin.h>
813

clang/test/CodeGen/X86/avx512ifmavl-builtins.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
// RUN: %clang_cc1 -x c++ %s -flax-vector-conversions=none -ffreestanding -triple=x86_64-apple-darwin -target-feature +avx512ifma -target-feature +avx512vl -emit-llvm -o - -Wall -Werror | FileCheck %s
44
// RUN: %clang_cc1 -x c++ %s -flax-vector-conversions=none -ffreestanding -triple=i386-apple-darwin -target-feature +avx512ifma -target-feature +avx512vl -emit-llvm -o - -Wall -Werror | FileCheck %s
55

6+
// RUN: %clang_cc1 -x c %s -flax-vector-conversions=none -ffreestanding -triple=x86_64-apple-darwin -target-feature +avx512ifma -target-feature +avx512vl -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
7+
// RUN: %clang_cc1 -x c %s -flax-vector-conversions=none -ffreestanding -triple=i386-apple-darwin -target-feature +avx512ifma -target-feature +avx512vl -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
8+
// RUN: %clang_cc1 -x c++ %s -flax-vector-conversions=none -ffreestanding -triple=x86_64-apple-darwin -target-feature +avx512ifma -target-feature +avx512vl -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
9+
// RUN: %clang_cc1 -x c++ %s -flax-vector-conversions=none -ffreestanding -triple=i386-apple-darwin -target-feature +avx512ifma -target-feature +avx512vl -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
10+
11+
612
#include <immintrin.h>
713

814
__m128i test_mm_madd52hi_epu64(__m128i __X, __m128i __Y, __m128i __Z) {

clang/test/CodeGen/X86/avxifma-builtins.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avxifma -emit-llvm -o - -Wall -Werror | FileCheck %s
44
// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=i386-apple-darwin -target-feature +avxifma -emit-llvm -o - -Wall -Werror | FileCheck %s
55

6+
// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avxifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
7+
// RUN: %clang_cc1 -x c -ffreestanding %s -triple=i386-apple-darwin -target-feature +avxifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
8+
// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avxifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
9+
// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=i386-apple-darwin -target-feature +avxifma -emit-llvm -o - -Wall -Werror -fexperimental-new-constant-interpreter | FileCheck %s
10+
11+
612
#include <immintrin.h>
713

814
__m128i test_mm_madd52hi_epu64(__m128i __X, __m128i __Y, __m128i __Z) {

clang/test/SemaCXX/cxx98-compat.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s
2-
// RUN: %clang_cc1 -fsyntax-only -std=c++14 -Wc++98-compat -verify %s -DCXX14COMPAT
3-
// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++98-compat -verify %s -DCXX14COMPAT -DCXX17COMPAT
1+
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify=expected,not-cpp20 %s
2+
// RUN: %clang_cc1 -fsyntax-only -std=c++14 -Wc++98-compat -verify=expected,not-cpp20 %s -DCXX14COMPAT
3+
// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++98-compat -verify=expected,not-cpp20 %s -DCXX14COMPAT -DCXX17COMPAT
4+
// RUN: %clang_cc1 -fsyntax-only -std=c++20 -Wc++98-compat -verify=expected,cpp20 %s -DCXX14COMPAT -DCXX17COMPAT
45

56
namespace std {
67
struct type_info;
@@ -226,7 +227,8 @@ void TrivialButNonPODThroughEllipsis() {
226227
}
227228

228229
struct HasExplicitConversion {
229-
explicit operator bool(); // expected-warning {{explicit conversion functions are incompatible with C++98}}
230+
// FIXME I think we should generate this diagnostic in C++20
231+
explicit operator bool(); // not-cpp20-warning {{explicit conversion functions are incompatible with C++98}}
230232
};
231233

232234
struct Struct {};
@@ -430,3 +432,12 @@ void ctad_test() {
430432
CTAD t = s; // expected-warning {{class template argument deduction is incompatible with C++ standards before C++17}}
431433
}
432434
#endif
435+
436+
namespace GH161702 {
437+
struct S {
438+
enum E { A };
439+
using E::A; // expected-warning {{enumeration type in nested name specifier is incompatible with C++98}}
440+
// not-cpp20-error@-1 {{using declaration refers to its own class}}
441+
// cpp20-warning@-2 {{member using declaration naming non-class ''E'' enumerator is incompatible with C++ standards before C++20}}
442+
};
443+
}

clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,10 @@ static Error runAOTCompile(StringRef InputFile, StringRef OutputFile,
462462

463463
// TODO: Consider using LLVM-IR metadata to identify globals of interest
464464
bool isKernel(const Function &F) {
465-
const CallingConv::ID CC = F.getCallingConv();
466-
return CC == CallingConv::SPIR_KERNEL || CC == CallingConv::AMDGPU_KERNEL ||
467-
CC == CallingConv::PTX_Kernel;
465+
const llvm::CallingConv::ID CC = F.getCallingConv();
466+
return CC == llvm::CallingConv::SPIR_KERNEL ||
467+
CC == llvm::CallingConv::AMDGPU_KERNEL ||
468+
CC == llvm::CallingConv::PTX_Kernel;
468469
}
469470

470471
/// Performs the following steps:

flang/include/flang/Lower/OpenACC.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ static constexpr llvm::StringRef privatizationRecipePrefix = "privatization";
7777
mlir::Value genOpenACCConstruct(AbstractConverter &,
7878
Fortran::semantics::SemanticsContext &,
7979
pft::Evaluation &,
80-
const parser::OpenACCConstruct &);
80+
const parser::OpenACCConstruct &,
81+
Fortran::lower::SymMap &localSymbols);
8182
void genOpenACCDeclarativeConstruct(
8283
AbstractConverter &, Fortran::semantics::SemanticsContext &,
8384
StatementContext &, const parser::OpenACCDeclarativeConstruct &);

flang/include/flang/Lower/SymbolMap.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ class SymMap {
260260
return lookupSymbol(*sym);
261261
}
262262

263+
/// Find a symbol by name and return its value if it appears in the current
264+
/// mappings. This lookup is more expensive as it iterates over the map.
265+
const semantics::Symbol *lookupSymbolByName(llvm::StringRef symName);
266+
263267
/// Find `symbol` and return its value if it appears in the inner-most level
264268
/// map.
265269
SymbolBox shallowLookupSymbol(semantics::SymbolRef sym);

flang/include/flang/Semantics/symbol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ class Symbol {
801801
AccPrivate, AccFirstPrivate, AccShared,
802802
// OpenACC data-mapping attribute
803803
AccCopy, AccCopyIn, AccCopyInReadOnly, AccCopyOut, AccCreate, AccDelete,
804-
AccPresent, AccLink, AccDeviceResident, AccDevicePtr,
804+
AccPresent, AccLink, AccDeviceResident, AccDevicePtr, AccUseDevice,
805805
// OpenACC declare
806806
AccDeclare,
807807
// OpenACC data-movement attribute

flang/lib/Lower/Bridge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3182,7 +3182,7 @@ class FirConverter : public Fortran::lower::AbstractConverter {
31823182
mlir::OpBuilder::InsertPoint insertPt = builder->saveInsertionPoint();
31833183
localSymbols.pushScope();
31843184
mlir::Value exitCond = genOpenACCConstruct(
3185-
*this, bridge.getSemanticsContext(), getEval(), acc);
3185+
*this, bridge.getSemanticsContext(), getEval(), acc, localSymbols);
31863186

31873187
const Fortran::parser::OpenACCLoopConstruct *accLoop =
31883188
std::get_if<Fortran::parser::OpenACCLoopConstruct>(&acc.u);

0 commit comments

Comments
 (0)