Skip to content

Commit 023b8ef

Browse files
committed
Merge from 'main' to 'sycl-web' (154 commits)
CONFLICT (content): Merge conflict in clang/include/clang/AST/Attr.h CONFLICT (content): Merge conflict in clang/include/clang/Basic/Attr.td
2 parents 8959b9e + 1c6c01f commit 023b8ef

File tree

705 files changed

+39143
-17102
lines changed

Some content is hidden

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

705 files changed

+39143
-17102
lines changed

.github/workflows/pr-code-format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
- name: Fetch LLVM sources
1111
uses: actions/checkout@v4
1212
with:
13-
fetch-depth: 2
13+
fetch-depth: 2 # Fetches only the last 2 commits
1414

1515
- name: Get changed files
1616
id: changed-files
1717
uses: tj-actions/changed-files@v39
1818
with:
1919
separator: ","
20-
fetch_depth: 100 # Fetches only the last 10 commits
20+
fetch_depth: 2000 # Fetches only the last 2000 commits
2121

2222
- name: "Listed files"
2323
run: |

.github/workflows/scorecard.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
# Check current LLVM-Project results here: https://securityscorecards.dev/viewer/?uri=github.com/llvm/llvm-project
6+
7+
name: Scorecard supply-chain security
8+
on:
9+
# For Branch-Protection check. Only the default branch is supported. See
10+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
11+
branch_protection_rule:
12+
# To guarantee Maintained check is occasionally updated. See
13+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
14+
schedule:
15+
- cron: '38 20 * * 4'
16+
push:
17+
branches: [ "main" ]
18+
19+
# Declare default permissions as read only.
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
analysis:
25+
name: Scorecard analysis
26+
runs-on: ubuntu-latest
27+
permissions:
28+
# Needed to upload the results to code-scanning dashboard.
29+
security-events: write
30+
# Needed to publish results and get a badge (see publish_results below).
31+
id-token: write
32+
33+
steps:
34+
- name: "Checkout code"
35+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
36+
with:
37+
persist-credentials: false
38+
39+
- name: "Run analysis"
40+
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
41+
with:
42+
results_file: results.sarif
43+
results_format: sarif
44+
45+
# - Publish results to OpenSSF REST API for easy access by consumers
46+
# - Allows the repository to include the Scorecard badge.
47+
# - See https://github.com/ossf/scorecard-action#publishing-results.
48+
publish_results: true
49+
50+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
51+
# format to the repository Actions tab.
52+
- name: "Upload artifact"
53+
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
54+
with:
55+
name: SARIF file
56+
path: results.sarif
57+
retention-days: 5
58+
59+
# Upload the results to GitHub's code scanning dashboard.
60+
- name: "Upload to code-scanning"
61+
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
62+
with:
63+
sarif_file: results.sarif

clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ExternCRefutationVisitor
5757
bool shouldVisitLambdaBody() const { return false; }
5858

5959
bool VisitLinkageSpecDecl(LinkageSpecDecl *LinkSpecDecl) const {
60-
if (LinkSpecDecl->getLanguage() != LinkageSpecDecl::lang_c ||
60+
if (LinkSpecDecl->getLanguage() != LinkageSpecLanguageIDs::C ||
6161
!LinkSpecDecl->hasBraces())
6262
return true;
6363

clang-tools-extra/modularize/Modularize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,10 @@ class CollectEntitiesVisitor
574574
SourceRange BlockRange = D->getSourceRange();
575575
const char *LinkageLabel;
576576
switch (D->getLanguage()) {
577-
case LinkageSpecDecl::lang_c:
577+
case LinkageSpecLanguageIDs::C:
578578
LinkageLabel = "extern \"C\" {}";
579579
break;
580-
case LinkageSpecDecl::lang_cxx:
580+
case LinkageSpecLanguageIDs::CXX:
581581
LinkageLabel = "extern \"C++\" {}";
582582
break;
583583
}

clang-tools-extra/modularize/ModularizeUtilities.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ std::error_code ModularizeUtilities::loadModuleMap(
322322
// Walks the modules and collects referenced headers into
323323
// HeaderFileNames.
324324
bool ModularizeUtilities::collectModuleMapHeaders(clang::ModuleMap *ModMap) {
325-
SmallVector<std::pair<StringRef, const Module *>, 0> Vec;
325+
SmallVector<std::pair<StringRef, const clang::Module *>, 0> Vec;
326326
for (auto &M : ModMap->modules())
327327
Vec.emplace_back(M.first(), M.second);
328328
llvm::sort(Vec, llvm::less_first());
@@ -349,14 +349,14 @@ bool ModularizeUtilities::collectModuleHeaders(const clang::Module &Mod) {
349349
for (auto *Submodule : Mod.submodules())
350350
collectModuleHeaders(*Submodule);
351351

352-
if (std::optional<Module::Header> UmbrellaHeader =
352+
if (std::optional<clang::Module::Header> UmbrellaHeader =
353353
Mod.getUmbrellaHeaderAsWritten()) {
354354
std::string HeaderPath = getCanonicalPath(UmbrellaHeader->Entry.getName());
355355
// Collect umbrella header.
356356
HeaderFileNames.push_back(HeaderPath);
357357

358358
// FUTURE: When needed, umbrella header header collection goes here.
359-
} else if (std::optional<Module::DirectoryName> UmbrellaDir =
359+
} else if (std::optional<clang::Module::DirectoryName> UmbrellaDir =
360360
Mod.getUmbrellaDirAsWritten()) {
361361
// If there normal headers, assume these are umbrellas and skip collection.
362362
if (Mod.Headers->size() == 0) {

clang/docs/ReleaseNotes.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ Improvements to Clang's diagnostics
427427
(or, more commonly, ``NULL`` when the platform defines it as ``__null``) to be more consistent
428428
with GCC.
429429

430+
Improvements to Clang's time-trace
431+
----------------------------------
432+
- Two time-trace scope variables are added. A time trace scope variable of
433+
``ParseDeclarationOrFunctionDefinition`` with the function's source location
434+
is added to record the time spent parsing the function's declaration or
435+
definition. Another time trace scope variable of ``ParseFunctionDefinition``
436+
is also added to record the name of the defined function.
437+
430438
Bug Fixes in This Version
431439
-------------------------
432440
- Fixed an issue where a class template specialization whose declaration is
@@ -670,6 +678,14 @@ Bug Fixes to C++ Support
670678
default initializing a base class in a constant expression context. Fixes:
671679
(`#69890 <https://github.com/llvm/llvm-project/issues/69890>`_)
672680

681+
- Fix crash when template class static member imported to other translation unit.
682+
Fixes:
683+
(`#68769 <https://github.com/llvm/llvm-project/issues/68769>`_)
684+
685+
- Clang now defers the instantiation of explicit specifier until constraint checking
686+
completes (except deduction guides). Fixes:
687+
(`#59827 <https://github.com/llvm/llvm-project/issues/59827>`_)
688+
673689
Bug Fixes to AST Handling
674690
^^^^^^^^^^^^^^^^^^^^^^^^^
675691
- Fixed an import failure of recursive friend class template.
@@ -809,6 +825,8 @@ Floating Point Support in Clang
809825
- Add ``__builtin_exp10``, ``__builtin_exp10f``,
810826
``__builtin_exp10f16``, ``__builtin_exp10l`` and
811827
``__builtin_exp10f128`` builtins.
828+
- Add ``__builtin_iszero``, ``__builtin_issignaling`` and
829+
``__builtin_issubnormal``.
812830

813831
AST Matchers
814832
------------
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//===--- APINotesOptions.h --------------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_CLANG_APINOTES_APINOTESOPTIONS_H
10+
#define LLVM_CLANG_APINOTES_APINOTESOPTIONS_H
11+
12+
#include "llvm/Support/VersionTuple.h"
13+
#include <string>
14+
#include <vector>
15+
16+
namespace clang {
17+
18+
/// Tracks various options which control how API notes are found and handled.
19+
class APINotesOptions {
20+
public:
21+
/// The Swift version which should be used for API notes.
22+
llvm::VersionTuple SwiftVersion;
23+
24+
/// The set of search paths where we API notes can be found for particular
25+
/// modules.
26+
///
27+
/// The API notes in this directory are stored as <ModuleName>.apinotes, and
28+
/// are only applied when building the module <ModuleName>.
29+
std::vector<std::string> ModuleSearchPaths;
30+
};
31+
32+
} // namespace clang
33+
34+
#endif // LLVM_CLANG_APINOTES_APINOTESOPTIONS_H

clang/include/clang/AST/Attr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "clang/Basic/SourceLocation.h"
2929
#include "llvm/ADT/SmallSet.h"
3030
#include "llvm/ADT/StringSwitch.h"
31+
#include "llvm/Frontend/HLSL/HLSLResource.h"
3132
#include "llvm/Support/ErrorHandling.h"
3233
#include "llvm/Support/VersionTuple.h"
3334
#include "llvm/Support/raw_ostream.h"

clang/include/clang/AST/Decl.h

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4060,6 +4060,29 @@ class EnumDecl : public TagDecl {
40604060
static bool classofKind(Kind K) { return K == Enum; }
40614061
};
40624062

4063+
/// Enum that represents the different ways arguments are passed to and
4064+
/// returned from function calls. This takes into account the target-specific
4065+
/// and version-specific rules along with the rules determined by the
4066+
/// language.
4067+
enum class RecordArgPassingKind {
4068+
/// The argument of this type can be passed directly in registers.
4069+
CanPassInRegs,
4070+
4071+
/// The argument of this type cannot be passed directly in registers.
4072+
/// Records containing this type as a subobject are not forced to be passed
4073+
/// indirectly. This value is used only in C++. This value is required by
4074+
/// C++ because, in uncommon situations, it is possible for a class to have
4075+
/// only trivial copy/move constructors even when one of its subobjects has
4076+
/// a non-trivial copy/move constructor (if e.g. the corresponding copy/move
4077+
/// constructor in the derived class is deleted).
4078+
CannotPassInRegs,
4079+
4080+
/// The argument of this type cannot be passed directly in registers.
4081+
/// Records containing this type as a subobject are forced to be passed
4082+
/// indirectly.
4083+
CanNeverPassInRegs
4084+
};
4085+
40634086
/// Represents a struct/union/class. For example:
40644087
/// struct X; // Forward declaration, no "body".
40654088
/// union Y { int A, B; }; // Has body with members A and B (FieldDecls).
@@ -4070,28 +4093,6 @@ class RecordDecl : public TagDecl {
40704093
public:
40714094
friend class DeclContext;
40724095
friend class ASTDeclReader;
4073-
/// Enum that represents the different ways arguments are passed to and
4074-
/// returned from function calls. This takes into account the target-specific
4075-
/// and version-specific rules along with the rules determined by the
4076-
/// language.
4077-
enum ArgPassingKind : unsigned {
4078-
/// The argument of this type can be passed directly in registers.
4079-
APK_CanPassInRegs,
4080-
4081-
/// The argument of this type cannot be passed directly in registers.
4082-
/// Records containing this type as a subobject are not forced to be passed
4083-
/// indirectly. This value is used only in C++. This value is required by
4084-
/// C++ because, in uncommon situations, it is possible for a class to have
4085-
/// only trivial copy/move constructors even when one of its subobjects has
4086-
/// a non-trivial copy/move constructor (if e.g. the corresponding copy/move
4087-
/// constructor in the derived class is deleted).
4088-
APK_CannotPassInRegs,
4089-
4090-
/// The argument of this type cannot be passed directly in registers.
4091-
/// Records containing this type as a subobject are forced to be passed
4092-
/// indirectly.
4093-
APK_CanNeverPassInRegs
4094-
};
40954096

40964097
protected:
40974098
RecordDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC,
@@ -4216,15 +4217,16 @@ class RecordDecl : public TagDecl {
42164217
/// it must have at least one trivial, non-deleted copy or move constructor.
42174218
/// FIXME: This should be set as part of completeDefinition.
42184219
bool canPassInRegisters() const {
4219-
return getArgPassingRestrictions() == APK_CanPassInRegs;
4220+
return getArgPassingRestrictions() == RecordArgPassingKind::CanPassInRegs;
42204221
}
42214222

4222-
ArgPassingKind getArgPassingRestrictions() const {
4223-
return static_cast<ArgPassingKind>(RecordDeclBits.ArgPassingRestrictions);
4223+
RecordArgPassingKind getArgPassingRestrictions() const {
4224+
return static_cast<RecordArgPassingKind>(
4225+
RecordDeclBits.ArgPassingRestrictions);
42244226
}
42254227

4226-
void setArgPassingRestrictions(ArgPassingKind Kind) {
4227-
RecordDeclBits.ArgPassingRestrictions = Kind;
4228+
void setArgPassingRestrictions(RecordArgPassingKind Kind) {
4229+
RecordDeclBits.ArgPassingRestrictions = llvm::to_underlying(Kind);
42284230
}
42294231

42304232
bool isParamDestroyedInCallee() const {

clang/include/clang/AST/DeclBase.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,11 @@ enum class DeductionCandidate : unsigned char {
13991399
Aggregate,
14001400
};
14011401

1402+
enum class RecordArgPassingKind;
1403+
enum class OMPDeclareReductionInitKind;
1404+
enum class ObjCImplementationControl;
1405+
enum class LinkageSpecLanguageIDs;
1406+
14021407
/// DeclContext - This is used only as base class of specific decl types that
14031408
/// can act as declaration contexts. These decls are (only the top classes
14041409
/// that directly derive from DeclContext are mentioned, not their subclasses):

0 commit comments

Comments
 (0)