Skip to content

Commit 5512633

Browse files
committed
Merge remote-tracking branch 'upstream/release/13.x' into ldc-release/13.x
2 parents 8d4879d + fc043d8 commit 5512633

File tree

191 files changed

+2476
-721
lines changed

Some content is hidden

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

191 files changed

+2476
-721
lines changed

.github/workflows/clang-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
- 'llvm/**'
1515
- '.github/workflows/clang-tests.yml'
1616

17+
concurrency:
18+
# Skip intermediate builds: always.
19+
# Cancel intermediate builds: only if it is a pull request build.
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
22+
1723
jobs:
1824
build_clang:
1925
name: clang check-all

.github/workflows/libclang-abi-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
- 'clang/**'
1313
- '.github/workflows/libclang-abi-tests.yml'
1414

15+
concurrency:
16+
# Skip intermediate builds: always.
17+
# Cancel intermediate builds: only if it is a pull request build.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
20+
21+
1522
jobs:
1623
abi-dump-setup:
1724
runs-on: ubuntu-latest

.github/workflows/libclc-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ on:
1616
- 'libclc/**'
1717
- '.github/workflows/libclc-tests.yml'
1818

19+
concurrency:
20+
# Skip intermediate builds: always.
21+
# Cancel intermediate builds: only if it is a pull request build.
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
24+
25+
1926
jobs:
2027
build_libclc:
2128
name: libclc test

.github/workflows/lld-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
- 'llvm/**'
1515
- '.github/workflows/lld-tests.yml'
1616

17+
concurrency:
18+
# Skip intermediate builds: always.
19+
# Cancel intermediate builds: only if it is a pull request build.
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
22+
1723
jobs:
1824
build_lld:
1925
name: lld check-all

.github/workflows/lldb-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ on:
1616
- 'lldb/**'
1717
- '.github/workflows/lldb-tests.yml'
1818

19+
concurrency:
20+
# Skip intermediate builds: always.
21+
# Cancel intermediate builds: only if it is a pull request build.
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
24+
25+
1926
jobs:
2027
build_lldb:
2128
name: lldb build
@@ -29,7 +36,7 @@ jobs:
2936
os:
3037
- ubuntu-latest
3138
- windows-latest
32-
- macOS-latest
39+
- macOS-10.15
3340
steps:
3441
- name: Setup Windows
3542
if: startsWith(matrix.os, 'windows')

.github/workflows/llvm-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
- 'llvm/**'
1313
- '.github/workflows/llvm-tests.yml'
1414

15+
concurrency:
16+
# Skip intermediate builds: always.
17+
# Cancel intermediate builds: only if it is a pull request build.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
20+
21+
1522
jobs:
1623
build_llvm:
1724
name: llvm check-all

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
====================================================
2-
Extra Clang Tools 13.0.0 (In-Progress) Release Notes
2+
Extra Clang Tools 13.0.0 Release Notes
33
====================================================
44

55
.. contents::
@@ -8,12 +8,6 @@ Extra Clang Tools 13.0.0 (In-Progress) Release Notes
88

99
Written by the `LLVM Team <https://llvm.org/>`_
1010

11-
.. warning::
12-
13-
These are in-progress notes for the upcoming Extra Clang Tools 13 release.
14-
Release notes for previous releases can be found on
15-
`the Download Page <https://releases.llvm.org/download.html>`_.
16-
1711
Introduction
1812
============
1913

@@ -47,7 +41,93 @@ Major New Features
4741
Improvements to clangd
4842
----------------------
4943

50-
The improvements are...
44+
Code Completion
45+
^^^^^^^^^^^^^^^
46+
47+
- ML based model is used by default for ranking completion candidates.
48+
49+
- Support for completion of attributes.
50+
51+
- Improved handling of Objective-C(++) constructs.
52+
53+
54+
Hover
55+
^^^^^
56+
57+
- Shows documentation for Attributes.
58+
59+
- Displays resolved paths for includes.
60+
61+
- Shows padding for fields.
62+
63+
Document Outline
64+
^^^^^^^^^^^^^^^^
65+
66+
- Contains information in detail field about extra type information
67+
68+
- Macro expansions now show up in the tree
69+
70+
- Improved handling of Objective-C(++) constructs.
71+
72+
Code Navigation
73+
^^^^^^^^^^^^^^^^
74+
75+
- Cross references surfaces occurrences for calls to overridden methods and
76+
declarations.
77+
78+
Semantic Highlighting
79+
^^^^^^^^^^^^^^^^^^^^^
80+
81+
- Support for legacy semantic tokens extension is dropped.
82+
83+
- Better support for Objective-C(++) constructs and dependent code.
84+
85+
86+
Diagnostics
87+
^^^^^^^^^^^
88+
89+
- Diagnostics for unused/deprecated code are tagged according to LSP.
90+
91+
- Clang-tidy checks that operate at translation-unit level are now available.
92+
93+
System Integration
94+
^^^^^^^^^^^^^^^^^^
95+
96+
- Compile flag parsing has been improved to be more resilient against multiple
97+
jobs.
98+
99+
- Better error reporting when compile flags are unusable.
100+
101+
102+
Miscellaneous
103+
^^^^^^^^^^^^^
104+
105+
- Better support for TUs with circular includes (e.g. templated header vs
106+
implementation file).
107+
108+
- Compile flags for headers are inferred from files known to be including them
109+
when possible.
110+
111+
- Version info contains information about compile-time setup of clangd
112+
113+
- FeatureModule mechanism has been introduced to make contribution of vertical
114+
features to clangd easier, by making it possible to write features that can
115+
interact with clangd-core without touching it.
116+
117+
- There's an extension for inlay-hints for deduced types and parameter names,
118+
hidden behind -inlay-hints flag.
119+
120+
- Rename is more robust:
121+
122+
- Won't trigger on non-identifiers.
123+
- Makes use of dirty buffers for open files.
124+
125+
- Improvements to dex query latency.
126+
127+
- There's a remote-index service for LLVM at http://clangd-index.llvm.org/.
128+
129+
- There's a remote-index service for Chromium at
130+
https://linux.clangd-index.chromium.org/.
51131

52132
Improvements to clang-doc
53133
-------------------------

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
========================================
2-
Clang 13.0.0 (In-Progress) Release Notes
2+
Clang 13.0.0 Release Notes
33
========================================
44

55
.. contents::
@@ -8,12 +8,6 @@ Clang 13.0.0 (In-Progress) Release Notes
88

99
Written by the `LLVM Team <https://llvm.org/>`_
1010

11-
.. warning::
12-
13-
These are in-progress notes for the upcoming Clang 13 release.
14-
Release notes for previous releases can be found on
15-
`the Download Page <https://releases.llvm.org/download.html>`_.
16-
1711
Introduction
1812
============
1913

clang/lib/Analysis/CFG.cpp

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ class CFGBuilder {
542542
// Visitors to walk an AST and construct the CFG.
543543
CFGBlock *VisitInitListExpr(InitListExpr *ILE, AddStmtChoice asc);
544544
CFGBlock *VisitAddrLabelExpr(AddrLabelExpr *A, AddStmtChoice asc);
545+
CFGBlock *VisitAttributedStmt(AttributedStmt *A, AddStmtChoice asc);
545546
CFGBlock *VisitBinaryOperator(BinaryOperator *B, AddStmtChoice asc);
546547
CFGBlock *VisitBreakStmt(BreakStmt *B);
547548
CFGBlock *VisitCallExpr(CallExpr *C, AddStmtChoice asc);
@@ -2149,6 +2150,9 @@ CFGBlock *CFGBuilder::Visit(Stmt * S, AddStmtChoice asc,
21492150
case Stmt::InitListExprClass:
21502151
return VisitInitListExpr(cast<InitListExpr>(S), asc);
21512152

2153+
case Stmt::AttributedStmtClass:
2154+
return VisitAttributedStmt(cast<AttributedStmt>(S), asc);
2155+
21522156
case Stmt::AddrLabelExprClass:
21532157
return VisitAddrLabelExpr(cast<AddrLabelExpr>(S), asc);
21542158

@@ -2398,8 +2402,32 @@ CFGBlock *CFGBuilder::VisitAddrLabelExpr(AddrLabelExpr *A,
23982402
return Block;
23992403
}
24002404

2401-
CFGBlock *CFGBuilder::VisitUnaryOperator(UnaryOperator *U,
2402-
AddStmtChoice asc) {
2405+
static bool isFallthroughStatement(const AttributedStmt *A) {
2406+
bool isFallthrough = hasSpecificAttr<FallThroughAttr>(A->getAttrs());
2407+
assert((!isFallthrough || isa<NullStmt>(A->getSubStmt())) &&
2408+
"expected fallthrough not to have children");
2409+
return isFallthrough;
2410+
}
2411+
2412+
CFGBlock *CFGBuilder::VisitAttributedStmt(AttributedStmt *A,
2413+
AddStmtChoice asc) {
2414+
// AttributedStmts for [[likely]] can have arbitrary statements as children,
2415+
// and the current visitation order here would add the AttributedStmts
2416+
// for [[likely]] after the child nodes, which is undesirable: For example,
2417+
// if the child contains an unconditional return, the [[likely]] would be
2418+
// considered unreachable.
2419+
// So only add the AttributedStmt for FallThrough, which has CFG effects and
2420+
// also no children, and omit the others. None of the other current StmtAttrs
2421+
// have semantic meaning for the CFG.
2422+
if (isFallthroughStatement(A) && asc.alwaysAdd(*this, A)) {
2423+
autoCreateBlock();
2424+
appendStmt(Block, A);
2425+
}
2426+
2427+
return VisitChildren(A);
2428+
}
2429+
2430+
CFGBlock *CFGBuilder::VisitUnaryOperator(UnaryOperator *U, AddStmtChoice asc) {
24032431
if (asc.alwaysAdd(*this, U)) {
24042432
autoCreateBlock();
24052433
appendStmt(Block, U);
@@ -3333,7 +3361,7 @@ CFGBlock *CFGBuilder::VisitGCCAsmStmt(GCCAsmStmt *G, AddStmtChoice asc) {
33333361
// Save "Succ" in BackpatchBlocks. In the backpatch processing, "Succ" is
33343362
// used to avoid adding "Succ" again.
33353363
BackpatchBlocks.push_back(JumpSource(Succ, ScopePos));
3336-
return Block;
3364+
return VisitChildren(G);
33373365
}
33383366

33393367
CFGBlock *CFGBuilder::VisitForStmt(ForStmt *F) {

clang/lib/Analysis/UninitializedValues.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,8 @@ class TransferFunctions : public StmtVisitor<TransferFunctions> {
591591

592592
if (AtPredExit == MayUninitialized) {
593593
// If the predecessor's terminator is an "asm goto" that initializes
594-
// the variable, then it won't be counted as "initialized" on the
595-
// non-fallthrough paths.
594+
// the variable, then don't count it as "initialized" on the indirect
595+
// paths.
596596
CFGTerminator term = Pred->getTerminator();
597597
if (const auto *as = dyn_cast_or_null<GCCAsmStmt>(term.getStmt())) {
598598
const CFGBlock *fallthrough = *Pred->succ_begin();
@@ -810,13 +810,21 @@ void TransferFunctions::VisitGCCAsmStmt(GCCAsmStmt *as) {
810810
if (!as->isAsmGoto())
811811
return;
812812

813-
for (const Expr *o : as->outputs())
814-
if (const VarDecl *VD = findVar(o).getDecl())
815-
if (vals[VD] != Initialized)
816-
// If the variable isn't initialized by the time we get here, then we
817-
// mark it as potentially uninitialized for those cases where it's used
818-
// on an indirect path, where it's not guaranteed to be defined.
819-
vals[VD] = MayUninitialized;
813+
ASTContext &C = ac.getASTContext();
814+
for (const Expr *O : as->outputs()) {
815+
const Expr *Ex = stripCasts(C, O);
816+
817+
// Strip away any unary operators. Invalid l-values are reported by other
818+
// semantic analysis passes.
819+
while (const auto *UO = dyn_cast<UnaryOperator>(Ex))
820+
Ex = stripCasts(C, UO->getSubExpr());
821+
822+
// Mark the variable as potentially uninitialized for those cases where
823+
// it's used on an indirect path, where it's not guaranteed to be
824+
// defined.
825+
if (const VarDecl *VD = findVar(Ex).getDecl())
826+
vals[VD] = MayUninitialized;
827+
}
820828
}
821829

822830
void TransferFunctions::VisitObjCMessageExpr(ObjCMessageExpr *ME) {

0 commit comments

Comments
 (0)