Skip to content

Commit 295fe33

Browse files
committed
Merge "merge main into amd-staging" into amd-staging
2 parents 2370736 + 702bf59 commit 295fe33

File tree

184 files changed

+3532
-4731
lines changed

Some content is hidden

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

184 files changed

+3532
-4731
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
version: 2
2-
updates:
3-
- package-ecosystem: "pip" # See documentation for possible values
4-
directory: "/amd/hipcc/docs/sphinx" # Location of package manifests
5-
open-pull-requests-limit: 10
6-
schedule:
7-
interval: "daily"
8-
labels:
9-
- "documentation"
10-
reviewers:
11-
- "samjwu"
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"
11+
- package-ecosystem: "pip" # See documentation for possible values
12+
directory: "/amd/hipcc/docs/sphinx" # Location of package manifests
13+
open-pull-requests-limit: 10
14+
schedule:
15+
interval: "daily"
16+
labels:
17+
- "documentation"
18+
reviewers:
19+
- "samjwu"

.github/workflows/release-binaries.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
steps:
3939
- name: Checkout LLVM
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4141

4242
- name: Validate and parse tag
4343
id: validate-tag
@@ -77,15 +77,15 @@ jobs:
7777
- ubuntu-22.04
7878
steps:
7979
- name: Checkout LLVM
80-
uses: actions/checkout@v4
80+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
8181
with:
8282
ref: ${{ needs.prepare.outputs.ref }}
8383

8484
- name: Install Ninja
85-
uses: llvm/actions/install-ninja@main
85+
uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main
8686

8787
- name: Setup sccache
88-
uses: hendrikmuhs/ccache-action@v1
88+
uses: hendrikmuhs/ccache-action@ca3acd2731eef11f1572ccb126356c2f9298d35e # v1.2.9
8989
with:
9090
max-size: 250M
9191
key: sccache-${{ matrix.os }}-release
@@ -119,13 +119,13 @@ jobs:
119119
120120
steps:
121121
- name: Checkout LLVM
122-
uses: actions/checkout@v4
122+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
123123
with:
124124
ref: ${{ needs.prepare.outputs.ref }}
125125
path: ${{ needs.prepare.outputs.build-dir }}/llvm-project
126126

127127
- name: Setup sccache
128-
uses: hendrikmuhs/ccache-action@v1
128+
uses: hendrikmuhs/ccache-action@ca3acd2731eef11f1572ccb126356c2f9298d35e # v1.2.9
129129
with:
130130
max-size: 250M
131131
key: sccache-${{ matrix.target.os }}-release

.github/workflows/release-tasks.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
echo "release-version=$release_version" >> "$GITHUB_OUTPUT"
2626
2727
- name: Checkout LLVM
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2929

3030
- name: Install Dependencies
3131
run: |
@@ -36,7 +36,7 @@ jobs:
3636
python3-github \
3737
ninja-build \
3838
texlive-font-utils
39-
pip3 install --user -r ./llvm/docs/requirements.txt
39+
pip3 install --user --require-hashes -r ./llvm/docs/requirements-hashed.txt
4040
4141
- name: Create Release
4242
run: |
@@ -48,14 +48,14 @@ jobs:
4848
./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files ./*doxygen*.tar.xz
4949
5050
- name: Create Release Notes Artifact
51-
uses: actions/upload-artifact@v3
51+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
5252
with:
5353
name: release-notes
5454
path: docs-build/html-export/
5555

5656
- name: Clone www-releases
5757
if: ${{ !contains(steps.validate-tag.outputs.release-version, 'rc') }}
58-
uses: actions/checkout@v4
58+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5959
with:
6060
repository: ${{ github.repository_owner }}/www-releases
6161
ref: main
@@ -79,10 +79,10 @@ jobs:
7979
if: github.repository == 'llvm/llvm-project'
8080
steps:
8181
- name: Checkout LLVM
82-
uses: actions/checkout@v4
82+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
8383

8484
- name: Setup Cpp
85-
uses: aminya/setup-cpp@v1
85+
uses: aminya/setup-cpp@6e563b8e5f796db317104d19605a414345807897 # v1
8686
with:
8787
compiler: llvm-16.0.6
8888
cmake: true
@@ -108,14 +108,14 @@ jobs:
108108
python3 setup.py sdist
109109
110110
- name: Upload lit to test.pypi.org
111-
uses: pypa/gh-action-pypi-publish@release/v1
111+
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # release/v1
112112
with:
113113
password: ${{ secrets.LLVM_LIT_TEST_PYPI_API_TOKEN }}
114114
repository-url: https://test.pypi.org/legacy/
115115
packages-dir: llvm/utils/lit/dist/
116116

117117
- name: Upload lit to pypi.org
118-
uses: pypa/gh-action-pypi-publish@release/v1
118+
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # release/v1
119119
with:
120120
password: ${{ secrets.LLVM_LIT_PYPI_API_TOKEN }}
121121
packages-dir: llvm/utils/lit/dist/

bolt/tools/bat-dump/bat-dump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static std::string GetExecutablePath(const char *Argv0) {
7575
if (llvm::ErrorOr<std::string> P =
7676
llvm::sys::findProgramByName(ExecutablePath))
7777
ExecutablePath = *P;
78-
return std::string(ExecutablePath.str());
78+
return std::string(ExecutablePath);
7979
}
8080

8181
void dumpBATFor(llvm::object::ELFObjectFileBase *InputFile) {

bolt/tools/driver/llvm-bolt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static std::string GetExecutablePath(const char *Argv0) {
174174
if (llvm::ErrorOr<std::string> P =
175175
llvm::sys::findProgramByName(ExecutablePath))
176176
ExecutablePath = *P;
177-
return std::string(ExecutablePath.str());
177+
return std::string(ExecutablePath);
178178
}
179179

180180
int main(int argc, char **argv) {

bolt/tools/heatmap/heatmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static std::string GetExecutablePath(const char *Argv0) {
4646
if (llvm::ErrorOr<std::string> P =
4747
llvm::sys::findProgramByName(ExecutablePath))
4848
ExecutablePath = *P;
49-
return std::string(ExecutablePath.str());
49+
return std::string(ExecutablePath);
5050
}
5151

5252
int main(int argc, char **argv) {

clang-tools-extra/clang-tidy/readability/AvoidNestedConditionalOperatorCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy ----------===//
1+
//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy -------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.

clang-tools-extra/modularize/ModularizeUtilities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ std::error_code ModularizeUtilities::loadSingleHeaderListsAndDependencies(
195195
// Get canonical form.
196196
HeaderFileName = getCanonicalPath(HeaderFileName);
197197
// Save the resulting header file path and dependencies.
198-
HeaderFileNames.push_back(std::string(HeaderFileName.str()));
198+
HeaderFileNames.push_back(std::string(HeaderFileName));
199199
Dependencies[HeaderFileName.str()] = Dependents;
200200
}
201201
return std::error_code();
@@ -248,7 +248,7 @@ std::error_code ModularizeUtilities::loadProblemHeaderList(
248248
// Get canonical form.
249249
HeaderFileName = getCanonicalPath(HeaderFileName);
250250
// Save the resulting header file path.
251-
ProblemFileNames.push_back(std::string(HeaderFileName.str()));
251+
ProblemFileNames.push_back(std::string(HeaderFileName));
252252
}
253253
return std::error_code();
254254
}

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@ C Language Changes
240240
- Enums will now be represented in TBAA metadata using their actual underlying
241241
integer type. Previously they were treated as chars, which meant they could
242242
alias with all other types.
243-
- Clang now supports the C-only attribute ``counted_by``. When applied to a
244-
struct's flexible array member, it points to the struct field that holds the
245-
number of elements in the flexible array member. This information can improve
246-
the results of the array bound sanitizer and the
247-
``__builtin_dynamic_object_size`` builtin.
248243

249244
C23 Feature Support
250245
^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/DeclBase.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "clang/AST/SelectorLocationsKind.h"
2020
#include "clang/Basic/IdentifierTable.h"
2121
#include "clang/Basic/LLVM.h"
22-
#include "clang/Basic/LangOptions.h"
2322
#include "clang/Basic/SourceLocation.h"
2423
#include "clang/Basic/Specifiers.h"
2524
#include "llvm/ADT/ArrayRef.h"
@@ -489,15 +488,6 @@ class alignas(8) Decl {
489488
// Return true if this is a FileContext Decl.
490489
bool isFileContextDecl() const;
491490

492-
/// Whether it resembles a flexible array member. This is a static member
493-
/// because we want to be able to call it with a nullptr. That allows us to
494-
/// perform non-Decl specific checks based on the object's type and strict
495-
/// flex array level.
496-
static bool isFlexibleArrayMemberLike(
497-
ASTContext &Context, const Decl *D, QualType Ty,
498-
LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel,
499-
bool IgnoreTemplateOrMacroSubstitution);
500-
501491
ASTContext &getASTContext() const LLVM_READONLY;
502492

503493
/// Helper to get the language options from the ASTContext.

clang/include/clang/Analysis/FlowSensitive/Formula.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ class alignas(const Formula *) Formula {
7575
return static_cast<bool>(Value);
7676
}
7777

78+
bool isLiteral(bool b) const {
79+
return kind() == Literal && static_cast<bool>(Value) == b;
80+
}
81+
7882
ArrayRef<const Formula *> operands() const {
7983
return ArrayRef(reinterpret_cast<Formula *const *>(this + 1),
8084
numOperands(kind()));

clang/include/clang/Basic/Attr.td

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,21 +4393,3 @@ def CodeAlign: StmtAttr {
43934393
static constexpr int MaximumAlignment = 4096;
43944394
}];
43954395
}
4396-
4397-
def CountedBy : InheritableAttr {
4398-
let Spellings = [Clang<"counted_by">];
4399-
let Subjects = SubjectList<[Field]>;
4400-
let Args = [IdentifierArgument<"CountedByField">];
4401-
let Documentation = [CountedByDocs];
4402-
let LangOpts = [COnly];
4403-
// FIXME: This is ugly. Let using a DeclArgument would be nice, but a Decl
4404-
// isn't yet available due to the fact that we're still parsing the
4405-
// structure. Maybe that code could be changed sometime in the future.
4406-
code AdditionalMembers = [{
4407-
private:
4408-
SourceRange CountedByFieldLoc;
4409-
public:
4410-
SourceRange getCountedByFieldLoc() const { return CountedByFieldLoc; }
4411-
void setCountedByFieldLoc(SourceRange Loc) { CountedByFieldLoc = Loc; }
4412-
}];
4413-
}

clang/include/clang/Basic/AttrDocs.td

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -7797,81 +7797,3 @@ but do not pass them to the underlying coroutine or pass them by value.
77977797
.. _`CRT`: https://clang.llvm.org/docs/AttributeReference.html#coro-return-type
77987798
}];
77997799
}
7800-
7801-
def CountedByDocs : Documentation {
7802-
let Category = DocCatField;
7803-
let Content = [{
7804-
Clang supports the ``counted_by`` attribute on the flexible array member of a
7805-
structure in C. The argument for the attribute is the name of a field member
7806-
holding the count of elements in the flexible array. This information can be
7807-
used to improve the results of the array bound sanitizer and the
7808-
``__builtin_dynamic_object_size`` builtin. The ``count`` field member must be
7809-
within the same non-anonymous, enclosing struct as the flexible array member.
7810-
7811-
This example specifies that the flexible array member ``array`` has the number
7812-
of elements allocated for it in ``count``:
7813-
7814-
.. code-block:: c
7815-
7816-
struct bar;
7817-
7818-
struct foo {
7819-
size_t count;
7820-
char other;
7821-
struct bar *array[] __attribute__((counted_by(count)));
7822-
};
7823-
7824-
This establishes a relationship between ``array`` and ``count``. Specifically,
7825-
``array`` must have at least ``count`` number of elements available. It's the
7826-
user's responsibility to ensure that this relationship is maintained through
7827-
changes to the structure.
7828-
7829-
In the following example, the allocated array erroneously has fewer elements
7830-
than what's specified by ``p->count``. This would result in an out-of-bounds
7831-
access not being detected.
7832-
7833-
.. code-block:: c
7834-
7835-
#define SIZE_INCR 42
7836-
7837-
struct foo *p;
7838-
7839-
void foo_alloc(size_t count) {
7840-
p = malloc(MAX(sizeof(struct foo),
7841-
offsetof(struct foo, array[0]) + count * sizeof(struct bar *)));
7842-
p->count = count + SIZE_INCR;
7843-
}
7844-
7845-
The next example updates ``p->count``, but breaks the relationship requirement
7846-
that ``p->array`` must have at least ``p->count`` number of elements available:
7847-
7848-
.. code-block:: c
7849-
7850-
#define SIZE_INCR 42
7851-
7852-
struct foo *p;
7853-
7854-
void foo_alloc(size_t count) {
7855-
p = malloc(MAX(sizeof(struct foo),
7856-
offsetof(struct foo, array[0]) + count * sizeof(struct bar *)));
7857-
p->count = count;
7858-
}
7859-
7860-
void use_foo(int index, int val) {
7861-
p->count += SIZE_INCR + 1; /* 'count' is now larger than the number of elements of 'array'. */
7862-
p->array[index] = val; /* The sanitizer can't properly check this access. */
7863-
}
7864-
7865-
In this example, an update to ``p->count`` maintains the relationship
7866-
requirement:
7867-
7868-
.. code-block:: c
7869-
7870-
void use_foo(int index, int val) {
7871-
if (p->count == 0)
7872-
return;
7873-
--p->count;
7874-
p->array[index] = val;
7875-
}
7876-
}];
7877-
}

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6447,19 +6447,6 @@ def warn_superclass_variable_sized_type_not_at_end : Warning<
64476447
"field %0 can overwrite instance variable %1 with variable sized type %2"
64486448
" in superclass %3">, InGroup<ObjCFlexibleArray>;
64496449

6450-
def err_flexible_array_count_not_in_same_struct : Error<
6451-
"'counted_by' field %0 isn't within the same struct as the flexible array">;
6452-
def err_counted_by_attr_not_on_flexible_array_member : Error<
6453-
"'counted_by' only applies to C99 flexible array members">;
6454-
def err_counted_by_attr_refers_to_flexible_array : Error<
6455-
"'counted_by' cannot refer to the flexible array %0">;
6456-
def err_counted_by_must_be_in_structure : Error<
6457-
"field %0 in 'counted_by' not inside structure">;
6458-
def err_flexible_array_counted_by_attr_field_not_integer : Error<
6459-
"field %0 in 'counted_by' must be a non-boolean integer type">;
6460-
def note_flexible_array_counted_by_attr_field : Note<
6461-
"field %0 declared here">;
6462-
64636450
let CategoryName = "ARC Semantic Issue" in {
64646451

64656452
// ARC-mode diagnostics.

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4803,8 +4803,6 @@ class Sema final {
48034803
bool CheckAlwaysInlineAttr(const Stmt *OrigSt, const Stmt *CurSt,
48044804
const AttributeCommonInfo &A);
48054805

4806-
bool CheckCountedByAttr(Scope *Scope, const FieldDecl *FD);
4807-
48084806
/// Adjust the calling convention of a method to be the ABI default if it
48094807
/// wasn't specified explicitly. This handles method types formed from
48104808
/// function type typedefs and typename template arguments.
@@ -5648,7 +5646,6 @@ class Sema final {
56485646
CorrectionCandidateCallback &CCC,
56495647
TemplateArgumentListInfo *ExplicitTemplateArgs = nullptr,
56505648
ArrayRef<Expr *> Args = std::nullopt,
5651-
DeclContext *LookupCtx = nullptr,
56525649
TypoExpr **Out = nullptr);
56535650

56545651
DeclResult LookupIvarInObjCMethod(LookupResult &Lookup, Scope *S,

0 commit comments

Comments
 (0)