Skip to content

Commit 65888d2

Browse files
committed
Rebase
Created using spr 1.3.5
2 parents 5e48330 + 41e49fa commit 65888d2

File tree

1,458 files changed

+362387
-346989
lines changed

Some content is hidden

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

1,458 files changed

+362387
-346989
lines changed

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

Lines changed: 63 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import github
2+
import re
23
import sys
34

45
_SPECIAL_CASE_BINARIES = {
@@ -16,38 +17,73 @@ def _is_valid(uploader_name, valid_uploaders, asset_name):
1617
return False
1718

1819

20+
def _get_uploaders(release_version):
21+
# Until llvm 18, assets were uploaded by community members, the release managers
22+
# and the GitHub Actions bot.
23+
if release_version <= 18:
24+
return set(
25+
[
26+
"DimitryAndric",
27+
"stefanp-ibm",
28+
"lei137",
29+
"omjavaid",
30+
"nicolerabjohn",
31+
"amy-kwan",
32+
"mandlebug",
33+
"zmodem",
34+
"androm3da",
35+
"tru",
36+
"rovka",
37+
"rorth",
38+
"quinnlp",
39+
"kamaub",
40+
"abrisco",
41+
"jakeegan",
42+
"maryammo",
43+
"tstellar",
44+
"github-actions[bot]",
45+
]
46+
)
47+
# llvm 19 and beyond, only the release managers, bot and a much smaller
48+
# number of community members.
49+
elif release_version >= 19:
50+
return set(
51+
[
52+
"zmodem",
53+
"omjavaid",
54+
"tru",
55+
"tstellar",
56+
"github-actions[bot]",
57+
]
58+
)
59+
60+
61+
def _get_major_release_version(release_title):
62+
# All release titles are of the form "LLVM X.Y.Z(-rcN)".
63+
match = re.match("LLVM ([0-9]+)\.", release_title)
64+
if match is None:
65+
_write_comment_and_exit_with_error(
66+
f'Could not parse release version from release title "{release_title}".'
67+
)
68+
else:
69+
return int(match.groups()[0])
70+
71+
72+
def _write_comment_and_exit_with_error(comment):
73+
with open("comment", "w") as file:
74+
file.write(comment)
75+
sys.exit(1)
76+
77+
1978
def main():
2079
token = sys.argv[1]
2180

2281
gh = github.Github(login_or_token=token)
2382
repo = gh.get_repo("llvm/llvm-project")
2483

25-
uploaders = set(
26-
[
27-
"DimitryAndric",
28-
"stefanp-ibm",
29-
"lei137",
30-
"omjavaid",
31-
"nicolerabjohn",
32-
"amy-kwan",
33-
"mandlebug",
34-
"zmodem",
35-
"androm3da",
36-
"tru",
37-
"rovka",
38-
"rorth",
39-
"quinnlp",
40-
"kamaub",
41-
"abrisco",
42-
"jakeegan",
43-
"maryammo",
44-
"tstellar",
45-
"github-actions[bot]",
46-
]
47-
)
48-
4984
for release in repo.get_releases():
5085
print("Release:", release.title)
86+
uploaders = _get_uploaders(_get_major_release_version(release.title))
5187
for asset in release.get_assets():
5288
created_at = asset.created_at
5389
updated_at = (
@@ -57,9 +93,9 @@ def main():
5793
f"{asset.name} : {asset.uploader.login} [{created_at} {updated_at}] ( {asset.download_count} )"
5894
)
5995
if not _is_valid(asset.uploader.login, uploaders, asset.name):
60-
with open('comment', 'w') as file:
61-
file.write(f'@{asset.uploader.login} is not a valid uploader.')
62-
sys.exit(1)
96+
_write_comment_and_exit_with_error(
97+
f"@{asset.uploader.login} is not a valid uploader."
98+
)
6399

64100

65101
if __name__ == "__main__":

.github/workflows/release-binaries-all.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ on:
2727
required: true
2828
default: false
2929
type: boolean
30+
secrets:
31+
RELEASE_TASKS_USER_TOKEN:
32+
description: "Secret used to check user permissions."
33+
required: false
3034

3135
pull_request:
3236
types:

bolt/include/bolt/Core/BinarySection.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,9 @@ class BinarySection {
359359

360360
/// Add a new relocation at the given /p Offset.
361361
void addRelocation(uint64_t Offset, MCSymbol *Symbol, uint64_t Type,
362-
uint64_t Addend, uint64_t Value = 0,
363-
bool Pending = false) {
362+
uint64_t Addend, uint64_t Value = 0) {
364363
assert(Offset < getSize() && "offset not within section bounds");
365-
if (!Pending) {
366-
Relocations.emplace(Relocation{Offset, Symbol, Type, Addend, Value});
367-
} else {
368-
PendingRelocations.emplace_back(
369-
Relocation{Offset, Symbol, Type, Addend, Value});
370-
}
364+
Relocations.emplace(Relocation{Offset, Symbol, Type, Addend, Value});
371365
}
372366

373367
/// Add a dynamic relocation at the given /p Offset.

bolt/tools/driver/llvm-bolt.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,24 +173,14 @@ void boltMode(int argc, char **argv) {
173173
}
174174
}
175175

176-
static std::string GetExecutablePath(const char *Argv0) {
177-
SmallString<256> ExecutablePath(Argv0);
178-
// Do a PATH lookup if Argv0 isn't a valid path.
179-
if (!llvm::sys::fs::exists(ExecutablePath))
180-
if (llvm::ErrorOr<std::string> P =
181-
llvm::sys::findProgramByName(ExecutablePath))
182-
ExecutablePath = *P;
183-
return std::string(ExecutablePath);
184-
}
185-
186176
int main(int argc, char **argv) {
187177
// Print a stack trace if we signal out.
188178
sys::PrintStackTraceOnErrorSignal(argv[0]);
189179
PrettyStackTraceProgram X(argc, argv);
190180

191181
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
192182

193-
std::string ToolPath = GetExecutablePath(argv[0]);
183+
std::string ToolPath = llvm::sys::fs::getMainExecutable(argv[0], nullptr);
194184

195185
// Initialize targets and assembly printers/parsers.
196186
llvm::InitializeAllTargetInfos();

bolt/unittests/Core/BinaryContext.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,13 @@ TEST_P(BinaryContextTester, FlushPendingRelocCALL26) {
9393
DataSize, 4);
9494
MCSymbol *RelSymbol1 = BC->getOrCreateGlobalSymbol(4, "Func1");
9595
ASSERT_TRUE(RelSymbol1);
96-
BS.addRelocation(8, RelSymbol1, ELF::R_AARCH64_CALL26, 0, 0, true);
96+
BS.addPendingRelocation(
97+
Relocation{8, RelSymbol1, ELF::R_AARCH64_CALL26, 0, 0});
9798
MCSymbol *RelSymbol2 = BC->getOrCreateGlobalSymbol(16, "Func2");
9899
ASSERT_TRUE(RelSymbol2);
99-
BS.addRelocation(12, RelSymbol2, ELF::R_AARCH64_CALL26, 0, 0, true);
100+
BS.addPendingRelocation(
101+
Relocation{12, RelSymbol2, ELF::R_AARCH64_CALL26, 0, 0});
100102

101-
std::error_code EC;
102103
SmallVector<char> Vect(DataSize);
103104
raw_svector_ostream OS(Vect);
104105

@@ -134,12 +135,13 @@ TEST_P(BinaryContextTester, FlushPendingRelocJUMP26) {
134135
(uint8_t *)Data, Size, 4);
135136
MCSymbol *RelSymbol1 = BC->getOrCreateGlobalSymbol(4, "Func1");
136137
ASSERT_TRUE(RelSymbol1);
137-
BS.addRelocation(8, RelSymbol1, ELF::R_AARCH64_JUMP26, 0, 0, true);
138+
BS.addPendingRelocation(
139+
Relocation{8, RelSymbol1, ELF::R_AARCH64_JUMP26, 0, 0});
138140
MCSymbol *RelSymbol2 = BC->getOrCreateGlobalSymbol(16, "Func2");
139141
ASSERT_TRUE(RelSymbol2);
140-
BS.addRelocation(12, RelSymbol2, ELF::R_AARCH64_JUMP26, 0, 0, true);
142+
BS.addPendingRelocation(
143+
Relocation{12, RelSymbol2, ELF::R_AARCH64_JUMP26, 0, 0});
141144

142-
std::error_code EC;
143145
SmallVector<char> Vect(Size);
144146
raw_svector_ostream OS(Vect);
145147

clang/bindings/python/clang/cindex.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,9 @@ def is_unexposed(self):
14101410
# OpenMP scope directive.
14111411
OMP_SCOPE_DIRECTIVE = 306
14121412

1413+
# OpenMP stripe directive.
1414+
OMP_STRIPE_DIRECTIVE = 310
1415+
14131416
# OpenACC Compute Construct.
14141417
OPEN_ACC_COMPUTE_DIRECTIVE = 320
14151418

clang/docs/HLSL/FunctionCalls.rst

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,14 @@ which is a term made up for HLSL. A cx-value is a temporary value which may be
248248
the result of a cast, and stores its value back to an lvalue when the value
249249
expires.
250250

251-
To represent this concept in Clang we introduce a new ``HLSLOutParamExpr``. An
252-
``HLSLOutParamExpr`` has two forms, one with a single sub-expression and one
253-
with two sub-expressions.
251+
To represent this concept in Clang we introduce a new ``HLSLOutArgExpr``. An
252+
``HLSLOutArgExpr`` has three sub-expressions:
254253

255-
The single sub-expression form is used when the argument expression and the
256-
function parameter are the same type, so no cast is required. As in this
257-
example:
254+
* An OpaqueValueExpr of the argument lvalue expression.
255+
* An OpaqueValueExpr of the copy-initialized parameter temporary.
256+
* A BinaryOpExpr assigning the first with the value of the second.
257+
258+
Given this example:
258259

259260
.. code-block:: c++
260261

@@ -267,23 +268,36 @@ example:
267268
Init(V);
268269
}
269270

270-
The expected AST formulation for this code would be something like:
271+
The expected AST formulation for this code would be something like the example
272+
below. Due to the nature of OpaqueValueExpr nodes, the nodes repeat in the AST
273+
dump. The fake addresses ``0xSOURCE`` and ``0xTEMPORARY`` denote the source
274+
lvalue and argument temporary lvalue expressions.
271275

272276
.. code-block:: text
273277
274278
CallExpr 'void'
275279
|-ImplicitCastExpr 'void (*)(int &)' <FunctionToPointerDecay>
276280
| `-DeclRefExpr 'void (int &)' lvalue Function 'Init' 'void (int &)'
277-
|-HLSLOutParamExpr 'int' lvalue inout
278-
`-DeclRefExpr 'int' lvalue Var 'V' 'int'
279-
280-
The ``HLSLOutParamExpr`` captures that the value is ``inout`` vs ``out`` to
281-
denote whether or not the temporary is initialized from the sub-expression. If
282-
no casting is required the sub-expression denotes the lvalue expression that the
283-
cx-value will be copied to when the value expires.
284-
285-
The two sub-expression form of the AST node is required when the argument type
286-
is not the same as the parameter type. Given this example:
281+
`-HLSLOutArgExpr <col:10> 'int' lvalue inout
282+
|-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
283+
| `-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'
284+
|-OpaqueValueExpr 0xTEMPORARY <col:10> 'int' lvalue
285+
| `-ImplicitCastExpr <col:10> 'int' <LValueToRValue>
286+
| `-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
287+
| `-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'
288+
`-BinaryOperator <col:10> 'int' lvalue '='
289+
|-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
290+
| `-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'
291+
`-ImplicitCastExpr <col:10> 'int' <LValueToRValue>
292+
`-OpaqueValueExpr 0xTEMPORARY <col:10> 'int' lvalue
293+
`-ImplicitCastExpr <col:10> 'int' <LValueToRValue>
294+
`-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
295+
`-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'
296+
297+
The ``HLSLOutArgExpr`` captures that the value is ``inout`` vs ``out`` to
298+
denote whether or not the temporary is initialized from the sub-expression.
299+
300+
The example below demonstrates argument casting:
287301

288302
.. code-block:: c++
289303

@@ -295,28 +309,39 @@ is not the same as the parameter type. Given this example:
295309
Trunc(F);
296310
}
297311

298-
For this case the ``HLSLOutParamExpr`` will have sub-expressions to record both
312+
For this case the ``HLSLOutArgExpr`` will have sub-expressions to record both
299313
casting expression sequences for the initialization and write back:
300314

301315
.. code-block:: text
302316
303317
-CallExpr 'void'
304318
|-ImplicitCastExpr 'void (*)(int3 &)' <FunctionToPointerDecay>
305319
| `-DeclRefExpr 'void (int3 &)' lvalue Function 'inc_i32' 'void (int3 &)'
306-
`-HLSLOutParamExpr 'int3' lvalue inout
307-
|-ImplicitCastExpr 'float3' <IntegralToFloating>
308-
| `-ImplicitCastExpr 'int3' <LValueToRValue>
309-
| `-OpaqueValueExpr 'int3' lvalue
310-
`-ImplicitCastExpr 'int3' <FloatingToIntegral>
311-
`-ImplicitCastExpr 'float3' <LValueToRValue>
312-
`-DeclRefExpr 'float3' lvalue 'F' 'float3'
313-
314-
In this formation the write-back casts are captured as the first sub-expression
315-
and they cast from an ``OpaqueValueExpr``. In IR generation we can use the
316-
``OpaqueValueExpr`` as a placeholder for the ``HLSLOutParamExpr``'s temporary
317-
value on function return.
318-
319-
In code generation this can be implemented with some targeted extensions to the
320-
Objective-C write-back support. Specifically extending CGCall.cpp's
321-
``EmitWriteback`` function to support casting expressions and emission of
322-
aggregate lvalues.
320+
`-HLSLOutArgExpr <col:11> 'int3':'vector<int, 3>' lvalue inout
321+
|-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
322+
| `-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'
323+
|-OpaqueValueExpr 0xTEMPORARY <col:11> 'int3':'vector<int, 3>' lvalue
324+
| `-ImplicitCastExpr <col:11> 'vector<int, 3>' <FloatingToIntegral>
325+
| `-ImplicitCastExpr <col:11> 'float3':'vector<float, 3>' <LValueToRValue>
326+
| `-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
327+
| `-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'
328+
`-BinaryOperator <col:11> 'float3':'vector<float, 3>' lvalue '='
329+
|-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
330+
| `-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'
331+
`-ImplicitCastExpr <col:11> 'vector<float, 3>' <IntegralToFloating>
332+
`-ImplicitCastExpr <col:11> 'int3':'vector<int, 3>' <LValueToRValue>
333+
`-OpaqueValueExpr 0xTEMPORARY <col:11> 'int3':'vector<int, 3>' lvalue
334+
`-ImplicitCastExpr <col:11> 'vector<int, 3>' <FloatingToIntegral>
335+
`-ImplicitCastExpr <col:11> 'float3':'vector<float, 3>' <LValueToRValue>
336+
`-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
337+
`-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'
338+
339+
The AST representation is the same whether casting is required or not, which
340+
simplifies the code generation. IR generation does the following:
341+
342+
* Emit the argument lvalue expression.
343+
* Initialize the argument:
344+
* For ``inout`` arguments, emit the copy-initialization expression.
345+
* For ``out`` arguments, emit an uninitialized temporary.
346+
* Emit the call
347+
* Emit the write-back BinaryOperator expression.

clang/docs/OpenMPSupport.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ implementation.
374374
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
375375
| Loop transformation constructs | :none:`unclaimed` | :none:`unclaimed` | |
376376
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
377+
| loop stripe transformation | :good:`done` | https://github.com/llvm/llvm-project/pull/119891 |
378+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
377379
| work distribute construct | :none:`unclaimed` | :none:`unclaimed` | |
378380
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
379381
| task_iteration | :none:`unclaimed` | :none:`unclaimed` | |

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ ABI Changes in This Version
5454
AST Dumping Potentially Breaking Changes
5555
----------------------------------------
5656

57+
- Added support for dumping template arguments of structural value kinds.
58+
5759
Clang Frontend Potentially Breaking Changes
5860
-------------------------------------------
5961

@@ -145,6 +147,9 @@ Improvements to Coverage Mapping
145147
Bug Fixes in This Version
146148
-------------------------
147149

150+
- Clang now outputs correct values when #embed data contains bytes with negative
151+
signed char values (#GH102798).
152+
148153
Bug Fixes to Compiler Builtins
149154
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150155

@@ -252,6 +257,9 @@ clang-format
252257
libclang
253258
--------
254259

260+
- Fixed a buffer overflow in ``CXString`` implementation. The fix may result in
261+
increased memory allocation.
262+
255263
Code Completion
256264
---------------
257265

@@ -291,6 +299,7 @@ Python Binding Changes
291299
OpenMP Support
292300
--------------
293301
- Added support 'no_openmp_constructs' assumption clause.
302+
- Added support for 'omp stripe' directive.
294303

295304
Improvements
296305
^^^^^^^^^^^^

clang/include/clang-c/Index.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,6 +2158,10 @@ enum CXCursorKind {
21582158
*/
21592159
CXCursor_OMPAssumeDirective = 309,
21602160

2161+
/** OpenMP assume directive.
2162+
*/
2163+
CXCursor_OMPStripeDirective = 310,
2164+
21612165
/** OpenACC Compute Construct.
21622166
*/
21632167
CXCursor_OpenACCComputeConstruct = 320,

0 commit comments

Comments
 (0)