Skip to content

Commit 01ba598

Browse files
committed
Merge remote-tracking branch 'origin/sycl-web' into llvmspirv_pulldown
2 parents b2609f1 + 1dd73d1 commit 01ba598

File tree

468 files changed

+32259
-26031
lines changed

Some content is hidden

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

468 files changed

+32259
-26031
lines changed

.github/new-prs-labeler.yml

+41-1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ mlir:dlti:
172172

173173
mlir:emitc:
174174
- mlir/**/EmitC/**
175+
- mlir/lib/Target/Cpp/**
175176

176177
mlir:func:
177178
- mlir/**/Func/**
@@ -183,7 +184,8 @@ mlir:index:
183184
- mlir/**/Index/**
184185

185186
mlir:llvm:
186-
- mlir/**/LLVM/**
187+
- mlir/**/LLVM*
188+
- mlir/**/LLVM*/**
187189

188190
mlir:linalg:
189191
- mlir/**/*linalg/**
@@ -493,14 +495,19 @@ llvm:ir:
493495
- llvm/lib/IR/**
494496
- llvm/include/llvm/IR/**
495497
- llvm/docs/LangRef.rst
498+
- llvm/unittests/IR/**
496499

497500
llvm:analysis:
498501
- llvm/lib/Analysis/**
499502
- llvm/include/llvm/Analysis/**
503+
- llvm/test/Analysis/**
504+
- llvm/unittests/Analysis/**
500505

501506
llvm:transforms:
502507
- llvm/lib/Transforms/**
503508
- llvm/include/llvm/Transforms/**
509+
- llvm/test/Transforms/**
510+
- llvm/unittests/Transforms/**
504511

505512
clangd:
506513
- clang-tools-extra/clangd/**
@@ -724,3 +731,36 @@ backend:X86:
724731
- llvm/include/llvm/TargetParser/X86*
725732
- llvm/lib/TargetParser/X86*
726733
- llvm/utils/TableGen/X86*
734+
735+
third-party:unittests:
736+
- third-party/unittests/**
737+
738+
llvm:binary-utilities:
739+
- llvm/docs/CommandGuide/llvm-*
740+
- llvm/include/llvm/BinaryFormat/**
741+
- llvm/include/llvm/DebugInfo/Symbolize/**
742+
- llvm/include/llvm/ObjCopy/**
743+
- llvm/include/llvm/Object/**
744+
- llvm/lib/BinaryFormat/**
745+
- llvm/lib/DebugInfo/Symbolize/**
746+
- llvm/lib/ObjCopy/**
747+
- llvm/lib/Object/**
748+
- llvm/test/Object/**
749+
- llvm/test/tools/llvm-ar/**
750+
- llvm/test/tools/llvm-cxxfilt/**
751+
- llvm/test/tools/llvm-nm/**
752+
- llvm/test/tools/llvm-objcopy/**
753+
- llvm/test/tools/llvm-objdump/**
754+
- llvm/test/tools/llvm-readobj/**
755+
- llvm/test/tools/llvm-size/**
756+
- llvm/test/tools/llvm-strings/**
757+
- llvm/test/tools/llvm-symbolizer/**
758+
- llvm/tools/llvm-ar/**
759+
- llvm/tools/llvm-cxxfilt/**
760+
- llvm/tools/llvm-nm/**
761+
- llvm/tools/llvm-objcopy/**
762+
- llvm/tools/llvm-objdump/**
763+
- llvm/tools/llvm-readobj/**
764+
- llvm/tools/llvm-size/**
765+
- llvm/tools/llvm-strings/**
766+
- llvm/tools/llvm-symbolizer/**
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import github
2+
import os
3+
import sys
4+
import time
5+
6+
7+
def needs_to_wait(repo):
8+
workflow_name = os.environ.get("GITHUB_WORKFLOW")
9+
run_number = os.environ.get("GITHUB_RUN_NUMBER")
10+
print("Workflow Name:", workflow_name, "Run Number:", run_number)
11+
for status in ["in_progress", "queued"]:
12+
for workflow in repo.get_workflow_runs(status=status):
13+
print("Looking at ", workflow.name, "#", workflow.run_number)
14+
if workflow.name != workflow_name:
15+
continue
16+
if workflow.run_number < int(run_number):
17+
print("Workflow {} still {} ".format(workflow.run_number, status))
18+
return True
19+
return False
20+
21+
22+
repo_name = os.environ.get("GITHUB_REPOSITORY")
23+
token = os.environ.get("GITHUB_TOKEN")
24+
gh = github.Github(token)
25+
repo = gh.get_repo(repo_name)
26+
while needs_to_wait(repo):
27+
time.sleep(30)

.github/workflows/pr-subscriber.yml

+18-15
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@ on:
77
- completed
88

99
permissions:
10+
actions: read
1011
contents: read
1112

12-
concurrency:
13-
# Ideally, we would use the PR number in the concurrency group, but we don't
14-
# have access to it here. We need to ensure only one job is running for
15-
# each PR at a time, because there is a potential race condition when
16-
# updating the issue comment.
17-
group: "PR Subscriber"
18-
cancel-in-progress: false
19-
2013
jobs:
2114
auto-subscribe:
2215
runs-on: ubuntu-latest
@@ -25,6 +18,23 @@ jobs:
2518
github.event.workflow_run.event == 'pull_request' &&
2619
github.event.workflow_run.conclusion == 'success'
2720
steps:
21+
- name: Setup Automation Script
22+
run: |
23+
curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/github-automation.py
24+
curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/requirements.txt
25+
curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/.github/workflows/pr-subscriber-wait.py
26+
chmod a+x github-automation.py
27+
pip install -r requirements.txt
28+
29+
- name: 'Wait for other actions'
30+
# We can't use the concurrency tag for these jobs, because it will
31+
# cancel pending jobs if another job is running.
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
python3 pr-subscriber-wait.py
36+
37+
2838
# From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
2939
# Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
3040
- name: 'Download artifact'
@@ -50,13 +60,6 @@ jobs:
5060
5161
- run: unzip pr.zip
5262

53-
- name: Setup Automation Script
54-
run: |
55-
curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/github-automation.py
56-
curl -O -L https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/requirements.txt
57-
chmod a+x github-automation.py
58-
pip install -r requirements.txt
59-
6063
- name: Update watchers
6164
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
6265
run: |

clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h"
1414
#include "clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h"
1515
#include "clang/Basic/SourceLocation.h"
16+
#include "llvm/ADT/SmallVector.h"
1617
#include "llvm/Support/Error.h"
17-
#include <memory>
18-
#include <optional>
19-
#include <vector>
2018

2119
namespace clang::tidy::bugprone {
2220
using ast_matchers::MatchFinder;
@@ -54,7 +52,7 @@ void UncheckedOptionalAccessCheck::check(
5452
UncheckedOptionalAccessDiagnoser Diagnoser(ModelOptions);
5553
// FIXME: Allow user to set the (defaulted) SAT iterations max for
5654
// `diagnoseFunction` with config options.
57-
if (llvm::Expected<std::vector<SourceLocation>> Locs =
55+
if (llvm::Expected<llvm::SmallVector<SourceLocation>> Locs =
5856
dataflow::diagnoseFunction<UncheckedOptionalAccessModel,
5957
SourceLocation>(*FuncDecl, *Result.Context,
6058
Diagnoser))

clang/docs/LanguageExtensions.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,10 @@ The following type trait primitives are supported by Clang. Those traits marked
16211621
materialized temporary object. If ``T`` is not a reference type the result
16221622
is false. Note this trait will also return false when the initialization of
16231623
``T`` from ``U`` is ill-formed.
1624+
Deprecated, use ``__reference_constructs_from_temporary``.
1625+
* ``__reference_constructs_from_temporary(T, U)`` (C++)
1626+
Returns true if a reference ``T`` can be constructed from a temporary of type
1627+
a non-cv-qualified ``U``.
16241628
* ``__underlying_type`` (C++, GNU, Microsoft)
16251629

16261630
In addition, the following expression traits are supported:

clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "llvm/ADT/Any.h"
3232
#include "llvm/ADT/STLExtras.h"
3333
#include "llvm/ADT/STLFunctionalExtras.h"
34+
#include "llvm/ADT/SmallVector.h"
3435
#include "llvm/Support/Errc.h"
3536
#include "llvm/Support/Error.h"
3637

@@ -246,9 +247,9 @@ runDataflowAnalysis(
246247
/// - This limit is still low enough to keep runtimes acceptable (on typical
247248
/// machines) in cases where we hit the limit.
248249
template <typename AnalysisT, typename Diagnostic>
249-
llvm::Expected<std::vector<Diagnostic>> diagnoseFunction(
250+
llvm::Expected<llvm::SmallVector<Diagnostic>> diagnoseFunction(
250251
const FunctionDecl &FuncDecl, ASTContext &ASTCtx,
251-
llvm::function_ref<std::vector<Diagnostic>(
252+
llvm::function_ref<llvm::SmallVector<Diagnostic>(
252253
const CFGElement &, ASTContext &,
253254
const TransferStateForDiagnostics<typename AnalysisT::Lattice> &)>
254255
Diagnoser,
@@ -263,7 +264,7 @@ llvm::Expected<std::vector<Diagnostic>> diagnoseFunction(
263264
DataflowAnalysisContext AnalysisContext(std::move(OwnedSolver));
264265
Environment Env(AnalysisContext, FuncDecl);
265266
AnalysisT Analysis(ASTCtx);
266-
std::vector<Diagnostic> Diagnostics;
267+
llvm::SmallVector<Diagnostic> Diagnostics;
267268
if (llvm::Error Err =
268269
runTypeErasedDataflowAnalysis(
269270
*Context, Analysis, Env,

clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
2222
#include "clang/Analysis/FlowSensitive/NoopLattice.h"
2323
#include "clang/Basic/SourceLocation.h"
24-
#include <vector>
24+
#include "llvm/ADT/SmallVector.h"
2525

2626
namespace clang {
2727
namespace dataflow {
@@ -74,14 +74,14 @@ class UncheckedOptionalAccessDiagnoser {
7474
UncheckedOptionalAccessDiagnoser(
7575
UncheckedOptionalAccessModelOptions Options = {});
7676

77-
std::vector<SourceLocation>
77+
llvm::SmallVector<SourceLocation>
7878
operator()(const CFGElement &Elt, ASTContext &Ctx,
7979
const TransferStateForDiagnostics<NoopLattice> &State) {
8080
return DiagnoseMatchSwitch(Elt, Ctx, State.Env);
8181
}
8282

8383
private:
84-
CFGMatchSwitch<const Environment, std::vector<SourceLocation>>
84+
CFGMatchSwitch<const Environment, llvm::SmallVector<SourceLocation>>
8585
DiagnoseMatchSwitch;
8686
};
8787

clang/include/clang/Basic/AttrSubjectMatchRules.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
#ifndef LLVM_CLANG_BASIC_ATTRSUBJECTMATCHRULES_H
1010
#define LLVM_CLANG_BASIC_ATTRSUBJECTMATCHRULES_H
1111

12-
#include "clang/Basic/SourceLocation.h"
1312
#include "llvm/ADT/DenseMap.h"
1413

1514
namespace clang {
15+
16+
class SourceRange;
17+
1618
namespace attr {
1719

1820
/// A list of all the recognized kinds of attributes.

clang/include/clang/Basic/AttributeCommonInfo.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
#ifndef LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
1515
#define LLVM_CLANG_BASIC_ATTRIBUTECOMMONINFO_H
16+
1617
#include "clang/Basic/SourceLocation.h"
1718
#include "clang/Basic/TokenKinds.h"
1819

1920
namespace clang {
20-
class IdentifierInfo;
21+
2122
class ASTRecordWriter;
23+
class IdentifierInfo;
2224

2325
class AttributeCommonInfo {
2426
public:

clang/include/clang/Basic/Attributes.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
#define LLVM_CLANG_BASIC_ATTRIBUTES_H
1111

1212
#include "clang/Basic/AttributeCommonInfo.h"
13-
#include "clang/Basic/LangOptions.h"
14-
#include "clang/Basic/TargetInfo.h"
1513

1614
namespace clang {
1715

1816
class IdentifierInfo;
17+
class LangOptions;
18+
class TargetInfo;
1919

2020
/// Return the version number associated with the attribute if we
2121
/// recognize and implement the attribute specified by the given information.

clang/include/clang/Basic/DiagnosticDriverKinds.td

+5
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,11 @@ def err_drv_dxc_missing_target_profile : Error<
771771
"target profile option (-T) is missing">;
772772
def err_drv_hlsl_unsupported_target : Error<
773773
"HLSL code generation is unsupported for target '%0'">;
774+
def err_drv_hlsl_bad_shader_required_in_target : Error<
775+
"shader %select{model|stage}0 is required in target '%1' for HLSL code generation">;
776+
777+
def err_drv_hlsl_bad_shader_unsupported : Error<
778+
"shader %select{model|stage}0 '%1' in target '%2' is invalid for HLSL code generation">;
774779
def warn_drv_dxc_missing_dxv : Warning<"dxv not found. "
775780
"Resulting DXIL will not be validated or signed for use in release environments.">,
776781
InGroup<DXILValidation>;

clang/include/clang/Basic/FileManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class FileManager : public RefCountedBase<FileManager> {
275275
/// Open the specified file as a MemoryBuffer, returning a new
276276
/// MemoryBuffer if successful, otherwise returning null.
277277
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
278-
getBufferForFile(const FileEntry *Entry, bool isVolatile = false,
278+
getBufferForFile(FileEntryRef Entry, bool isVolatile = false,
279279
bool RequiresNullTerminator = true);
280280
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
281281
getBufferForFile(StringRef Filename, bool isVolatile = false,
@@ -327,7 +327,7 @@ class FileManager : public RefCountedBase<FileManager> {
327327
/// This is a very expensive operation, despite its results being cached,
328328
/// and should only be used when the physical layout of the file system is
329329
/// required, which is (almost) never.
330-
StringRef getCanonicalName(const FileEntry *File);
330+
StringRef getCanonicalName(FileEntryRef File);
331331

332332
private:
333333
/// Retrieve the canonical name for a given file or directory.

clang/include/clang/Basic/SourceManager.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class alignas(8) ContentCache {
148148
///
149149
/// Can be different from 'Entry' if we overridden the contents of one file
150150
/// with the contents of another file.
151-
const FileEntry *ContentsEntry;
151+
OptionalFileEntryRef ContentsEntry;
152152

153153
/// The filename that is used to access OrigEntry.
154154
///
@@ -180,13 +180,13 @@ class alignas(8) ContentCache {
180180
mutable unsigned IsBufferInvalid : 1;
181181

182182
ContentCache()
183-
: OrigEntry(std::nullopt), ContentsEntry(nullptr),
183+
: OrigEntry(std::nullopt), ContentsEntry(std::nullopt),
184184
BufferOverridden(false), IsFileVolatile(false), IsTransient(false),
185185
IsBufferInvalid(false) {}
186186

187187
ContentCache(FileEntryRef Ent) : ContentCache(Ent, Ent) {}
188188

189-
ContentCache(FileEntryRef Ent, const FileEntry *contentEnt)
189+
ContentCache(FileEntryRef Ent, FileEntryRef contentEnt)
190190
: OrigEntry(Ent), ContentsEntry(contentEnt), BufferOverridden(false),
191191
IsFileVolatile(false), IsTransient(false), IsBufferInvalid(false) {}
192192

clang/include/clang/Basic/TokenKinds.def

+1
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ TYPE_TRAIT_1(__is_scoped_enum, IsScopedEnum, KEYCXX)
538538
TYPE_TRAIT_1(__is_referenceable, IsReferenceable, KEYCXX)
539539
TYPE_TRAIT_1(__can_pass_in_regs, CanPassInRegs, KEYCXX)
540540
TYPE_TRAIT_2(__reference_binds_to_temporary, ReferenceBindsToTemporary, KEYCXX)
541+
TYPE_TRAIT_2(__reference_constructs_from_temporary, ReferenceConstructsFromTemporary, KEYCXX)
541542

542543
// Embarcadero Expression Traits
543544
EXPRESSION_TRAIT(__is_lvalue_expr, IsLValueExpr, KEYCXX)

clang/include/clang/CodeGen/CGFunctionInfo.h

+5
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,11 @@ class RequiredArgs {
527527
return NumRequired;
528528
}
529529

530+
/// Return true if the argument at a given index is required.
531+
bool isRequiredArg(unsigned argIdx) const {
532+
return argIdx == ~0U || argIdx < NumRequired;
533+
}
534+
530535
unsigned getOpaqueData() const { return NumRequired; }
531536
static RequiredArgs getFromOpaqueData(unsigned value) {
532537
if (value == ~0U) return All;

clang/include/clang/Frontend/CompilerInvocation.h

+3
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ class CowCompilerInvocation : public CompilerInvocationBase {
357357
deep_copy_assign(X);
358358
}
359359

360+
CowCompilerInvocation(CompilerInvocation &&X)
361+
: CompilerInvocationBase(std::move(X)) {}
362+
360363
// Const getters are inherited from the base class.
361364

362365
/// Mutable getters.

clang/include/clang/Lex/HeaderMap.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ class HeaderMap : private HeaderMapImpl {
8888
public:
8989
/// This attempts to load the specified file as a header map. If it doesn't
9090
/// look like a HeaderMap, it gives up and returns null.
91-
static std::unique_ptr<HeaderMap> Create(const FileEntry *FE,
92-
FileManager &FM);
91+
static std::unique_ptr<HeaderMap> Create(FileEntryRef FE, FileManager &FM);
9392

9493
using HeaderMapImpl::dump;
9594
using HeaderMapImpl::forEachKey;

0 commit comments

Comments
 (0)