Skip to content

Commit 0f208a4

Browse files
committed
Merge branch 'users/meinersbur/flang_runtime' into users/meinersbur/flang_runtime_shared
2 parents 0ac4e0b + ff761f6 commit 0f208a4

File tree

1,168 files changed

+348088
-343514
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,168 files changed

+348088
-343514
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__":

clang-tools-extra/clang-tidy/utils/ExceptionSpecAnalyzer.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ namespace clang::tidy::utils {
1414

1515
ExceptionSpecAnalyzer::State
1616
ExceptionSpecAnalyzer::analyze(const FunctionDecl *FuncDecl) {
17-
// Check if the function has already been analyzed and reuse that result.
18-
const auto CacheEntry = FunctionCache.find(FuncDecl);
19-
if (CacheEntry == FunctionCache.end()) {
17+
// Check if function exist in cache or add temporary value to cache to protect
18+
// against endless recursion.
19+
const auto [CacheEntry, NotFound] =
20+
FunctionCache.try_emplace(FuncDecl, State::NotThrowing);
21+
if (NotFound) {
2022
ExceptionSpecAnalyzer::State State = analyzeImpl(FuncDecl);
21-
22-
// Cache the result of the analysis.
23-
FunctionCache.try_emplace(FuncDecl, State);
23+
// Update result with calculated value
24+
FunctionCache[FuncDecl] = State;
2425
return State;
2526
}
2627

clang-tools-extra/test/clang-tidy/checkers/performance/noexcept-move-constructor.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// RUN: %check_clang_tidy %s performance-noexcept-move-constructor %t -- -- -fexceptions
2+
// RUN: %check_clang_tidy -std=c++17 -check-suffixes=,ERR %s performance-noexcept-move-constructor %t \
3+
// RUN: -- --fix-errors -- -fexceptions -DENABLE_ERROR
24

35
namespace std
46
{
@@ -397,3 +399,18 @@ namespace gh68101
397399
Container(Container&&) noexcept(std::is_nothrow_move_constructible<T>::value);
398400
};
399401
} // namespace gh68101
402+
403+
namespace gh111436
404+
{
405+
406+
template <typename value_type> class set {
407+
set(set &&) = default;
408+
409+
#ifdef ENABLE_ERROR
410+
set(initializer_list<value_type> __l) {};
411+
// CHECK-MESSAGES-ERR: :[[@LINE-1]]:7: error: member 'initializer_list' cannot have template arguments [clang-diagnostic-error]
412+
// CHECK-MESSAGES-ERR: :[[@LINE-2]]:36: error: expected ')' [clang-diagnostic-error]
413+
#endif
414+
};
415+
416+
} // namespace gh111436

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: 6 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

@@ -291,6 +296,7 @@ Python Binding Changes
291296
OpenMP Support
292297
--------------
293298
- Added support 'no_openmp_constructs' assumption clause.
299+
- Added support for 'omp stripe' directive.
294300

295301
Improvements
296302
^^^^^^^^^^^^

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,

clang/include/clang/AST/JSONNodeDumper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ class JSONNodeDumper
345345
void VisitDeclarationTemplateArgument(const TemplateArgument &TA);
346346
void VisitNullPtrTemplateArgument(const TemplateArgument &TA);
347347
void VisitIntegralTemplateArgument(const TemplateArgument &TA);
348+
void VisitStructuralValueTemplateArgument(const TemplateArgument &TA);
348349
void VisitTemplateTemplateArgument(const TemplateArgument &TA);
349350
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA);
350351
void VisitExpressionTemplateArgument(const TemplateArgument &TA);

0 commit comments

Comments
 (0)