Skip to content

Commit c6ed4c0

Browse files
authored
merge main into amd-staging (llvm#1870)
2 parents 32586a1 + e29da48 commit c6ed4c0

File tree

126 files changed

+4016
-1882
lines changed

Some content is hidden

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

126 files changed

+4016
-1882
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ Bug Fixes in This Version
486486
- Fixed a crash when ``#embed`` appears as a part of a failed constant
487487
evaluation. The crashes were happening during diagnostics emission due to
488488
unimplemented statement printer. (#GH132641)
489+
- Fixed visibility calculation for template functions. (#GH103477)
489490

490491
Bug Fixes to Compiler Builtins
491492
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/OperationKinds.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ CAST_OPERATION(ArrayToPointerDecay)
119119
CAST_OPERATION(FunctionToPointerDecay)
120120

121121
/// CK_NullToPointer - Null pointer constant to pointer, ObjC
122-
/// pointer, or block pointer.
122+
/// pointer, or block pointer. The result of this conversion can
123+
/// still be a null pointer constant if it has type std::nullptr_t.
123124
/// (void*) 0
124125
/// void (^block)() = 0;
125126
CAST_OPERATION(NullToPointer)

clang/include/clang/Sema/Sema.h

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,41 @@ enum class PragmaClangSectionKind {
475475

476476
enum class PragmaClangSectionAction { Set = 0, Clear = 1 };
477477

478+
enum class PragmaOptionsAlignKind {
479+
Native, // #pragma options align=native
480+
Natural, // #pragma options align=natural
481+
Packed, // #pragma options align=packed
482+
Power, // #pragma options align=power
483+
Mac68k, // #pragma options align=mac68k
484+
Reset // #pragma options align=reset
485+
};
486+
487+
enum class TUFragmentKind {
488+
/// The global module fragment, between 'module;' and a module-declaration.
489+
Global,
490+
/// A normal translation unit fragment. For a non-module unit, this is the
491+
/// entire translation unit. Otherwise, it runs from the module-declaration
492+
/// to the private-module-fragment (if any) or the end of the TU (if not).
493+
Normal,
494+
/// The private module fragment, between 'module :private;' and the end of
495+
/// the translation unit.
496+
Private
497+
};
498+
499+
enum class FormatStringType {
500+
Scanf,
501+
Printf,
502+
NSString,
503+
Strftime,
504+
Strfmon,
505+
Kprintf,
506+
FreeBSDKPrintf,
507+
OSTrace,
508+
OSLog,
509+
Syslog,
510+
Unknown
511+
};
512+
478513
/// Sema - This implements semantic analysis and AST building for C.
479514
/// \nosubgrouping
480515
class Sema final : public SemaBase {
@@ -626,18 +661,6 @@ class Sema final : public SemaBase {
626661
// Emit all deferred diagnostics.
627662
void emitDeferredDiags();
628663

629-
enum TUFragmentKind {
630-
/// The global module fragment, between 'module;' and a module-declaration.
631-
Global,
632-
/// A normal translation unit fragment. For a non-module unit, this is the
633-
/// entire translation unit. Otherwise, it runs from the module-declaration
634-
/// to the private-module-fragment (if any) or the end of the TU (if not).
635-
Normal,
636-
/// The private module fragment, between 'module :private;' and the end of
637-
/// the translation unit.
638-
Private
639-
};
640-
641664
/// This is called before the very first declaration in the translation unit
642665
/// is parsed. Note that the ASTContext may have already injected some
643666
/// declarations.
@@ -1783,15 +1806,6 @@ class Sema final : public SemaBase {
17831806
/// Add _Nullable attributes for std:: types.
17841807
void inferNullableClassAttribute(CXXRecordDecl *CRD);
17851808

1786-
enum PragmaOptionsAlignKind {
1787-
POAK_Native, // #pragma options align=native
1788-
POAK_Natural, // #pragma options align=natural
1789-
POAK_Packed, // #pragma options align=packed
1790-
POAK_Power, // #pragma options align=power
1791-
POAK_Mac68k, // #pragma options align=mac68k
1792-
POAK_Reset // #pragma options align=reset
1793-
};
1794-
17951809
/// ActOnPragmaClangSection - Called on well formed \#pragma clang section
17961810
void ActOnPragmaClangSection(SourceLocation PragmaLoc,
17971811
PragmaClangSectionAction Action,
@@ -2251,19 +2265,6 @@ class Sema final : public SemaBase {
22512265
SourceLocation BuiltinLoc,
22522266
SourceLocation RParenLoc);
22532267

2254-
enum FormatStringType {
2255-
FST_Scanf,
2256-
FST_Printf,
2257-
FST_NSString,
2258-
FST_Strftime,
2259-
FST_Strfmon,
2260-
FST_Kprintf,
2261-
FST_FreeBSDKPrintf,
2262-
FST_OSTrace,
2263-
FST_OSLog,
2264-
FST_Syslog,
2265-
FST_Unknown
2266-
};
22672268
static StringRef GetFormatStringTypeName(FormatStringType FST);
22682269
static FormatStringType GetFormatStringType(StringRef FormatFlavor);
22692270
static FormatStringType GetFormatStringType(const FormatAttr *Format);

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ bool CheckBCPResult(InterpState &S, const Pointer &Ptr) {
321321
if (Ptr.isTypeidPointer())
322322
return true;
323323

324+
if (Ptr.getType()->isAnyComplexType())
325+
return true;
326+
324327
if (const Expr *Base = Ptr.getDeclDesc()->asExpr())
325-
return isa<StringLiteral>(Base);
328+
return isa<StringLiteral>(Base) && Ptr.getIndex() == 0;
326329
return false;
327330
}
328331

0 commit comments

Comments
 (0)