Skip to content

Commit 8fd97e5

Browse files
committed
Merge from 'main' to 'sycl-web' (32 commits)
CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Gnu.cpp
2 parents 7376d16 + 062317f commit 8fd97e5

File tree

235 files changed

+3124
-3067
lines changed

Some content is hidden

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

235 files changed

+3124
-3067
lines changed

clang-tools-extra/clangd/ASTSignals.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
#include "ASTSignals.h"
1010
#include "AST.h"
1111
#include "FindTarget.h"
12+
#include "support/Trace.h"
1213

1314
namespace clang {
1415
namespace clangd {
1516
ASTSignals ASTSignals::derive(const ParsedAST &AST) {
17+
trace::Span Span("ASTSignals::derive");
1618
ASTSignals Signals;
1719
const SourceManager &SM = AST.getSourceManager();
1820
findExplicitReferences(

clang-tools-extra/test/.gitattributes

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
# These test input files rely on one-byte Unix (LF) line-endings, as they use
66
# fixed -offset, FileOffset:, or Offset: numbers in their tests.
7-
clang-apply-replacements/ClangRenameClassReplacements.cpp text eol=lf
8-
clang-apply-replacements/Inputs/basic/basic.h text eol=lf
9-
clang-apply-replacements/Inputs/format/no.cpp text eol=lf
10-
clang-apply-replacements/Inputs/format/yes.cpp text eol=lf
11-
clang-tidy/infrastructure/export-diagnostics.cpp text eol=lf
7+
clang-apply-replacements/ClangRenameClassReplacements.cpp -text
8+
clang-apply-replacements/Inputs/basic/basic.h -text
9+
clang-apply-replacements/Inputs/format/no.cpp -text
10+
clang-apply-replacements/Inputs/format/yes.cpp -text
11+
clang-tidy/infrastructure/export-diagnostics.cpp -text
1212

1313
# These test input files rely on two-byte Windows (CRLF) line endings.
14-
clang-apply-replacements/Inputs/crlf/crlf.cpp text eol=crlf
15-
clang-apply-replacements/Inputs/crlf/crlf.cpp.expected text eol=crlf
14+
clang-apply-replacements/Inputs/crlf/crlf.cpp -text
15+
clang-apply-replacements/Inputs/crlf/crlf.cpp.expected -text
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-
// This file intentionally uses a CRLF newlines!
3-
4-
void foo() {
5-
int *x = 0;
6-
}
1+
2+
// This file intentionally uses a CRLF newlines!
3+
4+
void foo() {
5+
int *x = 0;
6+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-
// This file intentionally uses a CRLF newlines!
3-
4-
void foo() {
5-
int *x = nullptr;
6-
}
1+
2+
// This file intentionally uses a CRLF newlines!
3+
4+
void foo() {
5+
int *x = nullptr;
6+
}

clang/docs/LanguageExtensions.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,11 @@ The following type trait primitives are supported by Clang. Those traits marked
14341434
* ``__is_trivially_constructible`` (C++, GNU, Microsoft)
14351435
* ``__is_trivially_copyable`` (C++, GNU, Microsoft)
14361436
* ``__is_trivially_destructible`` (C++, MSVC 2013)
1437+
* ``__is_trivially_relocatable`` (Clang): Returns true if moving an object
1438+
of the given type, and then destroying the source object, is known to be
1439+
functionally equivalent to copying the underlying bytes and then dropping the
1440+
source object on the floor. This is true of trivial types and types which
1441+
were made trivially relocatable via the ``clang::trivial_abi`` attribute.
14371442
* ``__is_union`` (C++, GNU, Microsoft, Embarcadero)
14381443
* ``__is_unsigned`` (C++, Embarcadero):
14391444
Returns false for enumeration types. Note, before Clang 13, returned true for

clang/include/clang/AST/Type.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,8 @@ class QualType {
830830
/// Return true if this is a trivially copyable type (C++0x [basic.types]p9)
831831
bool isTriviallyCopyableType(const ASTContext &Context) const;
832832

833+
/// Return true if this is a trivially relocatable type.
834+
bool isTriviallyRelocatableType(const ASTContext &Context) const;
833835

834836
/// Returns true if it is a class and it might be dynamic.
835837
bool mayBeDynamicClass() const;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4819,6 +4819,9 @@ If a type is trivial for the purposes of calls, has a non-trivial destructor,
48194819
and is passed as an argument by value, the convention is that the callee will
48204820
destroy the object before returning.
48214821

4822+
If a type is trivial for the purpose of calls, it is assumed to be trivially
4823+
relocatable for the purpose of ``__is_trivially_relocatable``.
4824+
48224825
Attribute ``trivial_abi`` has no effect in the following cases:
48234826

48244827
- The class directly declares a virtual base or virtual methods.

clang/include/clang/Basic/TokenKinds.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ KEYWORD(__builtin_num_bases, KEYSYCL)
518518
KEYWORD(__builtin_base_type, KEYSYCL)
519519

520520
// Clang-only C++ Type Traits
521+
TYPE_TRAIT_1(__is_trivially_relocatable, IsTriviallyRelocatable, KEYCXX)
521522
TYPE_TRAIT_2(__reference_binds_to_temporary, ReferenceBindsToTemporary, KEYCXX)
522523

523524
// Embarcadero Expression Traits

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,8 @@ def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">, Flags<[NoXarchOption, C
948948
Alias<offload_arch_EQ>;
949949
def hip_link : Flag<["--"], "hip-link">,
950950
HelpText<"Link clang-offload-bundler bundles for HIP">;
951+
def no_hip_rt: Flag<["-"], "no-hip-rt">,
952+
HelpText<"Do not link against HIP runtime libraries">;
951953
def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">, Flags<[NoXarchOption]>,
952954
HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. "
953955
"'all' resets the list to its default value.">;

clang/include/clang/Driver/ToolChain.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,11 @@ class ToolChain {
716716
getHIPDeviceLibs(const llvm::opt::ArgList &Args,
717717
const Action::OffloadKind DeviceOffloadingKind) const;
718718

719+
/// Add the system specific linker arguments to use
720+
/// for the given HIP runtime library type.
721+
virtual void AddHIPRuntimeLibArgs(const llvm::opt::ArgList &Args,
722+
llvm::opt::ArgStringList &CmdArgs) const {}
723+
719724
/// Return sanitizers which are available in this toolchain.
720725
virtual SanitizerMask getSupportedSanitizers() const;
721726

0 commit comments

Comments
 (0)