Skip to content

Commit 809c9fa

Browse files
authored
merge main into amd-staging (llvm#1304)
2 parents f62d730 + b11f2c8 commit 809c9fa

File tree

169 files changed

+20047
-21535
lines changed

Some content is hidden

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

169 files changed

+20047
-21535
lines changed

.ci/monolithic-linux.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,6 @@ if [[ "${runtimes}" != "" ]]; then
9090
INSTALL_DIR="${BUILD_DIR}/install"
9191
mkdir -p ${RUNTIMES_BUILD_DIR}
9292

93-
echo "--- cmake runtimes C++03"
94-
95-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
96-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
97-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
98-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
99-
-D LIBCXX_CXX_ABI=libcxxabi \
100-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
101-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
102-
-D LIBCXX_TEST_PARAMS="std=c++03" \
103-
-D LIBCXXABI_TEST_PARAMS="std=c++03" \
104-
-D LLVM_LIT_ARGS="${lit_args}"
105-
106-
echo "--- ninja runtimes C++03"
107-
108-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
109-
11093
echo "--- cmake runtimes C++26"
11194

11295
rm -rf "${RUNTIMES_BUILD_DIR}"
@@ -140,6 +123,6 @@ if [[ "${runtimes}" != "" ]]; then
140123
-D LLVM_LIT_ARGS="${lit_args}"
141124

142125
echo "--- ninja runtimes clang modules"
143-
126+
144127
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
145128
fi

.github/workflows/issue-write.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: 'Comment on PR'
4141
if: steps.download-artifact.outputs.artifact-id != ''
42-
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3.2.0
42+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
4343
with:
4444
github-token: ${{ secrets.GITHUB_TOKEN }}
4545
script: |
@@ -49,7 +49,7 @@ jobs:
4949
return;
5050
}
5151
52-
let runInfo = await github.actions.getWorkflowRun({
52+
let runInfo = await github.rest.actions.getWorkflowRun({
5353
owner: context.repo.owner,
5454
repo: context.repo.repo,
5555
run_id: context.payload.workflow_run.id
@@ -122,7 +122,7 @@ jobs:
122122
// Security check: Ensure that this comment was created by
123123
// the github-actions bot, so a malicious input won't overwrite
124124
// a user's comment.
125-
github.issues.getComment({
125+
github.rest.issues.getComment({
126126
owner: context.repo.owner,
127127
repo: context.repo.repo,
128128
comment_id: comment.id
@@ -132,7 +132,7 @@ jobs:
132132
console.log("Invalid comment id: " + comment.id);
133133
return;
134134
}
135-
github.issues.updateComment({
135+
github.rest.issues.updateComment({
136136
owner: context.repo.owner,
137137
repo: context.repo.repo,
138138
issue_number: pr_number,
@@ -141,7 +141,7 @@ jobs:
141141
});
142142
});
143143
} else {
144-
github.issues.createComment({
144+
github.rest.issues.createComment({
145145
owner: context.repo.owner,
146146
repo: context.repo.repo,
147147
issue_number: pr_number,

clang-tools-extra/clang-doc/Representation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ struct ClangDocContext {
521521
// Path of CSS stylesheets that will be copied to OutDirectory and used to
522522
// style all HTML files.
523523
std::vector<std::string> UserStylesheets;
524-
// JavaScript files that will be imported in allHTML file.
524+
// JavaScript files that will be imported in all HTML files.
525525
std::vector<std::string> JsScripts;
526526
Index Idx;
527527
};

clang/bindings/python/clang/cindex.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,7 +2786,7 @@ class _CXUnsavedFile(Structure):
27862786
# Functions calls through the python interface are rather slow. Fortunately,
27872787
# for most symboles, we do not need to perform a function call. Their spelling
27882788
# never changes and is consequently provided by this spelling cache.
2789-
SpellingCache = {
2789+
spelling_cache = {
27902790
# 0: CompletionChunk.Kind("Optional"),
27912791
# 1: CompletionChunk.Kind("TypedText"),
27922792
# 2: CompletionChunk.Kind("Text"),
@@ -2832,8 +2832,8 @@ def __repr__(self):
28322832

28332833
@CachedProperty
28342834
def spelling(self):
2835-
if self.__kindNumber in SpellingCache:
2836-
return SpellingCache[self.__kindNumber]
2835+
if self.__kindNumber in spelling_cache:
2836+
return spelling_cache[self.__kindNumber]
28372837
return _CXString.from_result(
28382838
conf.lib.clang_getCompletionChunkText(self.cs, self.key)
28392839
)
@@ -3830,7 +3830,7 @@ def set_property(self, property, value):
38303830
fields_visit_callback = CFUNCTYPE(c_int, Cursor, py_object)
38313831

38323832
# Functions strictly alphabetical order.
3833-
functionList: list[LibFunc] = [
3833+
function_list: list[LibFunc] = [
38343834
(
38353835
"clang_annotateTokens",
38363836
[TranslationUnit, POINTER(Token), c_uint, POINTER(Cursor)],
@@ -4108,7 +4108,7 @@ def register_functions(lib: CDLL, ignore_errors: bool) -> None:
41084108
def register(item: LibFunc) -> None:
41094109
register_function(lib, item, ignore_errors)
41104110

4111-
for f in functionList:
4111+
for f in function_list:
41124112
register(f)
41134113

41144114

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sys
1111
from pathlib import Path
1212

13-
kInputsDir = os.path.join(os.path.dirname(__file__), "INPUTS")
13+
inputs_dir = os.path.join(os.path.dirname(__file__), "INPUTS")
1414

1515

1616
@unittest.skipIf(sys.platform == "win32", "TODO: Fix these tests on Windows")
@@ -34,23 +34,23 @@ def test_create_fail(self):
3434

3535
def test_create(self):
3636
"""Check we can load a compilation database"""
37-
CompilationDatabase.fromDirectory(kInputsDir)
37+
CompilationDatabase.fromDirectory(inputs_dir)
3838

3939
def test_lookup_succeed(self):
4040
"""Check we get some results if the file exists in the db"""
41-
cdb = CompilationDatabase.fromDirectory(kInputsDir)
41+
cdb = CompilationDatabase.fromDirectory(inputs_dir)
4242
cmds = cdb.getCompileCommands("/home/john.doe/MyProject/project.cpp")
4343
self.assertNotEqual(len(cmds), 0)
4444

4545
def test_lookup_succeed_pathlike(self):
4646
"""Same as test_lookup_succeed, but with PathLikes"""
47-
cdb = CompilationDatabase.fromDirectory(Path(kInputsDir))
47+
cdb = CompilationDatabase.fromDirectory(Path(inputs_dir))
4848
cmds = cdb.getCompileCommands(Path("/home/john.doe/MyProject/project.cpp"))
4949
self.assertNotEqual(len(cmds), 0)
5050

5151
def test_all_compilecommand(self):
5252
"""Check we get all results from the db"""
53-
cdb = CompilationDatabase.fromDirectory(kInputsDir)
53+
cdb = CompilationDatabase.fromDirectory(inputs_dir)
5454
cmds = cdb.getAllCompileCommands()
5555
self.assertEqual(len(cmds), 3)
5656
expected = [
@@ -100,7 +100,7 @@ def test_all_compilecommand(self):
100100

101101
def test_1_compilecommand(self):
102102
"""Check file with single compile command"""
103-
cdb = CompilationDatabase.fromDirectory(kInputsDir)
103+
cdb = CompilationDatabase.fromDirectory(inputs_dir)
104104
file = "/home/john.doe/MyProject/project.cpp"
105105
cmds = cdb.getCompileCommands(file)
106106
self.assertEqual(len(cmds), 1)
@@ -119,7 +119,7 @@ def test_1_compilecommand(self):
119119

120120
def test_2_compilecommand(self):
121121
"""Check file with 2 compile commands"""
122-
cdb = CompilationDatabase.fromDirectory(kInputsDir)
122+
cdb = CompilationDatabase.fromDirectory(inputs_dir)
123123
cmds = cdb.getCompileCommands("/home/john.doe/MyProject/project2.cpp")
124124
self.assertEqual(len(cmds), 2)
125125
expected = [
@@ -154,23 +154,23 @@ def test_2_compilecommand(self):
154154

155155
def test_compilecommand_iterator_stops(self):
156156
"""Check that iterator stops after the correct number of elements"""
157-
cdb = CompilationDatabase.fromDirectory(kInputsDir)
157+
cdb = CompilationDatabase.fromDirectory(inputs_dir)
158158
count = 0
159159
for cmd in cdb.getCompileCommands("/home/john.doe/MyProject/project2.cpp"):
160160
count += 1
161161
self.assertLessEqual(count, 2)
162162

163163
def test_compilationDB_references(self):
164164
"""Ensure CompilationsCommands are independent of the database"""
165-
cdb = CompilationDatabase.fromDirectory(kInputsDir)
165+
cdb = CompilationDatabase.fromDirectory(inputs_dir)
166166
cmds = cdb.getCompileCommands("/home/john.doe/MyProject/project.cpp")
167167
del cdb
168168
gc.collect()
169169
cmds[0].directory
170170

171171
def test_compilationCommands_references(self):
172172
"""Ensure CompilationsCommand keeps a reference to CompilationCommands"""
173-
cdb = CompilationDatabase.fromDirectory(kInputsDir)
173+
cdb = CompilationDatabase.fromDirectory(inputs_dir)
174174
cmds = cdb.getCompileCommands("/home/john.doe/MyProject/project.cpp")
175175
del cdb
176176
cmd0 = cmds[0]

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from .util import get_cursor, get_cursors, get_tu
2323

24-
kInput = """\
24+
children_test = """\
2525
struct s0 {
2626
int a;
2727
int b;
@@ -41,23 +41,23 @@
4141
}
4242
"""
4343

44-
kParentTest = """\
44+
parent_test = """\
4545
class C {
4646
void f();
4747
}
4848
4949
void C::f() { }
5050
"""
5151

52-
kTemplateArgTest = """\
52+
template_arg_test = """\
5353
template <int kInt, typename T, bool kBool>
5454
void foo();
5555
5656
template<>
5757
void foo<-7, float, true>();
5858
"""
5959

60-
kBinops = """\
60+
binops = """\
6161
struct C {
6262
int m;
6363
};
@@ -118,7 +118,7 @@ class C {
118118

119119
class TestCursor(unittest.TestCase):
120120
def test_get_children(self):
121-
tu = get_tu(kInput)
121+
tu = get_tu(children_test)
122122

123123
it = tu.cursor.get_children()
124124
tu_nodes = list(it)
@@ -613,15 +613,15 @@ def test_underlying_type(self):
613613
self.assertEqual(underlying.kind, TypeKind.INT)
614614

615615
def test_semantic_parent(self):
616-
tu = get_tu(kParentTest, "cpp")
616+
tu = get_tu(parent_test, "cpp")
617617
curs = get_cursors(tu, "f")
618618
decl = get_cursor(tu, "C")
619619
self.assertEqual(len(curs), 2)
620620
self.assertEqual(curs[0].semantic_parent, curs[1].semantic_parent)
621621
self.assertEqual(curs[0].semantic_parent, decl)
622622

623623
def test_lexical_parent(self):
624-
tu = get_tu(kParentTest, "cpp")
624+
tu = get_tu(parent_test, "cpp")
625625
curs = get_cursors(tu, "f")
626626
decl = get_cursor(tu, "C")
627627
self.assertEqual(len(curs), 2)
@@ -865,13 +865,13 @@ def test_get_arguments(self):
865865
self.assertEqual(arguments[1].spelling, "j")
866866

867867
def test_get_num_template_arguments(self):
868-
tu = get_tu(kTemplateArgTest, lang="cpp")
868+
tu = get_tu(template_arg_test, lang="cpp")
869869
foos = get_cursors(tu, "foo")
870870

871871
self.assertEqual(foos[1].get_num_template_arguments(), 3)
872872

873873
def test_get_template_argument_kind(self):
874-
tu = get_tu(kTemplateArgTest, lang="cpp")
874+
tu = get_tu(template_arg_test, lang="cpp")
875875
foos = get_cursors(tu, "foo")
876876

877877
self.assertEqual(
@@ -885,20 +885,20 @@ def test_get_template_argument_kind(self):
885885
)
886886

887887
def test_get_template_argument_type(self):
888-
tu = get_tu(kTemplateArgTest, lang="cpp")
888+
tu = get_tu(template_arg_test, lang="cpp")
889889
foos = get_cursors(tu, "foo")
890890

891891
self.assertEqual(foos[1].get_template_argument_type(1).kind, TypeKind.FLOAT)
892892

893893
def test_get_template_argument_value(self):
894-
tu = get_tu(kTemplateArgTest, lang="cpp")
894+
tu = get_tu(template_arg_test, lang="cpp")
895895
foos = get_cursors(tu, "foo")
896896

897897
self.assertEqual(foos[1].get_template_argument_value(0), -7)
898898
self.assertEqual(foos[1].get_template_argument_value(2), True)
899899

900900
def test_get_template_argument_unsigned_value(self):
901-
tu = get_tu(kTemplateArgTest, lang="cpp")
901+
tu = get_tu(template_arg_test, lang="cpp")
902902
foos = get_cursors(tu, "foo")
903903

904904
self.assertEqual(foos[1].get_template_argument_unsigned_value(0), 2**32 - 7)
@@ -930,7 +930,7 @@ def test_mangled_name(self):
930930
)
931931

932932
def test_binop(self):
933-
tu = get_tu(kBinops, lang="cpp")
933+
tu = get_tu(binops, lang="cpp")
934934

935935
operators = {
936936
# not exposed yet

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import unittest
99

10-
kInputsDir = os.path.join(os.path.dirname(__file__), "INPUTS")
10+
inputs_dir = os.path.join(os.path.dirname(__file__), "INPUTS")
1111

1212

1313
class TestIndex(unittest.TestCase):
@@ -19,7 +19,7 @@ def test_create(self):
1919
def test_parse(self):
2020
index = Index.create()
2121
self.assertIsInstance(index, Index)
22-
tu = index.parse(os.path.join(kInputsDir, "hello.cpp"))
22+
tu = index.parse(os.path.join(inputs_dir, "hello.cpp"))
2323
self.assertIsInstance(tu, TranslationUnit)
24-
tu = index.parse(None, ["-c", os.path.join(kInputsDir, "hello.cpp")])
24+
tu = index.parse(None, ["-c", os.path.join(inputs_dir, "hello.cpp")])
2525
self.assertIsInstance(tu, TranslationUnit)

0 commit comments

Comments
 (0)