Skip to content

Commit 9278567

Browse files
authored
merge main into amd-staging (llvm#1012)
2 parents 3f181e5 + d4ac1c2 commit 9278567

File tree

413 files changed

+16888
-5993
lines changed

Some content is hidden

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

413 files changed

+16888
-5993
lines changed

bolt/runtime/hugify.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ static bool hasPagecacheTHPSupport() {
8585
KernelVersionTy KernelVersion;
8686

8787
getKernelVersion((uint32_t *)&KernelVersion);
88-
if (KernelVersion.major >= 5 && KernelVersion.minor >= 10)
88+
if (KernelVersion.major >= 6 ||
89+
(KernelVersion.major == 5 && KernelVersion.minor >= 10))
8990
return true;
9091

9192
return false;

bolt/utils/docker/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ RUN mkdir build && \
2323
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--push-state -Wl,-whole-archive -ljemalloc_pic -Wl,--pop-state -lpthread -lstdc++ -lm -ldl" \
2424
-DCMAKE_INSTALL_PREFIX=/home/bolt/install && \
2525
ninja check-bolt && \
26-
ninja install-llvm-bolt install-perf2bolt install-merge-fdata \
27-
install-llvm-boltdiff install-bolt_rt
26+
ninja install-llvm-bolt install-merge-fdata install-bolt_rt
2827

2928
FROM ubuntu:24.04
3029

clang/docs/ReleaseNotes.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Potentially Breaking Changes
3535
============================
3636

3737
- The Objective-C ARC migrator (ARCMigrate) has been removed.
38+
- Fix missing diagnostics for uses of declarations when performing typename access,
39+
such as when performing member access on a '[[deprecated]]' type alias.
40+
(#GH58547)
3841

3942
C/C++ Language Potentially Breaking Changes
4043
-------------------------------------------
@@ -93,6 +96,9 @@ Resolutions to C++ Defect Reports
9396
- Implemented `CWG2918 Consideration of constraints for address of overloaded `
9497
`function <https://cplusplus.github.io/CWG/issues/2918.html>`_
9598

99+
- Bumped the ``__cpp_constexpr`` feature-test macro to ``202002L`` in C++20 mode as indicated in
100+
`P2493R0 <https://wg21.link/P2493R0>`_.
101+
96102
C Language Changes
97103
------------------
98104

@@ -144,6 +150,9 @@ related warnings within the method body.
144150
``__attribute__((model("large")))`` on non-TLS globals in x86-64 compilations.
145151
This forces the global to be considered small or large in regards to the
146152
x86-64 code model, regardless of the code model specified for the compilation.
153+
- Clang now emits a warning ``-Wreserved-init-priority`` instead of a hard error
154+
when ``__attribute__((init_priority(n)))`` is used with values of n in the
155+
reserved range [0, 100]. The warning will be treated as an error by default.
147156

148157
- There is a new ``format_matches`` attribute to complement the existing
149158
``format`` attribute. ``format_matches`` allows the compiler to verify that
@@ -237,6 +246,8 @@ Bug Fixes in This Version
237246
when it can affect template argument deduction (#GH122306).
238247
- Fix crash on code completion of function calls involving partial order of function templates
239248
(#GH125500).
249+
- Fixed clang crash when #embed data does not fit into an array
250+
(#GH128987).
240251

241252
Bug Fixes to Compiler Builtins
242253
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -258,6 +269,8 @@ Bug Fixes to C++ Support
258269
- Clang is now better at keeping track of friend function template instance contexts. (#GH55509)
259270
- Clang now prints the correct instantiation context for diagnostics suppressed
260271
by template argument deduction.
272+
- Clang is now better at instantiating the function definition after its use inside
273+
of a constexpr lambda. (#GH125747)
261274
- The initialization kind of elements of structured bindings
262275
direct-list-initialized from an array is corrected to direct-initialization.
263276
- Clang no longer crashes when a coroutine is declared ``[[noreturn]]``. (#GH127327)

clang/include/clang/Basic/AttrDocs.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,8 +2828,8 @@ targets. This attribute may be attached to a function definition and instructs
28282828
the backend to generate appropriate function entry/exit code so that it can be
28292829
used directly as an interrupt service routine.
28302830

2831-
Permissible values for this parameter are ``user``, ``supervisor``,
2832-
and ``machine``. If there is no parameter, then it defaults to machine.
2831+
Permissible values for this parameter are ``supervisor`` and ``machine``. If
2832+
there is no parameter, then it defaults to ``machine``.
28332833

28342834
Repeated interrupt attribute on the same declaration will cause a warning
28352835
to be emitted. In case of repeated declarations, the last one prevails.

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,6 @@ TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal, "vIi", "n", "gfx12-insts")
487487
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal_var, "vv*i", "n", "gfx12-insts")
488488
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_wait, "vIs", "n", "gfx12-insts")
489489
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal_isfirst, "bIi", "n", "gfx12-insts")
490-
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_init, "vv*i", "n", "gfx12-insts")
491-
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_join, "vv*", "n", "gfx12-insts")
492-
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_leave, "vIs", "n", "gfx12-insts")
493490
TARGET_BUILTIN(__builtin_amdgcn_s_get_barrier_state, "Uii", "n", "gfx12-insts")
494491
TARGET_BUILTIN(__builtin_amdgcn_s_get_named_barrier_state, "Uiv*", "n", "gfx12-insts")
495492
TARGET_BUILTIN(__builtin_amdgcn_s_prefetch_data, "vvC*Ui", "nc", "gfx12-insts")

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3343,6 +3343,9 @@ def err_attribute_argument_out_of_range : Error<
33433343
def err_init_priority_object_attr : Error<
33443344
"can only use 'init_priority' attribute on file-scope definitions "
33453345
"of objects of class type">;
3346+
def warn_init_priority_reserved : Warning<
3347+
"requested 'init_priority' %0 is reserved for internal use">,
3348+
InGroup<DiagGroup<"init-priority-reserved">>, DefaultError;
33463349
def err_attribute_argument_out_of_bounds : Error<
33473350
"%0 attribute parameter %1 is out of bounds">;
33483351
def err_attribute_only_once_per_parameter : Error<

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ struct MissingFeatures {
2727
// Address space related
2828
static bool addressSpace() { return false; }
2929

30-
// This isn't needed until we add support for bools.
31-
static bool convertTypeForMemory() { return false; }
32-
3330
// CIRGenFunction implementation details
3431
static bool cgfSymbolTable() { return false; }
3532

@@ -40,10 +37,14 @@ struct MissingFeatures {
4037
static bool opGlobalAlignment() { return false; }
4138
static bool opGlobalLinkage() { return false; }
4239

43-
// Load attributes
40+
// Load/store attributes
4441
static bool opLoadThreadLocal() { return false; }
4542
static bool opLoadEmitScalarRangeCheck() { return false; }
4643
static bool opLoadBooleanRepresentation() { return false; }
44+
static bool opLoadStoreTbaa() { return false; }
45+
static bool opLoadStoreMemOrder() { return false; }
46+
static bool opLoadStoreVolatile() { return false; }
47+
static bool opLoadStoreAlignment() { return false; }
4748

4849
// AllocaOp handling
4950
static bool opAllocaVarDeclContext() { return false; }
@@ -55,11 +56,23 @@ struct MissingFeatures {
5556
static bool opAllocaOpenMPThreadPrivate() { return false; }
5657
static bool opAllocaEscapeByReference() { return false; }
5758
static bool opAllocaReference() { return false; }
59+
static bool opAllocaAnnotations() { return false; }
60+
static bool opAllocaDynAllocSize() { return false; }
61+
62+
// FuncOp handling
63+
static bool opFuncOpenCLKernelMetadata() { return false; }
64+
static bool opFuncCallingConv() { return false; }
65+
static bool opFuncExtraAttrs() { return false; }
66+
static bool opFuncDsolocal() { return false; }
67+
static bool opFuncLinkage() { return false; }
68+
static bool opFuncVisibility() { return false; }
5869

5970
// Misc
6071
static bool scalarConversionOpts() { return false; }
6172
static bool tryEmitAsConstant() { return false; }
6273
static bool constructABIArgDirectExtend() { return false; }
74+
static bool opGlobalViewAttr() { return false; }
75+
static bool lowerModeOptLevel() { return false; }
6376
};
6477

6578
} // namespace cir

clang/include/clang/Sema/Sema.h

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3168,6 +3168,13 @@ class Sema final : public SemaBase {
31683168

31693169
DeclGroupPtrTy ConvertDeclToDeclGroup(Decl *Ptr, Decl *OwnedType = nullptr);
31703170

3171+
enum class DiagCtorKind { None, Implicit, Typename };
3172+
/// Returns the TypeDeclType for the given type declaration,
3173+
/// as ASTContext::getTypeDeclType would, but
3174+
/// performs the required semantic checks for name lookup of said entity.
3175+
QualType getTypeDeclType(DeclContext *LookupCtx, DiagCtorKind DCK,
3176+
TypeDecl *TD, SourceLocation NameLoc);
3177+
31713178
/// If the identifier refers to a type name within this scope,
31723179
/// return the declaration of that type.
31733180
///
@@ -13650,12 +13657,16 @@ class Sema final : public SemaBase {
1365013657

1365113658
class LocalEagerInstantiationScope {
1365213659
public:
13653-
LocalEagerInstantiationScope(Sema &S) : S(S) {
13660+
LocalEagerInstantiationScope(Sema &S, bool AtEndOfTU)
13661+
: S(S), AtEndOfTU(AtEndOfTU) {
1365413662
SavedPendingLocalImplicitInstantiations.swap(
1365513663
S.PendingLocalImplicitInstantiations);
1365613664
}
1365713665

13658-
void perform() { S.PerformPendingInstantiations(/*LocalOnly=*/true); }
13666+
void perform() {
13667+
S.PerformPendingInstantiations(/*LocalOnly=*/true,
13668+
/*AtEndOfTU=*/AtEndOfTU);
13669+
}
1365913670

1366013671
~LocalEagerInstantiationScope() {
1366113672
assert(S.PendingLocalImplicitInstantiations.empty() &&
@@ -13666,6 +13677,7 @@ class Sema final : public SemaBase {
1366613677

1366713678
private:
1366813679
Sema &S;
13680+
bool AtEndOfTU;
1366913681
std::deque<PendingImplicitInstantiation>
1367013682
SavedPendingLocalImplicitInstantiations;
1367113683
};
@@ -13688,8 +13700,8 @@ class Sema final : public SemaBase {
1368813700

1368913701
class GlobalEagerInstantiationScope {
1369013702
public:
13691-
GlobalEagerInstantiationScope(Sema &S, bool Enabled)
13692-
: S(S), Enabled(Enabled) {
13703+
GlobalEagerInstantiationScope(Sema &S, bool Enabled, bool AtEndOfTU)
13704+
: S(S), Enabled(Enabled), AtEndOfTU(AtEndOfTU) {
1369313705
if (!Enabled)
1369413706
return;
1369513707

@@ -13703,7 +13715,8 @@ class Sema final : public SemaBase {
1370313715
void perform() {
1370413716
if (Enabled) {
1370513717
S.DefineUsedVTables();
13706-
S.PerformPendingInstantiations();
13718+
S.PerformPendingInstantiations(/*LocalOnly=*/false,
13719+
/*AtEndOfTU=*/AtEndOfTU);
1370713720
}
1370813721
}
1370913722

@@ -13718,7 +13731,8 @@ class Sema final : public SemaBase {
1371813731
S.SavedVTableUses.pop_back();
1371913732

1372013733
// Restore the set of pending implicit instantiations.
13721-
if (S.TUKind != TU_Prefix || !S.LangOpts.PCHInstantiateTemplates) {
13734+
if ((S.TUKind != TU_Prefix || !S.LangOpts.PCHInstantiateTemplates) &&
13735+
AtEndOfTU) {
1372213736
assert(S.PendingInstantiations.empty() &&
1372313737
"PendingInstantiations should be empty before it is discarded.");
1372413738
S.PendingInstantiations.swap(S.SavedPendingInstantiations.back());
@@ -13737,6 +13751,7 @@ class Sema final : public SemaBase {
1373713751
private:
1373813752
Sema &S;
1373913753
bool Enabled;
13754+
bool AtEndOfTU;
1374013755
};
1374113756

1374213757
ExplicitSpecifier instantiateExplicitSpecifier(
@@ -13922,7 +13937,8 @@ class Sema final : public SemaBase {
1392213937

1392313938
/// Performs template instantiation for all implicit template
1392413939
/// instantiations we have seen until this point.
13925-
void PerformPendingInstantiations(bool LocalOnly = false);
13940+
void PerformPendingInstantiations(bool LocalOnly = false,
13941+
bool AtEndOfTU = true);
1392613942

1392713943
TemplateParameterList *
1392813944
SubstTemplateParams(TemplateParameterList *Params, DeclContext *Owner,

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6325,7 +6325,7 @@ bool Compiler<Emitter>::visitDeclRef(const ValueDecl *D, const Expr *E) {
63256325
if (auto It = Locals.find(D); It != Locals.end()) {
63266326
const unsigned Offset = It->second.Offset;
63276327
if (IsReference)
6328-
return this->emitGetLocal(PT_Ptr, Offset, E);
6328+
return this->emitGetLocal(classifyPrim(E), Offset, E);
63296329
return this->emitGetPtrLocal(Offset, E);
63306330
} else if (auto GlobalIndex = P.getGlobal(D)) {
63316331
if (IsReference) {

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,9 @@ bool Call(InterpState &S, CodePtr OpPC, const Function *Func,
13411341
} else {
13421342
if (!CheckInvoke(S, OpPC, ThisPtr))
13431343
return cleanup();
1344+
if (!Func->isConstructor() &&
1345+
!CheckActive(S, OpPC, ThisPtr, AK_MemberCall))
1346+
return false;
13441347
}
13451348

13461349
if (Func->isConstructor() && !checkConstructor(S, OpPC, Func, ThisPtr))
@@ -1512,7 +1515,7 @@ bool CallPtr(InterpState &S, CodePtr OpPC, uint32_t ArgSize,
15121515
// This happens when the call expression has been cast to
15131516
// something else, but we don't support that.
15141517
if (S.Ctx.classify(F->getDecl()->getReturnType()) !=
1515-
S.Ctx.classify(CE->getType()))
1518+
S.Ctx.classify(CE->getCallReturnType(S.getASTContext())))
15161519
return false;
15171520

15181521
// Check argument nullability state.

0 commit comments

Comments
 (0)