Skip to content

Commit 8c344c3

Browse files
Merge branch 'llvm:main' into 2-acc-common
2 parents 14ce6b6 + 82a4277 commit 8c344c3

File tree

225 files changed

+8150
-1940
lines changed

Some content is hidden

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

225 files changed

+8150
-1940
lines changed

.ci/generate_test_report_github.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88

99
import generate_test_report_lib
1010

11-
PLATFORM_TITLES = {
12-
"Windows": ":window: Windows x64 Test Results",
13-
"Linux": ":penguin: Linux x64 Test Results",
14-
}
11+
def compute_platform_title() -> str:
12+
logo = ":window:" if platform.system() == "Windows" else ":penguin:"
13+
# On Linux the machine value is x86_64 on Windows it is AMD64.
14+
if platform.machine() == "x86_64" or platform.machine() == "AMD64":
15+
arch = "x64"
16+
else:
17+
arch = platform.machine()
18+
return f"{logo} {platform.system()} {arch} Test Results"
19+
1520

1621
if __name__ == "__main__":
1722
parser = argparse.ArgumentParser()
@@ -22,7 +27,7 @@
2227
args = parser.parse_args()
2328

2429
report = generate_test_report_lib.generate_report_from_files(
25-
PLATFORM_TITLES[platform.system()], args.return_code, args.build_test_logs
30+
compute_platform_title(), args.return_code, args.build_test_logs
2631
)
2732

2833
print(report)

.ci/utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function start-group {
5656
export PIP_BREAK_SYSTEM_PACKAGES=1
5757
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
5858

59-
if [[ "$GITHUB_ACTIONS" != "" ]]; then
59+
# The ARM64 builders run on AWS and don't have access to the GCS cache.
60+
if [[ "$GITHUB_ACTIONS" != "" ]] && [[ "$RUNNER_ARCH" != "ARM64" ]]; then
6061
python .ci/cache_lit_timing_files.py download
6162
fi

.github/workflows/premerge.yaml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,45 @@ concurrency:
2424

2525
jobs:
2626
premerge-checks-linux:
27-
name: Build and Test Linux
27+
name: Build and Test Linux${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && ' AArch64') || '' }}
2828
if: >-
2929
github.repository_owner == 'llvm' &&
3030
(github.event_name != 'pull_request' || github.event.action != 'closed')
31-
runs-on: llvm-premerge-linux-runners
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
runs-on:
35+
- depot-ubuntu-24.04-arm-16
36+
- llvm-premerge-linux-runners
37+
runs-on: ${{ matrix.runs-on }}
38+
container:
39+
# The llvm-premerge agents are already containers and running the
40+
# this same image, so we can't use a container for the github action
41+
# job. The depot containers are running on VMs, so we can use a
42+
# container. This helps ensure the build environment is as close
43+
# as possible on both the depot runners and the llvm-premerge runners.
44+
image: ${{ (startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') && format('ghcr.io/{0}/arm64v8/ci-ubuntu-24.04',github.repository_owner) ) || null }}
45+
# --privileged is needed to run the lldb tests that disable aslr.
46+
# The SCCACHE environment variables are need to be copied from the host
47+
# to the container to make sure it is configured correctly to use the
48+
# depot cache.
49+
options: >-
50+
--privileged
51+
--env SCCACHE_WEBDAV_ENDPOINT
52+
--env SCCACHE_WEBDAV_TOKEN
53+
defaults:
54+
run:
55+
# The run step defaults to using sh as the shell when running in a
56+
# container, so make bash the default to ensure consistency between
57+
# container and non-container jobs.
58+
shell: bash
3259
steps:
3360
- name: Checkout LLVM
3461
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3562
with:
3663
fetch-depth: 2
3764
- name: Build and Test
65+
continue-on-error: ${{ runner.arch == 'ARM64' }}
3866
run: |
3967
git config --global --add safe.directory '*'
4068
@@ -54,11 +82,16 @@ jobs:
5482
export CC=/opt/llvm/bin/clang
5583
export CXX=/opt/llvm/bin/clang++
5684
57-
# This environment variable is passes into the container through the
58-
# runner pod definition. This differs between our two clusters which
59-
# why we do not hardcode it.
60-
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
61-
export SCCACHE_GCS_RW_MODE=READ_WRITE
85+
# The linux-premerge runners are hosted on GCP and have a different
86+
# cache setup than the depot runners.
87+
if [[ "${{ matrix.runs-on }}" = "llvm-premerge-linux-runners" ]]; then
88+
# This environment variable is passes into the container through the
89+
# runner pod definition. This differs between our two clusters which
90+
# why we do not hardcode it.
91+
export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET
92+
export SCCACHE_GCS_RW_MODE=READ_WRITE
93+
fi
94+
env
6295
6396
# Set the idle timeout to zero to ensure sccache runs for the
6497
# entire duration of the job. Otherwise it might stop if we run
@@ -78,7 +111,7 @@ jobs:
78111
if: '!cancelled()'
79112
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
80113
with:
81-
name: Premerge Artifacts (Linux)
114+
name: Premerge Artifacts (Linux ${{ runner.arch }})
82115
path: artifacts/
83116
retention-days: 5
84117
include-hidden-files: 'true'

clang-tools-extra/clang-doc/HTMLMustacheGenerator.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,22 @@ class MustacheHTMLGenerator : public Generator {
4646
const ClangDocContext &CDCtx) override;
4747
};
4848

49-
class MustacheTemplateFile : public Template {
49+
class MustacheTemplateFile {
50+
BumpPtrAllocator Allocator;
51+
StringSaver Saver;
52+
MustacheContext Ctx;
53+
Template T;
54+
std::unique_ptr<MemoryBuffer> Buffer;
55+
5056
public:
5157
static Expected<std::unique_ptr<MustacheTemplateFile>>
5258
createMustacheFile(StringRef FileName) {
5359
ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrError =
5460
MemoryBuffer::getFile(FileName);
5561
if (auto EC = BufferOrError.getError())
5662
return createFileOpenError(FileName, EC);
57-
58-
std::unique_ptr<MemoryBuffer> Buffer = std::move(BufferOrError.get());
59-
StringRef FileContent = Buffer->getBuffer();
60-
return std::make_unique<MustacheTemplateFile>(FileContent);
63+
return std::make_unique<MustacheTemplateFile>(
64+
std::move(BufferOrError.get()));
6165
}
6266

6367
Error registerPartialFile(StringRef Name, StringRef FileName) {
@@ -68,11 +72,15 @@ class MustacheTemplateFile : public Template {
6872

6973
std::unique_ptr<MemoryBuffer> Buffer = std::move(BufferOrError.get());
7074
StringRef FileContent = Buffer->getBuffer();
71-
registerPartial(Name.str(), FileContent.str());
75+
T.registerPartial(Name.str(), FileContent.str());
7276
return Error::success();
7377
}
7478

75-
MustacheTemplateFile(StringRef TemplateStr) : Template(TemplateStr) {}
79+
void render(json::Value &V, raw_ostream &OS) { T.render(V, OS); }
80+
81+
MustacheTemplateFile(std::unique_ptr<MemoryBuffer> &&B)
82+
: Saver(Allocator), Ctx(Allocator, Saver), T(B->getBuffer(), Ctx),
83+
Buffer(std::move(B)) {}
7684
};
7785

7886
static std::unique_ptr<MustacheTemplateFile> NamespaceTemplate = nullptr;

clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ static FixItHint generateFixItHint(const ObjCPropertyDecl *Decl,
3939
auto NewName = Decl->getName().str();
4040
size_t Index = 0;
4141
if (Style == CategoryProperty) {
42-
Index = Name.find_first_of('_') + 1;
43-
NewName.replace(0, Index - 1, Name.substr(0, Index - 1).lower());
42+
size_t UnderScorePos = Name.find_first_of('_');
43+
if (UnderScorePos != llvm::StringRef::npos) {
44+
Index = UnderScorePos + 1;
45+
NewName.replace(0, Index - 1, Name.substr(0, Index - 1).lower());
46+
}
4447
}
4548
if (Index < Name.size()) {
4649
NewName[Index] = tolower(NewName[Index]);

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ Improvements to Clang's diagnostics
357357
properly being rejected when used at compile-time. It was not implemented
358358
and caused assertion failures before (#GH158471).
359359

360+
- Closed a loophole in the diagnosis of function pointer conversions changing
361+
extended function type information in C mode (#GH41465). Function conversions
362+
that were previously incorrectly accepted in case of other irrelevant
363+
conditions are now consistently diagnosed, identical to C++ mode.
364+
360365
Improvements to Clang's time-trace
361366
----------------------------------
362367

@@ -455,6 +460,7 @@ Bug Fixes to C++ Support
455460
- Fix a crash when attempting to deduce a deduction guide from a non deducible template template parameter. (#130604)
456461
- Fix for clang incorrectly rejecting the default construction of a union with
457462
nontrivial member when another member has an initializer. (#GH81774)
463+
- Diagnose unresolved overload sets in non-dependent compound requirements. (#GH51246) (#GH97753)
458464

459465
Bug Fixes to AST Handling
460466
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/HLSLResource.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ struct ResourceBindingAttrs {
7474
assert(hasBinding() && !isExplicit() && !hasImplicitOrderID());
7575
RegBinding->setImplicitBindingOrderID(Value);
7676
}
77+
void setCounterImplicitOrderID(unsigned Value) const {
78+
assert(hasBinding() && !hasCounterImplicitOrderID());
79+
RegBinding->setImplicitCounterBindingOrderID(Value);
80+
}
81+
82+
bool hasCounterImplicitOrderID() const {
83+
return RegBinding && RegBinding->hasImplicitCounterBindingOrderID();
84+
}
85+
86+
unsigned getCounterImplicitOrderID() const {
87+
assert(hasCounterImplicitOrderID());
88+
return RegBinding->getImplicitCounterBindingOrderID();
89+
}
7790
};
7891

7992
} // namespace hlsl

clang/include/clang/AST/OpenACCClause.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,13 +1280,31 @@ class OpenACCCreateClause final
12801280
// 'main' declaration used for initializaiton, which is fixed.
12811281
struct OpenACCReductionRecipe {
12821282
VarDecl *AllocaDecl;
1283-
// TODO: OpenACC: this should eventually have the operations here too.
12841283

1285-
OpenACCReductionRecipe(VarDecl *A) : AllocaDecl(A) {}
1284+
// A combiner recipe is represented by an operation expression. However, in
1285+
// order to generate these properly, we have to make up a LHS and a RHS
1286+
// expression for the purposes of generation.
1287+
struct CombinerRecipe {
1288+
VarDecl *LHS;
1289+
VarDecl *RHS;
1290+
Expr *Op;
1291+
};
1292+
1293+
// Contains a collection of the recipe elements we need for the combiner:
1294+
// -For Scalars, there will be 1 element, just the combiner for that scalar.
1295+
// -For a struct with a valid operator, this will be 1 element, just that
1296+
// call.
1297+
// -For a struct without the operator, this will be 1 element per field, which
1298+
// should be the combiner for that element.
1299+
// -For an array of any of the above, it will be the above for the element.
1300+
llvm::SmallVector<CombinerRecipe, 1> CombinerRecipes;
1301+
1302+
OpenACCReductionRecipe(VarDecl *A, llvm::ArrayRef<CombinerRecipe> Combiners)
1303+
: AllocaDecl(A), CombinerRecipes(Combiners) {}
12861304

12871305
bool isSet() const { return AllocaDecl; }
12881306
static OpenACCReductionRecipe Empty() {
1289-
return OpenACCReductionRecipe(/*AllocaDecl=*/nullptr);
1307+
return OpenACCReductionRecipe(/*AllocaDecl=*/nullptr, {});
12901308
}
12911309
};
12921310

clang/include/clang/ASTMatchers/GtestMatchers.h

Lines changed: 0 additions & 87 deletions
This file was deleted.

clang/include/clang/Basic/Attr.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4944,6 +4944,7 @@ def HLSLResourceBinding: InheritableAttr {
49444944
std::optional<unsigned> SlotNumber;
49454945
unsigned SpaceNumber;
49464946
std::optional<unsigned> ImplicitBindingOrderID;
4947+
std::optional<unsigned> ImplicitCounterBindingOrderID;
49474948

49484949
public:
49494950
void setBinding(RegisterType RT, std::optional<unsigned> SlotNum, unsigned SpaceNum) {
@@ -4976,6 +4977,17 @@ def HLSLResourceBinding: InheritableAttr {
49764977
assert(hasImplicitBindingOrderID() && "attribute does not have implicit binding order id");
49774978
return ImplicitBindingOrderID.value();
49784979
}
4980+
void setImplicitCounterBindingOrderID(uint32_t Value) {
4981+
assert(!hasImplicitCounterBindingOrderID() && "attribute already has implicit counter binding order id");
4982+
ImplicitCounterBindingOrderID = Value;
4983+
}
4984+
bool hasImplicitCounterBindingOrderID() const {
4985+
return ImplicitCounterBindingOrderID.has_value();
4986+
}
4987+
uint32_t getImplicitCounterBindingOrderID() const {
4988+
assert(hasImplicitCounterBindingOrderID() && "attribute does not have implicit counter binding order id");
4989+
return ImplicitCounterBindingOrderID.value();
4990+
}
49794991
}];
49804992
}
49814993

0 commit comments

Comments
 (0)