Skip to content

Commit 8ed7fd9

Browse files
committed
merge main into amd-stg-open
Revert "[OpenMP] Patch for Support to loop bind clause : Chec Change-Id: I0c723e6c273a568f6116123cd04e5d14a67081a8
2 parents 0452834 + 15254eb commit 8ed7fd9

File tree

299 files changed

+9516
-2937
lines changed

Some content is hidden

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

299 files changed

+9516
-2937
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
if: steps.docs-changed-subprojects.outputs.libc_any_changed == 'true'
120120
run: |
121121
cmake -B libc-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc" -DLLVM_ENABLE_SPHINX=ON ./runtimes
122-
TZ=UTC ninja -C docs-libc-html
122+
TZ=UTC ninja -C libc-build docs-libc-html
123123
- name: Build LLD docs
124124
if: steps.docs-changed-subprojects.outputs.lld_any_changed == 'true'
125125
run: |

clang/docs/HowToSetupToolingForLLVM.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Examples:
172172
clang::ASTConsumer *newASTConsumer() (CompoundStmt 0x44da290 </home/alexfh/local/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:64:40, line:72:3>
173173
(IfStmt 0x44d97c8 <line:65:5, line:66:45>
174174
<<<NULL>>>
175-
(ImplicitCastExpr 0x44d96d0 <line:65:9> '_Bool':'_Bool' <UserDefinedConversion>
175+
(ImplicitCastExpr 0x44d96d0 <line:65:9> '_Bool' <UserDefinedConversion>
176176
...
177177
$ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-print -ast-dump-filter ActionFactory::newASTConsumer
178178
Processing: tools/clang/tools/clang-check/ClangCheck.cpp.

clang/docs/ReleaseNotes.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,28 @@ ABI Changes in This Version
113113
- Following the SystemV ABI for x86-64, ``__int128`` arguments will no longer
114114
be split between a register and a stack slot.
115115

116+
AST Dumping Potentially Breaking Changes
117+
----------------------------------------
118+
- When dumping a sugared type, Clang will no longer print the desugared type if
119+
its textual representation is the same as the sugared one. This applies to
120+
both text dumps of the form ``'foo':'foo'`` which will now be dumped as just
121+
``'foo'``, and JSON dumps of the form:
122+
123+
.. code-block:: json
124+
125+
"type": {
126+
"qualType": "foo",
127+
"desugaredQualType": "foo"
128+
}
129+
130+
which will now be dumped as just:
131+
132+
.. code-block:: json
133+
134+
"type": {
135+
"qualType": "foo"
136+
}
137+
116138
What's New in Clang |release|?
117139
==============================
118140
Some of the major new features and improvements to Clang are listed
@@ -694,6 +716,10 @@ Bug Fixes to C++ Support
694716
(`#46200 <https://github.com/llvm/llvm-project/issues/46200>`_)
695717
(`#57812 <https://github.com/llvm/llvm-project/issues/57812>`_)
696718

719+
- Diagnose use of a variable-length array in a coroutine. The design of
720+
coroutines is such that it is not possible to support VLA use. Fixes:
721+
(`#65858 <https://github.com/llvm/llvm-project/issues/65858>`_)
722+
697723
- Fix bug where we were overriding zero-initialization of class members when
698724
default initializing a base class in a constant expression context. Fixes:
699725
(`#69890 <https://github.com/llvm/llvm-project/issues/69890>`_)

clang/include/clang/AST/DeclBase.h

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,16 +1515,14 @@ class DeclContext {
15151515
uint64_t IsThisDeclarationADemotedDefinition : 1;
15161516
};
15171517

1518-
/// Number of non-inherited bits in TagDeclBitfields.
1519-
enum { NumTagDeclBits = 10 };
1518+
/// Number of inherited and non-inherited bits in TagDeclBitfields.
1519+
enum { NumTagDeclBits = NumDeclContextBits + 10 };
15201520

15211521
/// Stores the bits used by EnumDecl.
15221522
/// If modified NumEnumDeclBit and the accessor
15231523
/// methods in EnumDecl should be updated appropriately.
15241524
class EnumDeclBitfields {
15251525
friend class EnumDecl;
1526-
/// For the bits in DeclContextBitfields.
1527-
uint64_t : NumDeclContextBits;
15281526
/// For the bits in TagDeclBitfields.
15291527
uint64_t : NumTagDeclBits;
15301528

@@ -1554,16 +1552,14 @@ class DeclContext {
15541552
uint64_t HasODRHash : 1;
15551553
};
15561554

1557-
/// Number of non-inherited bits in EnumDeclBitfields.
1558-
enum { NumEnumDeclBits = 20 };
1555+
/// Number of inherited and non-inherited bits in EnumDeclBitfields.
1556+
enum { NumEnumDeclBits = NumTagDeclBits + 20 };
15591557

15601558
/// Stores the bits used by RecordDecl.
15611559
/// If modified NumRecordDeclBits and the accessor
15621560
/// methods in RecordDecl should be updated appropriately.
15631561
class RecordDeclBitfields {
15641562
friend class RecordDecl;
1565-
/// For the bits in DeclContextBitfields.
1566-
uint64_t : NumDeclContextBits;
15671563
/// For the bits in TagDeclBitfields.
15681564
uint64_t : NumTagDeclBits;
15691565

@@ -1615,8 +1611,8 @@ class DeclContext {
16151611
uint64_t ODRHash : 26;
16161612
};
16171613

1618-
/// Number of non-inherited bits in RecordDeclBitfields.
1619-
enum { NumRecordDeclBits = 41 };
1614+
/// Number of inherited and non-inherited bits in RecordDeclBitfields.
1615+
enum { NumRecordDeclBits = NumTagDeclBits + 41 };
16201616

16211617
/// Stores the bits used by OMPDeclareReductionDecl.
16221618
/// If modified NumOMPDeclareReductionDeclBits and the accessor
@@ -1631,8 +1627,9 @@ class DeclContext {
16311627
uint64_t InitializerKind : 2;
16321628
};
16331629

1634-
/// Number of non-inherited bits in OMPDeclareReductionDeclBitfields.
1635-
enum { NumOMPDeclareReductionDeclBits = 2 };
1630+
/// Number of inherited and non-inherited bits in
1631+
/// OMPDeclareReductionDeclBitfields.
1632+
enum { NumOMPDeclareReductionDeclBits = NumDeclContextBits + 2 };
16361633

16371634
/// Stores the bits used by FunctionDecl.
16381635
/// If modified NumFunctionDeclBits and the accessor
@@ -1711,16 +1708,14 @@ class DeclContext {
17111708
uint64_t FriendConstraintRefersToEnclosingTemplate : 1;
17121709
};
17131710

1714-
/// Number of non-inherited bits in FunctionDeclBitfields.
1715-
enum { NumFunctionDeclBits = 31 };
1711+
/// Number of inherited and non-inherited bits in FunctionDeclBitfields.
1712+
enum { NumFunctionDeclBits = NumDeclContextBits + 31 };
17161713

17171714
/// Stores the bits used by CXXConstructorDecl. If modified
17181715
/// NumCXXConstructorDeclBits and the accessor
17191716
/// methods in CXXConstructorDecl should be updated appropriately.
17201717
class CXXConstructorDeclBitfields {
17211718
friend class CXXConstructorDecl;
1722-
/// For the bits in DeclContextBitfields.
1723-
uint64_t : NumDeclContextBits;
17241719
/// For the bits in FunctionDeclBitfields.
17251720
uint64_t : NumFunctionDeclBits;
17261721

@@ -1739,10 +1734,8 @@ class DeclContext {
17391734
uint64_t IsSimpleExplicit : 1;
17401735
};
17411736

1742-
/// Number of non-inherited bits in CXXConstructorDeclBitfields.
1743-
enum {
1744-
NumCXXConstructorDeclBits = 64 - NumDeclContextBits - NumFunctionDeclBits
1745-
};
1737+
/// Number of inherited and non-inherited bits in CXXConstructorDeclBitfields.
1738+
enum { NumCXXConstructorDeclBits = NumFunctionDeclBits + 20 };
17461739

17471740
/// Stores the bits used by ObjCMethodDecl.
17481741
/// If modified NumObjCMethodDeclBits and the accessor
@@ -1803,8 +1796,8 @@ class DeclContext {
18031796
uint64_t HasSkippedBody : 1;
18041797
};
18051798

1806-
/// Number of non-inherited bits in ObjCMethodDeclBitfields.
1807-
enum { NumObjCMethodDeclBits = 24 };
1799+
/// Number of inherited and non-inherited bits in ObjCMethodDeclBitfields.
1800+
enum { NumObjCMethodDeclBits = NumDeclContextBits + 24 };
18081801

18091802
/// Stores the bits used by ObjCContainerDecl.
18101803
/// If modified NumObjCContainerDeclBits and the accessor
@@ -1819,10 +1812,10 @@ class DeclContext {
18191812
SourceLocation AtStart;
18201813
};
18211814

1822-
/// Number of non-inherited bits in ObjCContainerDeclBitfields.
1815+
/// Number of inherited and non-inherited bits in ObjCContainerDeclBitfields.
18231816
/// Note that here we rely on the fact that SourceLocation is 32 bits
18241817
/// wide. We check this with the static_assert in the ctor of DeclContext.
1825-
enum { NumObjCContainerDeclBits = 64 - NumDeclContextBits };
1818+
enum { NumObjCContainerDeclBits = 64 };
18261819

18271820
/// Stores the bits used by LinkageSpecDecl.
18281821
/// If modified NumLinkageSpecDeclBits and the accessor
@@ -1843,8 +1836,8 @@ class DeclContext {
18431836
uint64_t HasBraces : 1;
18441837
};
18451838

1846-
/// Number of non-inherited bits in LinkageSpecDeclBitfields.
1847-
enum { NumLinkageSpecDeclBits = 4 };
1839+
/// Number of inherited and non-inherited bits in LinkageSpecDeclBitfields.
1840+
enum { NumLinkageSpecDeclBits = NumDeclContextBits + 4 };
18481841

18491842
/// Stores the bits used by BlockDecl.
18501843
/// If modified NumBlockDeclBits and the accessor
@@ -1869,8 +1862,8 @@ class DeclContext {
18691862
uint64_t CanAvoidCopyToHeap : 1;
18701863
};
18711864

1872-
/// Number of non-inherited bits in BlockDeclBitfields.
1873-
enum { NumBlockDeclBits = 5 };
1865+
/// Number of inherited and non-inherited bits in BlockDeclBitfields.
1866+
enum { NumBlockDeclBits = NumDeclContextBits + 5 };
18741867

18751868
/// Pointer to the data structure used to lookup declarations
18761869
/// within this context (or a DependentStoredDeclsMap if this is a

clang/include/clang/AST/Type.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,11 +1663,12 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
16631663
/// Actually an ArrayType::ArraySizeModifier.
16641664
unsigned SizeModifier : 3;
16651665
};
1666+
enum { NumArrayTypeBits = NumTypeBits + 6 };
16661667

16671668
class ConstantArrayTypeBitfields {
16681669
friend class ConstantArrayType;
16691670

1670-
unsigned : NumTypeBits + 3 + 3;
1671+
unsigned : NumArrayTypeBits;
16711672

16721673
/// Whether we have a stored size expression.
16731674
unsigned HasStoredSizeExpr : 1;
@@ -1780,7 +1781,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
17801781
unsigned Keyword : 8;
17811782
};
17821783

1783-
enum { NumTypeWithKeywordBits = 8 };
1784+
enum { NumTypeWithKeywordBits = NumTypeBits + 8 };
17841785

17851786
class ElaboratedTypeBitfields {
17861787
friend class ElaboratedType;
@@ -1913,7 +1914,6 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
19131914
class DependentTemplateSpecializationTypeBitfields {
19141915
friend class DependentTemplateSpecializationType;
19151916

1916-
unsigned : NumTypeBits;
19171917
unsigned : NumTypeWithKeywordBits;
19181918

19191919
/// The number of template arguments named in this class template

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ def ext_vla_folded_to_constant : ExtWarn<
166166
InGroup<GNUFoldingConstant>;
167167
def err_vla_unsupported : Error<
168168
"variable length arrays are not supported for %select{the current target|'%1'}0">;
169+
def err_vla_in_coroutine_unsupported : Error<
170+
"variable length arrays in a coroutine are not supported">;
169171
def note_vla_unsupported : Note<
170172
"variable length arrays are not supported for the current target">;
171173

clang/include/clang/Lex/Preprocessor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,9 +2879,9 @@ class Preprocessor {
28792879
/// Alter the state of whether this PP currently is in a
28802880
/// "-Wunsafe-buffer-usage" opt-out region.
28812881
///
2882-
/// \param isEnter: true if this PP is entering a region; otherwise, this PP
2882+
/// \param isEnter true if this PP is entering a region; otherwise, this PP
28832883
/// is exiting a region
2884-
/// \param Loc: the location of the entry or exit of a
2884+
/// \param Loc the location of the entry or exit of a
28852885
/// region
28862886
/// \return true iff it is INVALID to enter or exit a region, i.e.,
28872887
/// attempt to enter a region before exiting a previous region, or exiting a
@@ -2893,7 +2893,7 @@ class Preprocessor {
28932893
/// opt-out region
28942894
bool isPPInSafeBufferOptOutRegion();
28952895

2896-
/// \param StartLoc: output argument. It will be set to the start location of
2896+
/// \param StartLoc output argument. It will be set to the start location of
28972897
/// the current "-Wunsafe-buffer-usage" opt-out region iff this function
28982898
/// returns true.
28992899
/// \return true iff this PP is currently in a "-Wunsafe-buffer-usage"

clang/include/clang/Sema/ScopeInfo.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ class FunctionScopeInfo {
189189
/// First SEH '__try' statement in the current function.
190190
SourceLocation FirstSEHTryLoc;
191191

192+
/// First use of a VLA within the current function.
193+
SourceLocation FirstVLALoc;
194+
192195
private:
193196
/// Used to determine if errors occurred in this function or block.
194197
DiagnosticErrorTrap ErrorTrap;
@@ -473,6 +476,11 @@ class FunctionScopeInfo {
473476
FirstSEHTryLoc = TryLoc;
474477
}
475478

479+
void setHasVLA(SourceLocation VLALoc) {
480+
if (FirstVLALoc.isInvalid())
481+
FirstVLALoc = VLALoc;
482+
}
483+
476484
bool NeedsScopeChecking() const {
477485
return !HasDroppedStmt && (HasIndirectGoto || HasMustTail ||
478486
(HasBranchProtectedScope && HasBranchIntoScope));

0 commit comments

Comments
 (0)