Skip to content

Commit 6b6e30e

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:74f69c49fed8 into origin/amd-gfx:c4e1c89c4f41
Local branch origin/amd-gfx c4e1c89 Merged main:c1e95b2e5e61 into origin/amd-gfx:e60c0ac07789 Remote branch main 74f69c4 [X86] SimplifyDemandedVectorEltsForTargetNode - reduce the size of VPERMV v16f32/v16i32 nodes if the upper elements are not demanded (llvm#134890)
2 parents c4e1c89 + 74f69c4 commit 6b6e30e

File tree

475 files changed

+15869
-5216
lines changed

Some content is hidden

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

475 files changed

+15869
-5216
lines changed

clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output-cast-type.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %check_clang_tidy %s bugprone-unintended-char-ostream-output %t -- \
22
// RUN: -config="{CheckOptions: \
3-
// RUN: {bugprone-unintended-char-ostream-output.CastTypeName: "uint8_t"}}"
3+
// RUN: {bugprone-unintended-char-ostream-output.CastTypeName: \"unsigned char\"}}"
44

55
namespace std {
66

@@ -33,12 +33,12 @@ void origin_ostream(std::ostream &os) {
3333
unsigned char unsigned_value = 9;
3434
os << unsigned_value;
3535
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'unsigned char' passed to 'operator<<' outputs as character instead of integer
36-
// CHECK-FIXES: os << static_cast<uint8_t>(unsigned_value);
36+
// CHECK-FIXES: os << static_cast<unsigned char>(unsigned_value);
3737

3838
signed char signed_value = 9;
3939
os << signed_value;
4040
// CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'signed char' passed to 'operator<<' outputs as character instead of integer
41-
// CHECK-FIXES: os << static_cast<uint8_t>(signed_value);
41+
// CHECK-FIXES: os << static_cast<unsigned char>(signed_value);
4242

4343
char char_value = 9;
4444
os << char_value;

clang-tools-extra/test/clang-tidy/checkers/bugprone/unintended-char-ostream-output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void based_on_ostream(A &os) {
5757
os << char_value;
5858
}
5959

60-
void based_on_ostream(std::basic_ostream<unsigned char> &os) {
60+
void other_ostream_template_parameters(std::basic_ostream<unsigned char> &os) {
6161
unsigned char unsigned_value = 9;
6262
os << unsigned_value;
6363

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ Improvements to Clang's diagnostics
321321

322322
- ``-Wc++98-compat`` no longer diagnoses use of ``__auto_type`` or
323323
``decltype(auto)`` as though it was the extension for ``auto``. (#GH47900)
324+
- Clang now issues a warning for missing return in ``main`` in C89 mode. (#GH21650)
324325

325326
- Now correctly diagnose a tentative definition of an array with static
326327
storage duration in pedantic mode in C. (#GH50661)
@@ -354,6 +355,14 @@ Bug Fixes in This Version
354355
- Defining an integer literal suffix (e.g., ``LL``) before including
355356
``<stdint.h>`` in a freestanding build no longer causes invalid token pasting
356357
when using the ``INTn_C`` macros. (#GH85995)
358+
- Clang no longer accepts invalid integer constants which are too large to fit
359+
into any (standard or extended) integer type when the constant is unevaluated.
360+
Merely forming the token is sufficient to render the program invalid. Code
361+
like this was previously accepted and is now rejected (#GH134658):
362+
.. code-block:: c
363+
364+
#if 1 ? 1 : 999999999999999999999
365+
#endif
357366
358367
Bug Fixes to Compiler Builtins
359368
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/DeclOpenACC.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class OpenACCConstructDecl : public Decl {
5959
}
6060

6161
ArrayRef<const OpenACCClause *> clauses() const { return Clauses; }
62+
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
63+
static bool classofKind(Kind K);
6264
};
6365

6466
class OpenACCDeclareDecl final

clang/include/clang/AST/GlobalDecl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "clang/AST/Attr.h"
1818
#include "clang/AST/DeclCXX.h"
1919
#include "clang/AST/DeclObjC.h"
20+
#include "clang/AST/DeclOpenACC.h"
2021
#include "clang/AST/DeclOpenMP.h"
2122
#include "clang/AST/DeclTemplate.h"
2223
#include "clang/Basic/ABI.h"
@@ -86,6 +87,8 @@ class GlobalDecl {
8687
GlobalDecl(const ObjCMethodDecl *D) { Init(D); }
8788
GlobalDecl(const OMPDeclareReductionDecl *D) { Init(D); }
8889
GlobalDecl(const OMPDeclareMapperDecl *D) { Init(D); }
90+
GlobalDecl(const OpenACCRoutineDecl *D) { Init(D); }
91+
GlobalDecl(const OpenACCDeclareDecl *D) { Init(D); }
8992
GlobalDecl(const CXXConstructorDecl *D, CXXCtorType Type) : Value(D, Type) {}
9093
GlobalDecl(const CXXDestructorDecl *D, CXXDtorType Type) : Value(D, Type) {}
9194
GlobalDecl(const VarDecl *D, DynamicInitKind StubKind)

clang/include/clang/Basic/Attr.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,13 @@ def EmptyBases : InheritableAttr, TargetSpecificAttr<TargetMicrosoftCXXABI> {
17091709
def AllocSize : InheritableAttr {
17101710
let Spellings = [GCC<"alloc_size">];
17111711
let Subjects = SubjectList<[HasFunctionProto]>;
1712+
// The parameter names here are a bit misleading.
1713+
// When used with a single argument, the first argument is obviously the
1714+
// allocation size; but when used with two arguments, the first argument is
1715+
// usually the number of elements, while the second argument is usually the
1716+
// element size - the reverse of how they are named here.
1717+
// The documentation of both GCC and clang does not describe any semantic
1718+
// difference between the first and second argument.
17121719
let Args = [ParamIdxArgument<"ElemSizeParam">,
17131720
ParamIdxArgument<"NumElemsParam", /*opt*/ 1>];
17141721
let TemplateDependent = 1;

clang/include/clang/Basic/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ macro(clang_diag_gen component)
1313
-gen-clang-diags-compat-ids -clang-component=${component}
1414
SOURCE Diagnostic.td
1515
TARGET ClangDiagnostic${component}CompatIDs)
16+
17+
clang_tablegen(Diagnostic${component}Interface.inc
18+
-gen-clang-diags-iface -clang-component=${component}
19+
SOURCE Diagnostic.td
20+
TARGET ClangDiagnostic${component}Interface)
1621
endmacro(clang_diag_gen)
1722

1823
clang_diag_gen(Analysis)

clang/include/clang/Basic/DiagnosticAST.h

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICAST_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define ASTSTART
21-
#include "clang/Basic/DiagnosticASTKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_AST_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticASTEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticASTCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticASTInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICAST_H

clang/include/clang/Basic/DiagnosticAnalysis.h

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICANALYSIS_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define ANALYSISSTART
21-
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_ANALYSIS_DIAGNOSTICS
24-
};
25-
#define DIAG_ENUM(ENUM_NAME) \
26-
namespace ENUM_NAME { \
27-
enum {
28-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
29-
#define DIAG_ENUM_END() \
30-
} \
31-
; \
32-
}
33-
#include "clang/Basic/DiagnosticAnalysisEnums.inc"
34-
#undef DIAG_ENUM_END
35-
#undef DIAG_ENUM_ITEM
36-
#undef DIAG_ENUM
37-
} // end namespace diag
38-
39-
namespace diag_compat {
40-
#define DIAG_COMPAT_IDS_BEGIN() enum {
41-
#define DIAG_COMPAT_IDS_END() \
42-
} \
43-
;
44-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
45-
#include "clang/Basic/DiagnosticAnalysisCompatIDs.inc"
46-
#undef DIAG_COMPAT_ID
47-
#undef DIAG_COMPAT_IDS_BEGIN
48-
#undef DIAG_COMPAT_IDS_END
49-
} // end namespace diag_compat
50-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticAnalysisInterface.inc"
5114

5215
#endif // LLVM_CLANG_BASIC_DIAGNOSTICANALYSIS_H

clang/include/clang/Basic/DiagnosticComment.h

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICCOMMENT_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define COMMENTSTART
21-
#include "clang/Basic/DiagnosticCommentKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_COMMENT_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticCommentEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticCommentCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticCommentInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICCOMMENT_H

clang/include/clang/Basic/DiagnosticCrossTU.h

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICCROSSTU_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define CROSSTUSTART
21-
#include "clang/Basic/DiagnosticCrossTUKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_CROSSTU_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticCrossTUEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticCrossTUCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticCrossTUInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICCROSSTU_H

clang/include/clang/Basic/DiagnosticDriver.h

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICDRIVER_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define DRIVERSTART
21-
#include "clang/Basic/DiagnosticDriverKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_DRIVER_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticDriverEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticDriverCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticDriverInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICDRIVER_H

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,4 +850,9 @@ def warn_missing_include_dirs : Warning<
850850

851851
def err_drv_malformed_warning_suppression_mapping : Error<
852852
"failed to process suppression mapping file '%0': %1">;
853+
854+
def warn_drv_openacc_without_cir
855+
: Warning<"OpenACC directives will result in no runtime behavior; use "
856+
"-fclangir to enable runtime effect">,
857+
InGroup<SourceUsesOpenACC>;
853858
}

clang/include/clang/Basic/DiagnosticFrontend.h

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,6 @@
1010
#define LLVM_CLANG_BASIC_DIAGNOSTICFRONTEND_H
1111

1212
#include "clang/Basic/Diagnostic.h"
13-
14-
namespace clang {
15-
namespace diag {
16-
enum {
17-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, SHOWINSYSMACRO, DEFERRABLE, CATEGORY) \
19-
ENUM,
20-
#define FRONTENDSTART
21-
#include "clang/Basic/DiagnosticFrontendKinds.inc"
22-
#undef DIAG
23-
NUM_BUILTIN_FRONTEND_DIAGNOSTICS
24-
};
25-
26-
#define DIAG_ENUM(ENUM_NAME) \
27-
namespace ENUM_NAME { \
28-
enum {
29-
#define DIAG_ENUM_ITEM(IDX, NAME) NAME = IDX,
30-
#define DIAG_ENUM_END() \
31-
} \
32-
; \
33-
}
34-
#include "clang/Basic/DiagnosticFrontendEnums.inc"
35-
#undef DIAG_ENUM_END
36-
#undef DIAG_ENUM_ITEM
37-
#undef DIAG_ENUM
38-
} // end namespace diag
39-
40-
namespace diag_compat {
41-
#define DIAG_COMPAT_IDS_BEGIN() enum {
42-
#define DIAG_COMPAT_IDS_END() \
43-
} \
44-
;
45-
#define DIAG_COMPAT_ID(IDX, NAME, ...) NAME = IDX,
46-
#include "clang/Basic/DiagnosticFrontendCompatIDs.inc"
47-
#undef DIAG_COMPAT_ID
48-
#undef DIAG_COMPAT_IDS_BEGIN
49-
#undef DIAG_COMPAT_IDS_END
50-
} // end namespace diag_compat
51-
} // end namespace clang
13+
#include "clang/Basic/DiagnosticFrontendInterface.inc"
5214

5315
#endif // LLVM_CLANG_BASIC_DIAGNOSTICFRONTEND_H

0 commit comments

Comments
 (0)