Skip to content

Commit aa09a1a

Browse files
committed
Merge release/21.x into cheriot
2 parents 022a7a5 + 222fc11 commit aa09a1a

File tree

63 files changed

+1000
-506
lines changed

Some content is hidden

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

63 files changed

+1000
-506
lines changed

.github/workflows/release-asset-audit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def _get_uploaders(release_version):
5454
"tru",
5555
"tstellar",
5656
"github-actions[bot]",
57+
"c-rhodes",
58+
"dyung",
5759
]
5860
)
5961

.github/workflows/release-binaries-save-stage/action.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release-binaries-setup-stage/action.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/release-binaries.yml

Lines changed: 21 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -194,40 +194,30 @@ jobs:
194194
runs-on: ${{ needs.prepare.outputs.build-runs-on }}
195195
steps:
196196

197-
- name: Checkout Actions
198-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
199-
with:
200-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
201-
sparse-checkout: |
202-
.github/workflows/
203-
sparse-checkout-cone-mode: false
204-
# Check out outside of working directory so the source checkout doesn't
205-
# remove it.
206-
path: workflows
207-
208-
# actions/checkout does not support paths outside of the GITHUB_WORKSPACE.
209-
# Also, anything that we put inside of GITHUB_WORKSPACE will be overwritten
210-
# by future actions/checkout steps. Therefore, in order to checkout the
211-
# latest actions from main, we need to first checkout out the actions inside of
212-
# GITHUB_WORKSPACE (see previous step), then use actions/checkout to checkout
213-
# the code being built and the move the actions from main back into GITHUB_WORKSPACE,
214-
# becasue the uses on composite actions only reads workflows from inside GITHUB_WORKSPACE.
215-
- shell: bash
216-
run: mv workflows ../workflows-main
217-
218197
- name: Checkout LLVM
219198
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
220199
with:
221200
ref: ${{ needs.prepare.outputs.ref }}
222201

223-
- name: Copy main workflows
224-
shell: bash
225-
run: |
226-
mv ../workflows-main .
202+
- name: Install Ninja
203+
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main
204+
205+
- name: Setup Windows
206+
if: startsWith(runner.os, 'Windows')
207+
uses: llvm/actions/setup-windows@main
208+
with:
209+
arch: amd64
227210

228-
- name: Setup Stage
211+
- name: Set Build Prefix
229212
id: setup-stage
230-
uses: ./workflows-main/.github/workflows/release-binaries-setup-stage
213+
shell: bash
214+
run: |
215+
build_prefix=`pwd`
216+
if [ "${{ runner.os }}" = "Linux" ]; then
217+
sudo chown $USER:$USER /mnt/
218+
build_prefix=/mnt/
219+
fi
220+
echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
231221
232222
- name: Configure
233223
id: build
@@ -258,17 +248,11 @@ jobs:
258248
path: |
259249
${{ needs.prepare.outputs.release-binary-filename }}
260250
261-
# Clean up some build files to reduce size of artifact.
262-
- name: Clean Up Build Directory
263-
shell: bash
251+
- name: Run Tests
252+
# These almost always fail so don't let them fail the build and prevent the uploads.
253+
continue-on-error: true
264254
run: |
265-
find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete
266-
find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname _CPack_Packages -prune -exec rm -r {} +
267-
268-
- name: Save Stage
269-
uses: ./workflows-main/.github/workflows/release-binaries-save-stage
270-
with:
271-
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
255+
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all
272256
273257
upload-release-binaries:
274258
name: "Upload Release Binaries"
@@ -327,31 +311,3 @@ jobs:
327311
--release ${{ needs.prepare.outputs.release-version }} \
328312
upload \
329313
--files ${{ needs.prepare.outputs.release-binary-filename }}*
330-
331-
test-release:
332-
name: "Test Release"
333-
needs:
334-
- prepare
335-
- build-release-package
336-
if: >-
337-
github.repository_owner == 'llvm'
338-
runs-on: ${{ needs.prepare.outputs.test-runs-on }}
339-
steps:
340-
- name: Checkout Actions
341-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
342-
with:
343-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
344-
sparse-checkout: |
345-
.github/workflows/
346-
sparse-checkout-cone-mode: false
347-
path: workflows
348-
- name: Setup Stage
349-
id: setup-stage
350-
uses: ./workflows/.github/workflows/release-binaries-setup-stage
351-
with:
352-
previous-artifact: build-release-package
353-
354-
- name: Run Tests
355-
shell: bash
356-
run: |
357-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ CodeAction toCodeAction(const ClangdServer::CodeActionResult::Rename &R,
8181
const URIForFile &File) {
8282
CodeAction CA;
8383
CA.title = R.FixMessage;
84-
CA.kind = std::string(CodeAction::REFACTOR_KIND);
84+
CA.kind = std::string(CodeAction::QUICKFIX_KIND);
8585
CA.command.emplace();
8686
CA.command->title = R.FixMessage;
8787
CA.command->command = std::string(ApplyRenameCommand);

clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ TEST_F(LSPTest, ClangTidyRename) {
235235
.takeValue()
236236
.getAsArray())[0];
237237

238-
ASSERT_EQ((*RenameCommand.getAsObject())["title"], "change 'foo' to 'Foo'");
238+
ASSERT_EQ((*RenameCommand.getAsObject())["title"],
239+
"Apply fix: change 'foo' to 'Foo'");
239240

240241
Client.expectServerCall("workspace/applyEdit");
241242
Client.call("workspace/executeCommand", RenameCommand);

clang/bindings/python/clang/cindex.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,6 +3853,8 @@ def cursor(self):
38533853
cursor._tu = self._tu
38543854

38553855
conf.lib.clang_annotateTokens(self._tu, byref(self), 1, byref(cursor))
3856+
if cursor.is_null():
3857+
return None
38563858

38573859
return cursor
38583860

clang/bindings/python/tests/cindex/test_tokens.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,9 @@ def test_token_extent(self):
5353

5454
self.assertEqual(extent.start.offset, 4)
5555
self.assertEqual(extent.end.offset, 7)
56+
57+
def test_null_cursor(self):
58+
"""Ensure that the cursor property converts null cursors to None"""
59+
tu = get_tu("int i = 5;")
60+
tokens = list(tu.get_tokens(extent=tu.cursor.extent))
61+
self.assertEqual(tokens[-1].cursor, None)

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Clang Frontend Potentially Breaking Changes
9494

9595
Clang Python Bindings Potentially Breaking Changes
9696
--------------------------------------------------
97+
- Return ``None`` instead of null cursors from ``Token.cursor``
9798
- ``Cursor.from_location`` now returns ``None`` instead of a null cursor.
9899
This eliminates the last known source of null cursors.
99100
- Almost all ``Cursor`` methods now assert that they are called on non-null cursors.

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ def MissingFieldInitializers : DiagGroup<"missing-field-initializers",
654654
def ModuleLock : DiagGroup<"module-lock">;
655655
def ModuleBuild : DiagGroup<"module-build">;
656656
def ModuleImport : DiagGroup<"module-import">;
657+
def ModuleValidation : DiagGroup<"module-validation">;
657658
def ModuleConflict : DiagGroup<"module-conflict">;
658659
def ModuleFileExtension : DiagGroup<"module-file-extension">;
659660
def ModuleIncludeDirectiveTranslation : DiagGroup<"module-include-translation">;

0 commit comments

Comments
 (0)