Skip to content

Commit ad03beb

Browse files
committed
Merge branch 'main' into users/meinersbur/flang_runtime_move-files
2 parents 909dca1 + 4df366c commit ad03beb

File tree

598 files changed

+34785
-13022
lines changed

Some content is hidden

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

598 files changed

+34785
-13022
lines changed

.github/workflows/build-ci-container.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ jobs:
5959

6060
- name: Test Container
6161
run: |
62-
for image in ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}; do
63-
podman run --rm -it $image /usr/bin/bash -x -c 'cd $HOME && printf '\''#include <iostream>\nint main(int argc, char **argv) { std::cout << "Hello\\n"; }'\'' | clang++ -x c++ - && ./a.out | grep Hello'
62+
for image in ${{ steps.vars.outputs.container-name-tag }}; do
63+
# Use --pull=never to ensure we are testing the just built image.
64+
podman run --pull=never --rm -it $image /usr/bin/bash -x -c 'cd $HOME && printf '\''#include <iostream>\nint main(int argc, char **argv) { std::cout << "Hello\\n"; }'\'' | clang++ -x c++ - && ./a.out | grep Hello'
6465
done
6566
6667
push-ci-container:

.github/workflows/new-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: llvm/actions/issue-labeler@main
1717
with:
18-
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
repo-token: ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}
1919
configuration-path: .github/new-issues-labeler.yml
2020
include-title: 1
2121
include-body: 0

.github/workflows/release-binaries.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
8484
shell: bash
8585
run: |
86-
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} --user-token "$USER_TOKEN" check-permissions
86+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user "$GITHUB_ACTOR" --user-token "$USER_TOKEN" check-permissions
8787
8888
- name: Collect Variables
8989
id: vars
@@ -102,8 +102,8 @@ jobs:
102102
release_version="$trimmed"
103103
ref="llvmorg-$release_version"
104104
else
105-
release_version="${{ (github.event_name == 'pull_request' && format('PR{0}', github.event.pull_request.number)) || 'CI'}}-${{ github.sha }}"
106-
ref=${{ github.sha }}
105+
release_version="${{ (github.event_name == 'pull_request' && format('PR{0}', github.event.pull_request.number)) || 'CI'}}-$GITHUB_SHA"
106+
ref="$GITHUB_SHA"
107107
fi
108108
if [ -n "${{ inputs.upload }}" ]; then
109109
upload="${{ inputs.upload }}"
@@ -114,20 +114,20 @@ jobs:
114114
echo "ref=$ref" >> $GITHUB_OUTPUT
115115
echo "upload=$upload" >> $GITHUB_OUTPUT
116116
117-
release_binary_basename="LLVM-$release_version-${{ runner.os }}-${{ runner.arch }}"
117+
release_binary_basename="LLVM-$release_version-$RUNNER_OS-$RUNNER_ARCH"
118118
echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT
119119
echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT
120120
121121
# Detect necessary CMake flags
122-
target="${{ runner.os }}-${{ runner.arch }}"
122+
target="$RUNNER_OS-$RUNNER_ARCH"
123123
echo "enable-pgo=false" >> $GITHUB_OUTPUT
124124
target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF"
125125
# The macOS builds try to cross compile some libraries so we need to
126126
# add extra CMake args to disable them.
127127
# See https://github.com/llvm/llvm-project/issues/99767
128-
if [ "${{ runner.os }}" = "macOS" ]; then
128+
if [ "$RUNNER_OS" = "macOS" ]; then
129129
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_COMPILER_RT_ENABLE_IOS=OFF"
130-
if [ "${{ runner.arch }}" = "ARM64" ]; then
130+
if [ "$RUNNER_ARCH" = "ARM64" ]; then
131131
arches=arm64
132132
else
133133
arches=x86_64
@@ -137,7 +137,7 @@ jobs:
137137
138138
build_flang="true"
139139
140-
if [ "${{ runner.os }}" = "Windows" ]; then
140+
if [ "$RUNNER_OS" = "Windows" ]; then
141141
# The build times out on Windows, so we need to disable LTO.
142142
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
143143
fi

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4661,12 +4661,13 @@ the configuration (without a prefix: ``Auto``).
46614661
.. _KeepEmptyLinesAtEOF:
46624662

46634663
**KeepEmptyLinesAtEOF** (``Boolean``) :versionbadge:`clang-format 17` :ref:`<KeepEmptyLinesAtEOF>`
4664-
This option is deprecated. See ``AtEndOfFile`` of ``KeepEmptyLines``.
4664+
This option is **deprecated**. See ``AtEndOfFile`` of ``KeepEmptyLines``.
46654665

46664666
.. _KeepEmptyLinesAtTheStartOfBlocks:
46674667

46684668
**KeepEmptyLinesAtTheStartOfBlocks** (``Boolean``) :versionbadge:`clang-format 3.7` :ref:`<KeepEmptyLinesAtTheStartOfBlocks>`
4669-
This option is deprecated. See ``AtStartOfBlock`` of ``KeepEmptyLines``.
4669+
This option is **deprecated**. See ``AtStartOfBlock`` of
4670+
``KeepEmptyLines``.
46704671

46714672
.. _KeepFormFeed:
46724673

@@ -6730,8 +6731,8 @@ the configuration (without a prefix: ``Auto``).
67306731
.. _TemplateNames:
67316732

67326733
**TemplateNames** (``List of Strings``) :versionbadge:`clang-format 20` :ref:`<TemplateNames>`
6733-
A vector of non-keyword identifiers that should be interpreted as
6734-
template names.
6734+
A vector of non-keyword identifiers that should be interpreted as template
6735+
names.
67356736

67366737
A ``<`` after a template name is annotated as a template opener instead of
67376738
a binary operator.

clang/docs/LanguageExtensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3641,7 +3641,7 @@ program location should be executed. It is expected to be used to implement
36413641
<https://llvm.org/docs/LangRef.html#llvm-allow-runtime-check-intrinsic>`_
36423642
intrinsic.
36433643
3644-
The ``__builtin_allow_runtime_check()`` can be used within constrol structures
3644+
The ``__builtin_allow_runtime_check()`` can be used within control structures
36453645
like ``if`` to guard expensive runtime checks. The return value is determined
36463646
by the following compiler options and may differ per call site:
36473647

clang/docs/LibASTMatchersReference.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,6 +2546,17 @@ <h2 id="decl-matchers">Node Matchers</h2>
25462546
};
25472547
</pre></td></tr>
25482548

2549+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>&gt;</td><td class="name" onclick="toggle('dependentTemplateSpecializationType0')"><a name="dependentTemplateSpecializationType0Anchor">dependentTemplateSpecializationType</a></td><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1DependentTemplateSpecializationType.html">DependentTemplateSpecializationType</a>&gt;...</td></tr>
2550+
<tr><td colspan="4" class="doc" id="dependentTemplateSpecializationType0"><pre>Matches a dependent template specialization type.
2551+
2552+
Example matches A<T>::template B<T>
2553+
2554+
template<typename T> struct A;
2555+
template<typename T> struct declToImport {
2556+
typename A<T>::template B<T> a;
2557+
};
2558+
</pre></td></tr>
2559+
25492560
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>&gt;</td><td class="name" onclick="toggle('deducedTemplateSpecializationType0')"><a name="deducedTemplateSpecializationType0Anchor">deducedTemplateSpecializationType</a></td><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1DeducedTemplateSpecializationType.html">DeducedTemplateSpecializationType</a>&gt;...</td></tr>
25502561
<tr><td colspan="4" class="doc" id="deducedTemplateSpecializationType0"><pre>Matches C++17 deduced template specialization types, e.g. deduced class
25512562
template types.
@@ -3438,6 +3449,19 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
34383449
</pre></td></tr>
34393450

34403451

3452+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1DependentScopeDeclRefExpr.html">DependentScopeDeclRefExpr</a>&gt;</td><td class="name" onclick="toggle('hasDependentName0')"><a name="hasDependentName0Anchor">hasDependentName</a></td><td>std::string N</td></tr>
3453+
<tr><td colspan="4" class="doc" id="hasDependentName0"><pre>Matches the dependent name of a DependentScopeDeclRefExpr.
3454+
3455+
Matches the dependent name of a DependentScopeDeclRefExpr
3456+
3457+
Given:
3458+
3459+
template &lt;class T&lt; class X : T { void f() { T::v; } };
3460+
3461+
dependentScopeDeclRefExpr(hasDependentName("v")) matches `T::v`
3462+
</pre></td></tr>
3463+
3464+
34413465
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1CXXDependentScopeMemberExpr.html">CXXDependentScopeMemberExpr</a>&gt;</td><td class="name" onclick="toggle('memberHasSameNameAsBoundNode0')"><a name="memberHasSameNameAsBoundNode0Anchor">memberHasSameNameAsBoundNode</a></td><td>std::string BindingID</td></tr>
34423466
<tr><td colspan="4" class="doc" id="memberHasSameNameAsBoundNode0"><pre>Matches template-dependent, but known, member names against an already-bound
34433467
node

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ Bug Fixes to C++ Support
886886
out of a module (which is the case e.g. in MSVC's implementation of ``std`` module). (#GH118218)
887887
- Fixed a pack expansion issue in checking unexpanded parameter sizes. (#GH17042)
888888
- Fixed a bug where captured structured bindings were modifiable inside non-mutable lambda (#GH95081)
889+
- Clang now identifies unexpanded parameter packs within the type constraint on a non-type template parameter. (#GH88866)
889890
- Fixed an issue while resolving type of expression indexing into a pack of values of non-dependent type (#GH121242)
890891

891892
Bug Fixes to AST Handling
@@ -1113,6 +1114,10 @@ AST Matchers
11131114

11141115
- Add ``dependentNameType`` matcher to match a dependent name type.
11151116

1117+
- Add ``dependentTemplateSpecializationType`` matcher to match a dependent template specialization type.
1118+
1119+
- Add ``hasDependentName`` matcher to match the dependent name of a DependentScopeDeclRefExpr.
1120+
11161121
clang-format
11171122
------------
11181123

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,6 +3257,17 @@ AST_MATCHER_P(CXXDependentScopeMemberExpr, memberHasSameNameAsBoundNode,
32573257
});
32583258
}
32593259

3260+
/// Matches the dependent name of a DependentScopeDeclRefExpr
3261+
///
3262+
/// Given:
3263+
/// \code
3264+
/// template <class T> class X : T { void f() { T::v; } };
3265+
/// \endcode
3266+
/// \c dependentScopeDeclRefExpr(hasDependentName("v")) matches `T::v`
3267+
AST_MATCHER_P(DependentScopeDeclRefExpr, hasDependentName, std::string, N) {
3268+
return Node.getDeclName().getAsString() == N;
3269+
}
3270+
32603271
/// Matches C++ classes that are directly or indirectly derived from a class
32613272
/// matching \c Base, or Objective-C classes that directly or indirectly
32623273
/// subclass a class matching \c Base.
@@ -7721,6 +7732,18 @@ AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher<QualType>,
77217732
/// \endcode
77227733
extern const AstTypeMatcher<DependentNameType> dependentNameType;
77237734

7735+
/// Matches a dependent template specialization type
7736+
///
7737+
/// Example matches A<T>::template B<T>
7738+
/// \code
7739+
/// template<typename T> struct A;
7740+
/// template<typename T> struct declToImport {
7741+
/// typename A<T>::template B<T> a;
7742+
/// };
7743+
/// \endcode
7744+
extern const AstTypeMatcher<DependentTemplateSpecializationType>
7745+
dependentTemplateSpecializationType;
7746+
77247747
/// Matches declarations whose declaration context, interpreted as a
77257748
/// Decl, matches \c InnerMatcher.
77267749
///

clang/include/clang/Basic/Builtins.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ class Context {
102102
/// e.g. "__builtin_abs".
103103
llvm::StringRef getName(unsigned ID) const { return getRecord(ID).Name; }
104104

105+
/// Return a quoted name for the specified builtin for use in diagnostics.
106+
std::string getQuotedName(unsigned ID) const;
107+
105108
/// Get the type descriptor string for the specified builtin.
106109
const char *getTypeString(unsigned ID) const { return getRecord(ID).Type; }
107110

clang/include/clang/Basic/BuiltinsBase.td

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ class Builtin {
8888
// On some platforms, some functions are actually macros. In that case we need
8989
// to #undef them.
9090
bit RequiresUndef = 0;
91+
// Enables builtins to generate `long long` outside of OpenCL and `long` inside.
92+
bit EnableOpenCLLong = 0;
9193
}
9294

9395
class CustomEntry {
9496
string Entry;
9597
}
9698

9799
class AtomicBuiltin : Builtin;
98-
class TargetBuiltin : Builtin {
99-
string Features = "";
100-
}
101100

102101
class LibBuiltin<string header, string languages = "ALL_LANGUAGES"> : Builtin {
103102
string Header = header;
@@ -122,6 +121,14 @@ class OCL_DSELangBuiltin : LangBuiltin<"OCL_DSE">;
122121
class OCL_GASLangBuiltin : LangBuiltin<"OCL_GAS">;
123122
class OCLLangBuiltin : LangBuiltin<"ALL_OCL_LANGUAGES">;
124123

124+
class TargetBuiltin : Builtin {
125+
string Features = "";
126+
}
127+
class TargetLibBuiltin : TargetBuiltin {
128+
string Header;
129+
string Languages = "ALL_LANGUAGES";
130+
}
131+
125132
class Template<list<string> substitutions,
126133
list<string> affixes,
127134
bit as_prefix = 0> {

0 commit comments

Comments
 (0)