Skip to content

Commit 6514e24

Browse files
committed
merge main into amd-staging
Change-Id: I413a39c205a934221d6f31eb4b9d31b1b3bb03a1
2 parents c57a08a + dcdf44a commit 6514e24

File tree

101 files changed

+4032
-1244
lines changed

Some content is hidden

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

101 files changed

+4032
-1244
lines changed

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ RUN apt-get update && \
6767
file \
6868
tzdata
6969

70+
# Install sccache as it is needed by most of the project test workflows and
71+
# cannot be installed by the ccache action when executing as a non-root user.
72+
# TODO(boomanaiden154): This should be switched to being installed with apt
73+
# once we bump to Ubuntu 24.04.
74+
RUN curl -L 'https://github.com/mozilla/sccache/releases/download/v0.7.6/sccache-v0.7.6-x86_64-unknown-linux-musl.tar.gz' > /tmp/sccache.tar.gz && \
75+
echo "2902a5e44c3342132f07b62e70cca75d9b23252922faf3b924f449808cc1ae58 /tmp/sccache.tar.gz" | sha256sum -c && \
76+
tar xzf /tmp/sccache.tar.gz -O --wildcards '*/sccache' > '/usr/local/bin/sccache' && \
77+
rm /tmp/sccache.tar.gz && \
78+
chmod +x /usr/local/bin/sccache
79+
7080
ENV LLVM_SYSROOT=$LLVM_SYSROOT
7181
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
7282

.github/workflows/premerge.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
- name: Setup ccache
3232
uses: hendrikmuhs/[email protected]
3333
- name: Build and Test
34+
# Mark the job as a success even if the step fails so that people do
35+
# not get notified while the new premerge pipeline is in an
36+
# experimental state.
37+
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
38+
# are ready for people to start recieving notifications.
39+
continue-on-error: true
3440
run: |
3541
git config --global --add safe.directory '*'
3642

clang/docs/LibASTMatchersReference.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3462,6 +3462,21 @@ <h2 id="narrowing-matchers">Narrowing Matchers</h2>
34623462
</pre></td></tr>
34633463

34643464

3465+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1DependentNameType.html">DependentNameType</a>&gt;</td><td class="name" onclick="toggle('hasDependentName1')"><a name="hasDependentName1Anchor">hasDependentName</a></td><td>std::string N</td></tr>
3466+
<tr><td colspan="4" class="doc" id="hasDependentName1"><pre>Matches the dependent name of a DependentNameType.
3467+
3468+
Matches the dependent name of a DependentNameType
3469+
3470+
Given:
3471+
3472+
template &lt;typename T&lt; struct declToImport {
3473+
typedef typename T::type dependent_name;
3474+
};
3475+
3476+
dependentNameType(hasDependentName("type")) matches `T::type`
3477+
</pre></td></tr>
3478+
3479+
34653480
<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>
34663481
<tr><td colspan="4" class="doc" id="memberHasSameNameAsBoundNode0"><pre>Matches template-dependent, but known, member names against an already-bound
34673482
node

clang/docs/OpenMPSupport.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ implementation.
320320
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
321321
| misc | nothing directive | :good:`done` | D123286 |
322322
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
323-
| misc | masked construct and related combined constructs | :part:`worked on` | D99995, D100514 |
323+
| misc | masked construct and related combined constructs | :good:`done` | D99995, D100514, PR-121741(parallel_masked_taskloop) |
324+
| | | | PR-121746(parallel_masked_task_loop_simd),PR-121914(masked_taskloop) |
325+
| | | | PR-121916(masked_taskloop_simd) |
324326
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
325327
| misc | default(firstprivate) & default(private) | :good:`done` | D75591 (firstprivate), D125912 (private) |
326328
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ AST Matchers
11641164

11651165
- Add ``dependentTemplateSpecializationType`` matcher to match a dependent template specialization type.
11661166

1167-
- Add ``hasDependentName`` matcher to match the dependent name of a DependentScopeDeclRefExpr.
1167+
- Add ``hasDependentName`` matcher to match the dependent name of a DependentScopeDeclRefExpr or DependentNameType.
11681168

11691169
clang-format
11701170
------------
@@ -1317,6 +1317,12 @@ Sanitizers
13171317
by the compiler (for example,
13181318
``-fno-sanitize-merge=bool,enum,array-bounds,local-bounds``).
13191319

1320+
- Changed ``-fsanitize=pointer-overflow`` to no longer report ``NULL + 0`` as
1321+
undefined behavior in C, in line with
1322+
`N3322 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf>`_,
1323+
and matching the previous behavior for C++.
1324+
``NULL + non_zero`` continues to be reported as undefined behavior.
1325+
13201326
Python Binding Changes
13211327
----------------------
13221328
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.
@@ -1331,6 +1337,8 @@ OpenMP Support
13311337
- Changed the OpenMP DeviceRTL to use 'generic' IR. The
13321338
``LIBOMPTARGET_DEVICE_ARCHITECTURES`` CMake argument is now unused and will
13331339
always build support for AMDGPU and NVPTX targets.
1340+
- Added support for combined masked constructs 'omp parallel masked taskloop',
1341+
'omp parallel masked taskloop simd','omp masked taskloop' and 'omp masked taskloop simd' directive.
13341342

13351343
Improvements
13361344
^^^^^^^^^^^^

clang/docs/UndefinedBehaviorSanitizer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Available checks are:
177177
problems at higher optimization levels.
178178
- ``-fsanitize=pointer-overflow``: Performing pointer arithmetic which
179179
overflows, or where either the old or new pointer value is a null pointer
180-
(or in C, when they both are).
180+
(excluding the case where both are null pointers).
181181
- ``-fsanitize=return``: In C++, reaching the end of a
182182
value-returning function without returning a value.
183183
- ``-fsanitize=returns-nonnull-attribute``: Returning null pointer

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,15 +3257,27 @@ AST_MATCHER_P(CXXDependentScopeMemberExpr, memberHasSameNameAsBoundNode,
32573257
});
32583258
}
32593259

3260-
/// Matches the dependent name of a DependentScopeDeclRefExpr
3260+
/// Matches the dependent name of a DependentScopeDeclRefExpr or
3261+
/// DependentNameType
32613262
///
32623263
/// Given:
32633264
/// \code
32643265
/// template <class T> class X : T { void f() { T::v; } };
32653266
/// \endcode
32663267
/// \c dependentScopeDeclRefExpr(hasDependentName("v")) matches `T::v`
3267-
AST_MATCHER_P(DependentScopeDeclRefExpr, hasDependentName, std::string, N) {
3268-
return Node.getDeclName().getAsString() == N;
3268+
///
3269+
/// Given:
3270+
/// \code
3271+
/// template <typename T> struct declToImport {
3272+
/// typedef typename T::type dependent_name;
3273+
/// };
3274+
/// \endcode
3275+
/// \c dependentNameType(hasDependentName("type")) matches `T::type`
3276+
AST_POLYMORPHIC_MATCHER_P(hasDependentName,
3277+
AST_POLYMORPHIC_SUPPORTED_TYPES(
3278+
DependentScopeDeclRefExpr, DependentNameType),
3279+
std::string, N) {
3280+
return internal::getDependentName(Node) == N;
32693281
}
32703282

32713283
/// Matches C++ classes that are directly or indirectly derived from a class
@@ -7724,7 +7736,7 @@ AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher<QualType>,
77247736

77257737
/// Matches a dependent name type
77267738
///
7727-
/// Example matches T::type
7739+
/// Example matches T::type
77287740
/// \code
77297741
/// template <typename T> struct declToImport {
77307742
/// typedef typename T::type dependent_name;

clang/include/clang/ASTMatchers/ASTMatchersInternal.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,14 @@ MatchTemplateArgLocAt(const TemplateSpecializationTypeLoc &Node,
23432343
InnerMatcher.matches(Node.getArgLoc(Index), Finder, Builder);
23442344
}
23452345

2346+
inline std::string getDependentName(const DependentScopeDeclRefExpr &node) {
2347+
return node.getDeclName().getAsString();
2348+
}
2349+
2350+
inline std::string getDependentName(const DependentNameType &node) {
2351+
return node.getIdentifier()->getName().str();
2352+
}
2353+
23462354
} // namespace internal
23472355

23482356
} // namespace ast_matchers

clang/include/clang/Basic/DiagnosticASTKinds.td

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,18 @@ def note_constexpr_pointer_subtraction_not_same_array : Note<
9090
def note_constexpr_pointer_subtraction_zero_size : Note<
9191
"subtraction of pointers to type %0 of zero size">;
9292
def note_constexpr_pointer_comparison_unspecified : Note<
93-
"comparison between '%0' and '%1' has unspecified value">;
93+
"comparison between pointers to unrelated objects '%0' and '%1' has unspecified value">;
94+
def note_constexpr_pointer_arith_unspecified : Note<
95+
"arithmetic involving unrelated objects '%0' and '%1' has unspecified value">;
9496
def note_constexpr_pointer_constant_comparison : Note<
9597
"comparison of numeric address '%0' with pointer '%1' can only be performed "
9698
"at runtime">;
9799
def note_constexpr_literal_comparison : Note<
98-
"comparison of addresses of literals has unspecified value">;
100+
"comparison of addresses of potentially overlapping literals has unspecified value">;
101+
def note_constexpr_literal_arith : Note<
102+
"arithmetic on addresses of potentially overlapping literals has unspecified value">;
103+
def note_constexpr_repeated_literal_eval : Note<
104+
"repeated evaluation of the same literal expression can produce different objects">;
99105
def note_constexpr_opaque_call_comparison : Note<
100106
"comparison against opaque constant address '%0' can only be performed at "
101107
"runtime">;

clang/include/clang/CodeGen/BackendUtil.h

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,46 @@
1414
#include <memory>
1515

1616
namespace llvm {
17-
class BitcodeModule;
18-
template <typename T> class Expected;
19-
template <typename T> class IntrusiveRefCntPtr;
20-
class Module;
21-
class MemoryBufferRef;
22-
namespace vfs {
23-
class FileSystem;
24-
} // namespace vfs
25-
}
17+
class BitcodeModule;
18+
template <typename T> class Expected;
19+
template <typename T> class IntrusiveRefCntPtr;
20+
class Module;
21+
class MemoryBufferRef;
22+
namespace vfs {
23+
class FileSystem;
24+
} // namespace vfs
25+
} // namespace llvm
2626

2727
namespace clang {
28-
class DiagnosticsEngine;
29-
class HeaderSearchOptions;
30-
class CodeGenOptions;
31-
class TargetOptions;
32-
class LangOptions;
33-
class BackendConsumer;
34-
35-
enum BackendAction {
36-
Backend_EmitAssembly, ///< Emit native assembly files
37-
Backend_EmitBC, ///< Emit LLVM bitcode files
38-
Backend_EmitLL, ///< Emit human-readable LLVM assembly
39-
Backend_EmitNothing, ///< Don't emit anything (benchmarking mode)
40-
Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything
41-
Backend_EmitObj ///< Emit native object files
42-
};
43-
44-
void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &,
45-
const CodeGenOptions &CGOpts,
46-
const TargetOptions &TOpts, const LangOptions &LOpts,
47-
StringRef TDesc, llvm::Module *M, BackendAction Action,
48-
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
49-
std::unique_ptr<raw_pwrite_stream> OS,
50-
BackendConsumer *BC = nullptr);
51-
52-
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
53-
llvm::MemoryBufferRef Buf);
54-
55-
void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
56-
DiagnosticsEngine &Diags);
57-
}
28+
class DiagnosticsEngine;
29+
class HeaderSearchOptions;
30+
class CodeGenOptions;
31+
class TargetOptions;
32+
class LangOptions;
33+
class BackendConsumer;
34+
35+
enum BackendAction {
36+
Backend_EmitAssembly, ///< Emit native assembly files
37+
Backend_EmitBC, ///< Emit LLVM bitcode files
38+
Backend_EmitLL, ///< Emit human-readable LLVM assembly
39+
Backend_EmitNothing, ///< Don't emit anything (benchmarking mode)
40+
Backend_EmitMCNull, ///< Run CodeGen, but don't emit anything
41+
Backend_EmitObj ///< Emit native object files
42+
};
43+
44+
void EmitBackendOutput(DiagnosticsEngine &Diags, const HeaderSearchOptions &,
45+
const CodeGenOptions &CGOpts, const TargetOptions &TOpts,
46+
const LangOptions &LOpts, StringRef TDesc,
47+
llvm::Module *M, BackendAction Action,
48+
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS,
49+
std::unique_ptr<raw_pwrite_stream> OS,
50+
BackendConsumer *BC = nullptr);
51+
52+
void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
53+
llvm::MemoryBufferRef Buf);
54+
55+
void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
56+
DiagnosticsEngine &Diags);
57+
} // namespace clang
5858

5959
#endif

0 commit comments

Comments
 (0)