Skip to content

Commit bee1e45

Browse files
authored
Merge branch 'main' into constant_composite_replicates_conversion_pass
2 parents 14b70ce + afe8150 commit bee1e45

File tree

731 files changed

+26493
-36369
lines changed

Some content is hidden

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

731 files changed

+26493
-36369
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
/clang/www/cxx_dr_status.html @Endilll
3232
/clang/www/make_cxx_dr_status @Endilll
3333

34-
/clang/include/clang/CIR @lanza @bcardosolopes
35-
/clang/lib/CIR @lanza @bcardosolopes
36-
/clang/tools/cir-* @lanza @bcardosolopes
34+
/clang/include/clang/CIR @lanza @bcardosolopes @xlauko @andykaylor
35+
/clang/lib/CIR @lanza @bcardosolopes @xlauko @andykaylor
36+
/clang/tools/cir-* @lanza @bcardosolopes @xlauko @andykaylor
3737

3838
/lldb/ @JDevlieghere
3939

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
- 'main'
1111
paths:
1212
- 'clang/bindings/python/**'
13-
- 'clang/test/bindings/python/**'
1413
- 'clang/tools/libclang/**'
14+
- 'clang/CMakeList.txt'
1515
- '.github/workflows/libclang-python-tests.yml'
1616
- '.github/workflows/llvm-project-tests.yml'
1717
pull_request:
1818
paths:
1919
- 'clang/bindings/python/**'
20-
- 'clang/test/bindings/python/**'
2120
- 'clang/tools/libclang/**'
21+
- 'clang/CMakeList.txt'
2222
- '.github/workflows/libclang-python-tests.yml'
2323
- '.github/workflows/llvm-project-tests.yml'
2424

.github/workflows/premerge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: >-
7777
github.repository_owner == 'llvm' &&
7878
(github.event_name != 'pull_request' || github.event.action != 'closed')
79-
runs-on: llvm-premerge-windows-runners
79+
runs-on: llvm-premerge-windows-2022-runners
8080
defaults:
8181
run:
8282
shell: bash

clang-tools-extra/clangd/ModulesBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ bool IsModuleFileUpToDate(PathRef ModuleFilePath,
219219

220220
IntrusiveRefCntPtr<ModuleCache> ModCache = createCrossProcessModuleCache();
221221
PCHContainerOperations PCHOperations;
222+
CodeGenOptions CodeGenOpts;
222223
ASTReader Reader(PP, *ModCache, /*ASTContext=*/nullptr,
223-
PCHOperations.getRawReader(), {});
224+
PCHOperations.getRawReader(), CodeGenOpts, {});
224225

225226
// We don't need any listener here. By default it will use a validator
226227
// listener.

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
void foo(void) {}
2+
// CHECK-OK: trailing-comma.c:1:1: note: "root" binds here
3+
// CHECK-ERR-COMMA: Invalid token <,> found when looking for a value.
4+
5+
// RUN: clang-query -c "match \
6+
// RUN: functionDecl( \
7+
// RUN: hasName( \
8+
// RUN: \"foo\", \
9+
// RUN: ), \
10+
// RUN: ) \
11+
// RUN: " %s | FileCheck --check-prefix=CHECK-OK %s
12+
13+
// Same with \n tokens
14+
// RUN: echo "match functionDecl( hasName( \"foo\" , ) , )" | sed "s/ /\n/g" >%t
15+
// RUN: clang-query -f %t %s | FileCheck --check-prefix=CHECK-OK %s
16+
17+
// RUN: not clang-query -c "match functionDecl(hasName(\"foo\"),,)" %s \
18+
// RUN: | FileCheck --check-prefix=CHECK-ERR-COMMA %s
19+
20+
// RUN: not clang-query -c "match functionDecl(,)" %s \
21+
// RUN: | FileCheck --check-prefix=CHECK-ERR-COMMA %s

clang/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ if( CLANG_INCLUDE_TESTS )
536536
clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
537537
)
538538
add_subdirectory(test)
539+
add_subdirectory(bindings/python/tests)
539540

540541
if(CLANG_BUILT_STANDALONE)
541542
umbrella_lit_testsuite_end(check-all)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Test target to run Python test suite from main build.
2+
3+
# Avoid configurations including '-include' from interfering with
4+
# our tests by setting CLANG_NO_DEFAULT_CONFIG.
5+
add_custom_target(check-clang-python
6+
COMMAND ${CMAKE_COMMAND} -E env
7+
CLANG_NO_DEFAULT_CONFIG=1
8+
CLANG_LIBRARY_PATH=$<TARGET_FILE_DIR:libclang>
9+
"${Python3_EXECUTABLE}" -m unittest discover
10+
DEPENDS libclang
11+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
12+
13+
set(RUN_PYTHON_TESTS TRUE)
14+
set_target_properties(check-clang-python PROPERTIES FOLDER "Clang/Tests")
15+
16+
# Tests require libclang.so which is only built with LLVM_ENABLE_PIC=ON
17+
if(NOT LLVM_ENABLE_PIC)
18+
set(RUN_PYTHON_TESTS FALSE)
19+
endif()
20+
21+
# Do not try to run if libclang was built with sanitizers because
22+
# the sanitizer library will likely be loaded too late to perform
23+
# interception and will then fail.
24+
# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
25+
# portable so its easier just to not run the tests when building
26+
# with ASan.
27+
if(NOT LLVM_USE_SANITIZER STREQUAL "")
28+
set(RUN_PYTHON_TESTS FALSE)
29+
endif()
30+
31+
# Tests fail on Windows, and need someone knowledgeable to fix.
32+
# It's not clear whether it's a test or a valid binding problem.
33+
if(WIN32)
34+
set(RUN_PYTHON_TESTS FALSE)
35+
endif()
36+
37+
# The Python FFI interface is broken on AIX: https://bugs.python.org/issue38628.
38+
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
39+
set(RUN_PYTHON_TESTS FALSE)
40+
endif()
41+
42+
# AArch64, Hexagon, and Sparc have known test failures that need to be
43+
# addressed.
44+
# SystemZ has broken Python/FFI interface:
45+
# https://reviews.llvm.org/D52840#1265716
46+
if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|Sparc|SystemZ)$")
47+
set(RUN_PYTHON_TESTS FALSE)
48+
endif()
49+
50+
# Tests will fail if cross-compiling for a different target, as tests will try
51+
# to use the host Python3_EXECUTABLE and make FFI calls to functions in target
52+
# libraries.
53+
if(CMAKE_CROSSCOMPILING)
54+
# FIXME: Consider a solution that allows better control over these tests in
55+
# a crosscompiling scenario. e.g. registering them with lit to allow them to
56+
# be explicitly skipped via appropriate LIT_ARGS, or adding a mechanism to
57+
# allow specifying a python interpreter compiled for the target that could
58+
# be executed using qemu-user.
59+
message(WARNING "check-clang-python not added to check-all as these tests fail in a cross-build setup")
60+
set(RUN_PYTHON_TESTS FALSE)
61+
endif()
62+
63+
if(RUN_PYTHON_TESTS)
64+
set_property(GLOBAL APPEND PROPERTY
65+
LLVM_ALL_ADDITIONAL_TEST_TARGETS check-clang-python)
66+
endif()

0 commit comments

Comments
 (0)