Skip to content

Commit 374151e

Browse files
committed
Merge remote-tracking branch 'origin/main' into aballman-implicit-void-ptr-cast-fixes
2 parents 19362f3 + 543f112 commit 374151e

File tree

363 files changed

+11224
-3236
lines changed

Some content is hidden

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

363 files changed

+11224
-3236
lines changed

.ci/metrics/metrics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
# Lists the Github workflows we want to track. Maps the Github job name to
2222
# the metric name prefix in grafana.
2323
# This metric name is also used as a key in the job->name map.
24-
GITHUB_WORKFLOW_TO_TRACK = {"LLVM Premerge Checks": "github_llvm_premerge_checks"}
24+
GITHUB_WORKFLOW_TO_TRACK = {"CI Checks": "github_llvm_premerge_checks"}
2525

2626
# Lists the Github jobs to track for a given workflow. The key is the stable
2727
# name (metric name) of the workflow (see GITHUB_WORKFLOW_TO_TRACK).
2828
# Each value is a map to link the github job name to the corresponding metric
2929
# name.
3030
GITHUB_JOB_TO_TRACK = {
3131
"github_llvm_premerge_checks": {
32-
"Linux Premerge Checks (Test Only - Please Ignore Results)": "premerge_linux",
33-
"Windows Premerge Checks (Test Only - Please Ignore Results)": "premerge_windows",
32+
"Build and Test Linux (Test Only - Please Ignore Results)": "premerge_linux",
33+
"Build and Test Windows (Test Only - Please Ignore Results)": "premerge_windows",
3434
}
3535
}
3636

.github/workflows/premerge.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: LLVM Premerge Checks
1+
name: CI Checks
22

33
permissions:
44
contents: read
@@ -25,7 +25,7 @@ concurrency:
2525

2626
jobs:
2727
premerge-checks-linux:
28-
name: Linux Premerge Checks (Test Only - Please Ignore Results)
28+
name: Build and Test Linux (Test Only - Please Ignore Results)
2929
if: >-
3030
github.repository_owner == 'llvm' &&
3131
(github.event_name != 'pull_request' || github.event.action != 'closed')
@@ -74,7 +74,7 @@ jobs:
7474
include-hidden-files: 'true'
7575

7676
premerge-checks-windows:
77-
name: Windows Premerge Checks (Test Only - Please Ignore Results)
77+
name: Build and Test Windows (Test Only - Please Ignore Results)
7878
if: >-
7979
github.repository_owner == 'llvm' &&
8080
(github.event_name != 'pull_request' || github.event.action != 'closed')

bolt/lib/Passes/PatchEntries.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,10 @@ Error PatchEntries::runOnFunctions(BinaryContext &BC) {
9898
});
9999

100100
if (!Success) {
101-
// We can't change output layout for AArch64 due to LongJmp pass
102-
if (BC.isAArch64()) {
103-
if (opts::ForcePatch) {
104-
BC.errs() << "BOLT-ERROR: unable to patch entries in " << Function
105-
<< "\n";
106-
return createFatalBOLTError("");
107-
}
108-
109-
continue;
110-
}
111-
112101
// If the original function entries cannot be patched, then we cannot
113102
// safely emit new function body.
114103
BC.errs() << "BOLT-WARNING: failed to patch entries in " << Function
115-
<< ". The function will not be optimized.\n";
104+
<< ". The function will not be optimized\n";
116105
Function.setIgnored();
117106
continue;
118107
}

bolt/lib/Rewrite/BinaryPassManager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,10 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
497497
// memory profiling data.
498498
Manager.registerPass(std::make_unique<ReorderData>());
499499

500+
// Patch original function entries
501+
if (BC.HasRelocations)
502+
Manager.registerPass(std::make_unique<PatchEntries>());
503+
500504
if (BC.isAArch64()) {
501505
Manager.registerPass(
502506
std::make_unique<ADRRelaxationPass>(PrintAdrRelaxation));
@@ -524,10 +528,6 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
524528
// Assign each function an output section.
525529
Manager.registerPass(std::make_unique<AssignSections>());
526530

527-
// Patch original function entries
528-
if (BC.HasRelocations)
529-
Manager.registerPass(std::make_unique<PatchEntries>());
530-
531531
// This pass turns tail calls into jumps which makes them invisible to
532532
// function reordering. It's unsafe to use any CFG or instruction analysis
533533
// after this point.

clang/bindings/python/clang/cindex.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,11 +2980,7 @@ def availability(self):
29802980

29812981
@property
29822982
def briefComment(self):
2983-
if conf.function_exists("clang_getCompletionBriefComment"):
2984-
return _CXString.from_result(
2985-
conf.lib.clang_getCompletionBriefComment(self.obj)
2986-
)
2987-
return ""
2983+
return _CXString.from_result(conf.lib.clang_getCompletionBriefComment(self.obj))
29882984

29892985
def __repr__(self):
29902986
return (
@@ -4264,14 +4260,6 @@ def get_cindex_library(self) -> CDLL:
42644260

42654261
return library
42664262

4267-
def function_exists(self, name: str) -> bool:
4268-
try:
4269-
getattr(self.lib, name)
4270-
except AttributeError:
4271-
return False
4272-
4273-
return True
4274-
42754263

42764264
conf = Config()
42774265

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,3 +1035,18 @@ def test_specialized_template(self):
10351035
self.assertNotEqual(foos[0], foos[1])
10361036
self.assertEqual(foos[0], prime_foo)
10371037
self.assertIsNone(tu.cursor.specialized_template)
1038+
1039+
def test_equality(self):
1040+
tu = get_tu(CHILDREN_TEST, lang="cpp")
1041+
cursor1 = get_cursor(tu, "s0")
1042+
cursor1_2 = get_cursor(tu, "s0")
1043+
cursor2 = get_cursor(tu, "f0")
1044+
1045+
self.assertIsNotNone(cursor1)
1046+
self.assertIsNotNone(cursor1_2)
1047+
self.assertIsNotNone(cursor2)
1048+
1049+
self.assertEqual(cursor1, cursor1)
1050+
self.assertEqual(cursor1, cursor1_2)
1051+
self.assertNotEqual(cursor1, cursor2)
1052+
self.assertNotEqual(cursor1, "foo")

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from pathlib import Path
23

34
from clang.cindex import (
45
Config,
@@ -16,6 +17,8 @@
1617

1718
from .util import get_cursor, get_tu
1819

20+
INPUTS_DIR = Path(__file__).parent / "INPUTS"
21+
1922
BASE_INPUT = "int one;\nint two;\n"
2023

2124

@@ -151,3 +154,21 @@ def test_operator_lt(self):
151154
assert l_t1_12 < l_t2_13 < l_t1_14
152155
assert not l_t2_13 < l_t1_12
153156
assert not l_t1_14 < l_t2_13
157+
158+
def test_equality(self):
159+
path = INPUTS_DIR / "testfile.c"
160+
path_a = INPUTS_DIR / "a.inc"
161+
tu = TranslationUnit.from_source(path)
162+
main_file = File.from_name(tu, path)
163+
a_file = File.from_name(tu, path_a)
164+
165+
location1 = SourceLocation.from_position(tu, main_file, 1, 3)
166+
location2 = SourceLocation.from_position(tu, main_file, 2, 2)
167+
location1_2 = SourceLocation.from_position(tu, main_file, 1, 3)
168+
file2_location1 = SourceLocation.from_position(tu, a_file, 1, 3)
169+
170+
self.assertEqual(location1, location1)
171+
self.assertEqual(location1, location1_2)
172+
self.assertNotEqual(location1, location2)
173+
self.assertNotEqual(location1, file2_location1)
174+
self.assertNotEqual(location1, "foo")

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from pathlib import Path
23

34
from clang.cindex import Config, SourceLocation, SourceRange, TranslationUnit
45

@@ -9,6 +10,8 @@
910

1011
from .util import get_tu
1112

13+
INPUTS_DIR = Path(__file__).parent / "INPUTS"
14+
1215

1316
def create_range(tu, line1, column1, line2, column2):
1417
return SourceRange.from_locations(
@@ -83,3 +86,16 @@ def test_contains(self):
8386
r_curly = create_range(tu2, 1, 11, 3, 1)
8487
l_f2 = SourceLocation.from_position(tu2, tu2.get_file("./numbers.inc"), 4, 1)
8588
assert l_f2 in r_curly
89+
90+
def test_equality(self):
91+
path = INPUTS_DIR / "testfile.c"
92+
tu = TranslationUnit.from_source(path)
93+
94+
r1 = create_range(tu, 1, 1, 2, 2)
95+
r2 = create_range(tu, 1, 2, 2, 2)
96+
r1_2 = create_range(tu, 1, 1, 2, 2)
97+
98+
self.assertEqual(r1, r1)
99+
self.assertEqual(r1, r1_2)
100+
self.assertNotEqual(r1, r2)
101+
self.assertNotEqual(r1, "foo")

clang/docs/OpenMPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ implementation.
207207
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
208208
| misc | library shutdown (omp_pause_resource[_all]) | :good:`done` | D55078 |
209209
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
210-
| misc | metadirectives | :part:`mostly done` | D91944 |
210+
| misc | metadirectives | :part:`mostly done` | D91944, https://github.com/llvm/llvm-project/pull/128640 |
211211
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
212212
| misc | conditional modifier for lastprivate clause | :good:`done` | |
213213
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ C Language Changes
154154
- Added ``-Wimplicit-void-ptr-cast``, grouped under ``-Wc++-compat``, which
155155
diagnoses implicit conversion from ``void *`` to another pointer type as
156156
being incompatible with C++. (#GH17792)
157+
- Added ``-Wc++-keyword``, grouped under ``-Wc++-compat``, which diagnoses when
158+
a C++ keyword is used as an identifier in C. (#GH21898)
157159
- Added ``-Wc++-hidden-decl``, grouped under ``-Wc++-compat``, which diagnoses
158160
use of tag types which are visible in C but not visible in C++ due to scoping
159161
rules. e.g.,
@@ -201,6 +203,10 @@ C Language Changes
201203
``-Wunterminated-string-initialization``. However, this diagnostic is not
202204
silenced by the ``nonstring`` attribute as these initializations are always
203205
incompatible with C++.
206+
- Added ``-Wjump-bypasses-init``, which is off by default and grouped under
207+
``-Wc++-compat``. It diagnoses when a jump (``goto`` to its label, ``switch``
208+
to its ``case``) will bypass the initialization of a local variable, which is
209+
invalid in C++.
204210
- Added the existing ``-Wduplicate-decl-specifier`` diagnostic, which is on by
205211
default, to ``-Wc++-compat`` because duplicated declaration specifiers are
206212
not valid in C++.
@@ -281,7 +287,7 @@ New Compiler Flags
281287
The feature has `existed <https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program>`_)
282288
for a while and this is just a user facing option.
283289

284-
- New option ``-ftime-report-json`` added which outputs the same timing data as `-ftime-report` but formatted as JSON.
290+
- New option ``-ftime-report-json`` added which outputs the same timing data as ``-ftime-report`` but formatted as JSON.
285291

286292
Deprecated Compiler Flags
287293
-------------------------
@@ -482,6 +488,8 @@ Improvements to Clang's diagnostics
482488
- ``-Winitializer-overrides`` and ``-Wreorder-init-list`` are now grouped under
483489
the ``-Wc99-designator`` diagnostic group, as they also are about the
484490
behavior of the C99 feature as it was introduced into C++20. Fixes #GH47037
491+
- ``-Wreserved-identifier`` now fires on reserved parameter names in a function
492+
declaration which is not a definition.
485493

486494
Improvements to Clang's time-trace
487495
----------------------------------
@@ -621,6 +629,8 @@ Bug Fixes to C++ Support
621629
- Clang now issues an error when placement new is used to modify a const-qualified variable
622630
in a ``constexpr`` function. (#GH131432)
623631
- Clang now emits a warning when class template argument deduction for alias templates is used in C++17. (#GH133806)
632+
- Fix a crash when checking the template template parameters of a dependent lambda appearing in an alias declaration.
633+
(#GH136432), (#GH137014), (#GH138018)
624634

625635
Bug Fixes to AST Handling
626636
^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)