[lldb] [libc] [clang] [llvm] [mlir] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-04 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/76882 >From ca7a96a40952fe94b916dacc52f07aa90bbdb1e7 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 3 Jan 2024 13:22:37 -0800 Subject: [PATCH 1/6] [builtin_object_size] Use classes instead of std::pair (NFC

[lldb] [llvm] [mlir] [libc] [clang] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-04 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/76882 >From ca7a96a40952fe94b916dacc52f07aa90bbdb1e7 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 3 Jan 2024 13:22:37 -0800 Subject: [PATCH 1/7] [builtin_object_size] Use classes instead of std::pair (NFC

[lldb] [llvm] [mlir] [libc] [clang] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-04 Thread Bill Wendling via cfe-commits
@@ -187,80 +187,124 @@ Value *lowerObjectSizeCall( const TargetLibraryInfo *TLI, AAResults *AA, bool MustSucceed, SmallVectorImpl *InsertedInstructions = nullptr); -using SizeOffsetType = std::pair; +/// SizeOffsetType - A base template class for the object size visito

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-04 Thread Bill Wendling via cfe-commits
bwendling wrote: Pinging for after-holidays visibility. :-) https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [llvm] [libc] [mlir] [clang] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-05 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/76882 >From ca7a96a40952fe94b916dacc52f07aa90bbdb1e7 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 3 Jan 2024 13:22:37 -0800 Subject: [PATCH 1/9] [builtin_object_size] Use classes instead of std::pair (NFC

[lldb] [llvm] [libc] [mlir] [clang] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-05 Thread Bill Wendling via cfe-commits
@@ -187,80 +187,132 @@ Value *lowerObjectSizeCall( const TargetLibraryInfo *TLI, AAResults *AA, bool MustSucceed, SmallVectorImpl *InsertedInstructions = nullptr); -using SizeOffsetType = std::pair; +/// SizeOffsetType - A base template class for the object size visito

[lldb] [llvm] [libc] [mlir] [clang] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-05 Thread Bill Wendling via cfe-commits
https://github.com/bwendling closed https://github.com/llvm/llvm-project/pull/76882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [mlir] [llvm] [libc] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-07 Thread Bill Wendling via cfe-commits
bwendling wrote: > Hi @bwendling, your change to MemoryBuiltins.h is hitting an error in the > version of Visual Studio 2019 that we use internally to build: > > ``` > C:\j\w\779ddbee\p\llvm\include\llvm/Analysis/MemoryBuiltins.h(217): error > C2990: 'llvm::SizeOffsetType': non-class template

[libc] [llvm] [mlir] [clang] [lldb] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-07 Thread Bill Wendling via cfe-commits
bwendling wrote: Actually, that fix was making all of the other builds fail: ``` /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/Analysis/MemoryBuiltins.h:279:47: error: specialization of ‘llvm::SizeOffsetType’ after instantiation 279 | template friend class SizeOffsetType; |

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -365,6 +365,10 @@ class DefaultFilterCCC final : public CorrectionCandidateCallback { template class DeclFilterCCC final : public CorrectionCandidateCallback { public: + explicit DeclFilterCCC(const IdentifierInfo *Typo = nullptr, + NestedNameSpeci

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -818,6 +819,189 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } +const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( +ASTContext &Ctx, const RecordDecl *R

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -850,6 +1034,13 @@ CodeGenFunction::emitBuiltinObjectSize(const Expr *E, unsigned Type, } } + if (IsDynamic) { +// Emit special code for a flexible array member with the "counted_by" +// attribute. +if (Value *V = emitFlexibleArrayMemberSize(E, Type, Res

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -944,22 +951,259 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } +namespace { + +/// \p StructAccessBase returns the base \p Expr of a field access. It returns +/// either a \p DeclRefExpr, representing the base pointer to the struct,

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -1155,15 +1159,14 @@ const FieldDecl *CodeGenFunction::FindCountedByField(const FieldDecl *FD) { return nullptr; auto GetNonAnonStructOrUnion = [](const RecordDecl *RD) { -while (RD && !RD->getDeclName()) - if (const auto *R = dyn_cast(RD->getDeclContext()))

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -818,6 +819,189 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } +const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( +ASTContext &Ctx, const RecordDecl *R

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -818,6 +819,189 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } +const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( +ASTContext &Ctx, const RecordDecl *R

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -944,22 +951,259 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } +namespace { + +/// \p StructAccessBase returns the base \p Expr of a field access. It returns +/// either a \p DeclRefExpr, representing the base pointer to the struct,

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -944,22 +951,262 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } +namespace { + +/// \p StructAccessBase returns the base \p Expr of a field access. It returns +/// either a \p DeclRefExpr, representing the base pointer to the struct,

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -944,22 +951,259 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } +namespace { + +/// \p StructAccessBase returns the base \p Expr of a field access. It returns +/// either a \p DeclRefExpr, representing the base pointer to the struct,

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -818,6 +819,189 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } +const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( +ASTContext &Ctx, const RecordDecl *R

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -818,6 +819,189 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } +const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( +ASTContext &Ctx, const RecordDecl *R

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
bwendling wrote: @kees Should be fixed now. https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -944,22 +951,259 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } +namespace { + +/// \p StructAccessBase returns the base \p Expr of a field access. It returns +/// either a \p DeclRefExpr, representing the base pointer to the struct,

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-08 Thread Bill Wendling via cfe-commits
@@ -818,6 +819,189 @@ CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type, return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true); } +const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberField( +ASTContext &Ctx, const RecordDecl *R

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-09 Thread Bill Wendling via cfe-commits
bwendling wrote: @kees, the issue should be fixed with the newest push. https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-09 Thread Bill Wendling via cfe-commits
bwendling wrote: > > @kees, the issue should be fixed with the newest push. > > Nice! This is so extremely close. It fixed all but 1 instance in the torture > testing. The remaining seems to be union order sensitive. O_o This > arrangement still reports non-zero for the `int count_bytes` one,

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-09 Thread Bill Wendling via cfe-commits
bwendling wrote: Like I said, I can fix the `mi->ints` issue. It's when we're trying to ask for the size of the whole struct with more than one `__counted_by` attribute that we don't be able to handle. https://github.com/llvm/llvm-project/pull/76348

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-10 Thread Bill Wendling via cfe-commits
bwendling wrote: @kees Could you supply a pre-processed file and command line? (It should have been emitted when you got the backtrace.) https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-10 Thread Bill Wendling via cfe-commits
bwendling wrote: Never mind. I think I found the issue anyway... https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-10 Thread Bill Wendling via cfe-commits
bwendling wrote: @rapidsna & @nickdesaulniers: Do you have anything to add? https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-10 Thread Bill Wendling via cfe-commits
bwendling wrote: Thanks everyone for their insightful feedback!! https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-10 Thread Bill Wendling via cfe-commits
https://github.com/bwendling closed https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4a3fb9c - [Clang] Update 'counted_by' documentation

2024-01-10 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2024-01-10T15:36:33-08:00 New Revision: 4a3fb9ce27dda17e97341f28005a28836c909cfc URL: https://github.com/llvm/llvm-project/commit/4a3fb9ce27dda17e97341f28005a28836c909cfc DIFF: https://github.com/llvm/llvm-project/commit/4a3fb9ce27dda17e97341f28005a28836c909cfc.diff

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-10 Thread Bill Wendling via cfe-commits
bwendling wrote: Resubmitted with fix. Sorry about the failures: ``` To https://github.com/llvm/llvm-project.git e8790027b169..164f85db876e main -> main ``` https://github.com/llvm/llvm-project/pull/76348 ___ cfe-commits mailing list cfe-commits@l

[clang] 3f0587d - [randstruct] Add randomize structure layout support

2022-04-08 Thread Bill Wendling via cfe-commits
Author: Connor Kuehl Date: 2022-04-08T12:48:30-07:00 New Revision: 3f0587d0c668202bb89d29a25432aa290e551a31 URL: https://github.com/llvm/llvm-project/commit/3f0587d0c668202bb89d29a25432aa290e551a31 DIFF: https://github.com/llvm/llvm-project/commit/3f0587d0c668202bb89d29a25432aa290e551a31.diff

[clang] 893e1c1 - [randstruct] add expected output for WIN64

2022-04-08 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-08T14:42:12-07:00 New Revision: 893e1c18b98d8bbc7b8d7d22cc2c348f65c72ad9 URL: https://github.com/llvm/llvm-project/commit/893e1c18b98d8bbc7b8d7d22cc2c348f65c72ad9 DIFF: https://github.com/llvm/llvm-project/commit/893e1c18b98d8bbc7b8d7d22cc2c348f65c72ad9.diff

[clang] e2e6899 - [randstruct] disable test for Windows for now.

2022-04-08 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-08T16:00:41-07:00 New Revision: e2e6899452998932b37f0fa9e66d104a02abe3e5 URL: https://github.com/llvm/llvm-project/commit/e2e6899452998932b37f0fa9e66d104a02abe3e5 DIFF: https://github.com/llvm/llvm-project/commit/e2e6899452998932b37f0fa9e66d104a02abe3e5.diff

[clang] 8d7595b - [randstruct] temporarily remove test that's failing

2022-04-08 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-08T17:04:22-07:00 New Revision: 8d7595be1dd41d7f7470ec90867936ca5e4e0d82 URL: https://github.com/llvm/llvm-project/commit/8d7595be1dd41d7f7470ec90867936ca5e4e0d82 DIFF: https://github.com/llvm/llvm-project/commit/8d7595be1dd41d7f7470ec90867936ca5e4e0d82.diff

[clang] 2a2149c - [randstruct] Remove RandstructTest.cpp from list

2022-04-08 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-08T17:41:36-07:00 New Revision: 2a2149c754f96376ddf8fed248102dd8e6092a22 URL: https://github.com/llvm/llvm-project/commit/2a2149c754f96376ddf8fed248102dd8e6092a22 DIFF: https://github.com/llvm/llvm-project/commit/2a2149c754f96376ddf8fed248102dd8e6092a22.diff

[clang] 7aa8c38 - [randstruct] Add randomize structure layout support

2022-04-09 Thread Bill Wendling via cfe-commits
Author: Connor Kuehl Date: 2022-04-09T13:15:36-07:00 New Revision: 7aa8c38a9e190aea14116028c38b1d9f54cbb0b3 URL: https://github.com/llvm/llvm-project/commit/7aa8c38a9e190aea14116028c38b1d9f54cbb0b3 DIFF: https://github.com/llvm/llvm-project/commit/7aa8c38a9e190aea14116028c38b1d9f54cbb0b3.diff

[clang] 77e71bc - [randstruct] NFC change to use static

2022-04-09 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-09T13:25:25-07:00 New Revision: 77e71bcfde7264466849babaa0e9ccbec51a8a08 URL: https://github.com/llvm/llvm-project/commit/77e71bcfde7264466849babaa0e9ccbec51a8a08 DIFF: https://github.com/llvm/llvm-project/commit/77e71bcfde7264466849babaa0e9ccbec51a8a08.diff

[clang] 31ea479 - [randstruct] Add test for "-frandomize-layout-seed-file" flag

2022-04-14 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-14T15:41:25-07:00 New Revision: 31ea4798ad0990838ccd27f80ca112f177ce91d9 URL: https://github.com/llvm/llvm-project/commit/31ea4798ad0990838ccd27f80ca112f177ce91d9 DIFF: https://github.com/llvm/llvm-project/commit/31ea4798ad0990838ccd27f80ca112f177ce91d9.diff

[clang] 27dead3 - Revert "[randstruct] Add test for "-frandomize-layout-seed-file" flag"

2022-04-14 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-14T16:07:00-07:00 New Revision: 27dead3e3a532625704654a0b66d77f8654d1af2 URL: https://github.com/llvm/llvm-project/commit/27dead3e3a532625704654a0b66d77f8654d1af2 DIFF: https://github.com/llvm/llvm-project/commit/27dead3e3a532625704654a0b66d77f8654d1af2.diff

[clang] 8c77a75 - [randstruct] Add test for "-frandomize-layout-seed-file" flag

2022-04-14 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-14T16:35:41-07:00 New Revision: 8c77a75fb6a82a4cc2182bca89e007e7190a83de URL: https://github.com/llvm/llvm-project/commit/8c77a75fb6a82a4cc2182bca89e007e7190a83de DIFF: https://github.com/llvm/llvm-project/commit/8c77a75fb6a82a4cc2182bca89e007e7190a83de.diff

[clang] aed923b - [randstruct] Enforce using a designated init for a randomized struct

2022-04-15 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-15T12:29:32-07:00 New Revision: aed923b1246ac38335b222b89594516fcf0d6385 URL: https://github.com/llvm/llvm-project/commit/aed923b1246ac38335b222b89594516fcf0d6385 DIFF: https://github.com/llvm/llvm-project/commit/aed923b1246ac38335b222b89594516fcf0d6385.diff

[clang] 2a404cd - [randstruct] Force errors for all platforms

2022-04-15 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-15T15:17:07-07:00 New Revision: 2a404cdfd8bc75de593ce0e15fff0a7a0a18ec1c URL: https://github.com/llvm/llvm-project/commit/2a404cdfd8bc75de593ce0e15fff0a7a0a18ec1c DIFF: https://github.com/llvm/llvm-project/commit/2a404cdfd8bc75de593ce0e15fff0a7a0a18ec1c.diff

[clang] 7f31b4a - [randstruct] Enforce using a designated init for a randomized struct

2022-04-16 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-16T23:24:48-07:00 New Revision: 7f31b4a917d8cc13df5eac4b7f0520639c3a8fff URL: https://github.com/llvm/llvm-project/commit/7f31b4a917d8cc13df5eac4b7f0520639c3a8fff DIFF: https://github.com/llvm/llvm-project/commit/7f31b4a917d8cc13df5eac4b7f0520639c3a8fff.diff

[clang] deaf22b - [X86] Implement -fzero-call-used-regs option

2022-02-08 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-02-08T17:42:54-08:00 New Revision: deaf22bc0e306bc44c70d2503e9364b5ed312c49 URL: https://github.com/llvm/llvm-project/commit/deaf22bc0e306bc44c70d2503e9364b5ed312c49 DIFF: https://github.com/llvm/llvm-project/commit/deaf22bc0e306bc44c70d2503e9364b5ed312c49.diff

[clang] 86bde99 - Insert a blurb about the -fzero-call-used-regs feature

2022-02-15 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-02-15T00:06:58-08:00 New Revision: 86bde99a9027f875383e38bfd3a863abae3d0e75 URL: https://github.com/llvm/llvm-project/commit/86bde99a9027f875383e38bfd3a863abae3d0e75 DIFF: https://github.com/llvm/llvm-project/commit/86bde99a9027f875383e38bfd3a863abae3d0e75.diff

[clang] a7815d3 - [randstruct] Check final randomized layout ordering

2022-04-21 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-21T19:41:00-07:00 New Revision: a7815d33bf8f955f2a1888abbccf974bd4858f79 URL: https://github.com/llvm/llvm-project/commit/a7815d33bf8f955f2a1888abbccf974bd4858f79 DIFF: https://github.com/llvm/llvm-project/commit/a7815d33bf8f955f2a1888abbccf974bd4858f79.diff

Re: [PATCH] D124199: [randstruct] Check final randomized layout ordering

2022-04-21 Thread Bill Wendling via cfe-commits
Maskray? On Thu, Apr 21, 2022 at 8:00 PM Nico Weber via Phabricator < revi...@reviews.llvm.org> wrote: > thakis added a comment. > > Looks like this breaks tests on windows: > http://45.33.8.238/win/56771/step_7.txt > > Please take a look and revert for now if it takes a while to fix. > > > Repos

[clang] 463790b - [randstruct] Randomize all elements of a record

2022-04-28 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-28T12:01:11-07:00 New Revision: 463790bfc70e15f9c23b76f1c53e228b644f8bb1 URL: https://github.com/llvm/llvm-project/commit/463790bfc70e15f9c23b76f1c53e228b644f8bb1 DIFF: https://github.com/llvm/llvm-project/commit/463790bfc70e15f9c23b76f1c53e228b644f8bb1.diff

[clang] 6f79700 - [randstruct] Automatically randomize a structure of function pointers

2022-04-29 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-04-29T11:05:09-07:00 New Revision: 6f79700830292d86afec5f3cf5143b00e6f3f1fd URL: https://github.com/llvm/llvm-project/commit/6f79700830292d86afec5f3cf5143b00e6f3f1fd DIFF: https://github.com/llvm/llvm-project/commit/6f79700830292d86afec5f3cf5143b00e6f3f1fd.diff

[clang] f2639cf - [randstruct] Move initializer check to be more effective

2022-05-03 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-05-03T11:23:12-07:00 New Revision: f2639cf3fe46c30ad450cc2533c81eacd4788c33 URL: https://github.com/llvm/llvm-project/commit/f2639cf3fe46c30ad450cc2533c81eacd4788c33 DIFF: https://github.com/llvm/llvm-project/commit/f2639cf3fe46c30ad450cc2533c81eacd4788c33.diff

[clang] 6e00a34 - [AArch64] Add support for -fzero-call-used-regs

2022-05-19 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-05-19T16:58:28-07:00 New Revision: 6e00a34cdb49ba1d4b72ec274e52260da9c52380 URL: https://github.com/llvm/llvm-project/commit/6e00a34cdb49ba1d4b72ec274e52260da9c52380 DIFF: https://github.com/llvm/llvm-project/commit/6e00a34cdb49ba1d4b72ec274e52260da9c52380.diff

[clang] [NFC][IdentifierInfo] Use llvm::Bitfield for the bitfield (PR #79366)

2024-03-19 Thread Bill Wendling via cfe-commits
https://github.com/bwendling closed https://github.com/llvm/llvm-project/pull/79366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-03-19 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/80256 >From d08abc7a9454557ffa43fc14611177f2c4e7fba4 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 31 Jan 2024 13:07:53 -0800 Subject: [PATCH] [Clang] Convert __builtin_dynamic_object_size into a calculati

[clang] [Clang][objectsize] Generate object size calculation for sub-objects (PR #86858)

2024-03-27 Thread Bill Wendling via cfe-commits
https://github.com/bwendling created https://github.com/llvm/llvm-project/pull/86858 The second argument of __builtin_dynamic_object_size controls whether it returns the size of the whole object or the closest surrounding object. For this struct: struct s { int foo; char bar[2][40];

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-05 Thread Bill Wendling via cfe-commits
bwendling wrote: Friendly ping. https://github.com/llvm/llvm-project/pull/83204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-11 Thread Bill Wendling via cfe-commits
bwendling wrote: Another ping. https://github.com/llvm/llvm-project/pull/83204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-11 Thread Bill Wendling via cfe-commits
@@ -26996,18 +26996,38 @@ class, structure, array, or other object. Arguments: "" -The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a -pointer to or into the ``object``. The second argument determines whether -``llvm.objectsize`` returns 0

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-11 Thread Bill Wendling via cfe-commits
@@ -26996,18 +26996,38 @@ class, structure, array, or other object. Arguments: "" -The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a -pointer to or into the ``object``. The second argument determines whether -``llvm.objectsize`` returns 0

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-11 Thread Bill Wendling via cfe-commits
@@ -1052,11 +1053,143 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// SubobjectFinder - A simple visitor to find the "sub-object" pointed to b

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-12 Thread Bill Wendling via cfe-commits
@@ -26996,18 +26996,38 @@ class, structure, array, or other object. Arguments: "" -The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a -pointer to or into the ``object``. The second argument determines whether -``llvm.objectsize`` returns 0

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-12 Thread Bill Wendling via cfe-commits
@@ -26996,18 +26996,38 @@ class, structure, array, or other object. Arguments: "" -The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a -pointer to or into the ``object``. The second argument determines whether -``llvm.objectsize`` returns 0

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-03-12 Thread Bill Wendling via cfe-commits
@@ -26996,18 +26996,38 @@ class, structure, array, or other object. Arguments: "" -The ``llvm.objectsize`` intrinsic takes four arguments. The first argument is a -pointer to or into the ``object``. The second argument determines whether -``llvm.objectsize`` returns 0

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-02-27 Thread Bill Wendling via cfe-commits
bwendling wrote: The first PR attempt was here: https://github.com/llvm/llvm-project/pull/78526 It was NACK'ed because it used the LLVM IR representation of the structure, which wasn't appropriate. To solve that issue, I chose to expand the `llvm.objectsize()` builtin to contain the size and o

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #83204)

2024-02-27 Thread Bill Wendling via cfe-commits
https://github.com/bwendling edited https://github.com/llvm/llvm-project/pull/83204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-31 Thread Bill Wendling via cfe-commits
https://github.com/bwendling closed https://github.com/llvm/llvm-project/pull/78526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-01-31 Thread Bill Wendling via cfe-commits
https://github.com/bwendling created https://github.com/llvm/llvm-project/pull/80256 If we're able to, we convert a call to __builtin_dynamic_object_size into a calculation. This is a cleaner implementation, and has the potential to improve optimizations and, especially, inlining, because opti

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-01-31 Thread Bill Wendling via cfe-commits
bwendling wrote: This is a first step in improving our `__bdos` implementation. It doesn't address the "sub-object" discussion from the previous PR (https://github.com/llvm/llvm-project/pull/78526), that will come later on. This patch takes care of a common use of `__bdos` that can't be calcul

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-05 Thread Bill Wendling via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union type

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-05 Thread Bill Wendling via cfe-commits
https://github.com/bwendling edited https://github.com/llvm/llvm-project/pull/80256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-05 Thread Bill Wendling via cfe-commits
https://github.com/bwendling edited https://github.com/llvm/llvm-project/pull/80256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Convert __builtin_dynamic_object_size into a calculation (PR #80256)

2024-02-05 Thread Bill Wendling via cfe-commits
@@ -1051,6 +1052,145 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type, return Builder.CreateSelect(Cmp, Res, ConstantInt::get(ResType, 0, IsSigned)); } +namespace { + +/// \p StructBaseExpr returns the base \p Expr with a structure or union type

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-23 Thread Bill Wendling via cfe-commits
bwendling wrote: It matches my understanding too. There are more issues with `__bdos` that arose due to this discussion and related discussions with the GCC maintainers. I'm exploring some ways of fixing this issue: * As @efriedma-quic mentioned, generating the size calculation in the front en

[clang] [Clang][IdentifierInfo] Use llvm::Bitfield for the bitfield (PR #79366)

2024-01-24 Thread Bill Wendling via cfe-commits
https://github.com/bwendling created https://github.com/llvm/llvm-project/pull/79366 llvm::Bitfield is a nicer way to represent bitfields in the compiler. >From 047a96905b4169faf19de30d322943f46cd2fc2a Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 24 Jan 2024 12:09:28 -0800 Subject:

[clang] [NFC][IdentifierInfo] Use llvm::Bitfield for the bitfield (PR #79366)

2024-01-24 Thread Bill Wendling via cfe-commits
https://github.com/bwendling edited https://github.com/llvm/llvm-project/pull/79366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [clang] [NFC][Clang] Improve const correctness for IdentifierInfo (PR #79365)

2024-01-24 Thread Bill Wendling via cfe-commits
bwendling wrote: > I'd like to wait a few weeks before we land it, I'm afraid these changes > (which do contain some small white spaces-only changes too) might disrupt the > release process as lot of cherry-picking between main and the llvm18 branch > are happening and we should minimize the o

[clang] [NFC][IdentifierInfo] Use llvm::Bitfield for the bitfield (PR #79366)

2024-01-24 Thread Bill Wendling via cfe-commits
bwendling wrote: It shouldn't be necessary to analyze `uint64_t Storage` directly through a debugger. It's handled via the `Bitfield` getters and setters. Is that not sufficient for debugging purposes? My sinister reason for wanting to do this is that many of the `const_cast(...)` constructs

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-24 Thread Bill Wendling via cfe-commits
bwendling wrote: > > maybe we could add the subtype as part of the llvm.objectsize intrinsic and > > use that instead of grappling with the whole object's type > > I'm not sure I follow; if you know the object's type, doesn't that mean you > also know its size? Not necessarily. If you have so

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-25 Thread Bill Wendling via cfe-commits
bwendling wrote: > > ```c > > struct x { > > int a; > > char foo[2][40]; > > int b; > > int c; > > }; > > > > size_t f(struct x *p, int idx) { > > return __builtin_dynamic_object_size(&p->foo[idx], 1); > > } > > ``` > > If I'm following correctly, the return here is 0, 40, o

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-18 Thread Bill Wendling via cfe-commits
bwendling wrote: > We've discussed this before, years ago. Previously, the sticking point was: > how is LLVM going to know what the frontend considers the closest surrounding > subobject to be? The LLVM type doesn't give you that information, and it > seems like there's nowhere else that LLVM

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-18 Thread Bill Wendling via cfe-commits
bwendling wrote: > Using anything but the size and alignment of the alloca type in a way that > affects program semantics is illegal. I'm sorry, but I don't understand your comment here. Could you supply some context? https://github.com/llvm/llvm-project/pull/78526 ___

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-18 Thread Bill Wendling via cfe-commits
bwendling wrote: > Perhaps according to the GCC documentation as written. But mode 0 and 1 are > in general asking for an upper bound on the accessible bytes (that is, an N > so any.access beyond N bytes is definitely out of bounds), so it seems to me > that returning -1 is strictly worse than

[llvm] [clang] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > @bwendling I think you are reading the GCC docs too pedantically. In > particular, they also say > > If there are multiple objects ptr can point to and all of them are known at > > compile time, the returned number is the maximum of remaining byte counts > > in those object

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > > For unions, clang will use the type of the union member with the largest > > size as the alloca type, regardless of which union member is active. I > > haven't tried, but your patch will probably compute the subobject size > > based on that arbitrarily picked member, rathe

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > > > But mode 0 and 1 are in general asking for an upper bound on the > > > accessible bytes (that is, an N so any.access beyond N bytes is > > > definitely out of bounds), so it seems to me that returning -1 is > > > strictly worse than returning 48. > > > > > > It's the s

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > Taking a step back, while this patch is not the right direction, we can and > should do better for the original example. Probably the best way to do that > is to analyze the operand to `__builtin_[dynamic_]object_size` in the > frontend and compute a better bound based on th

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > > Perhaps we need clarification on what GCC means by "may point to multiple > > objects" in this instance. To me that means either "get me the size of the > > largest of these multiple objects" or "size of the smallest." In my eyes, > > that means pointing to a union field.

[clang] [llvm] [Clang] Correct __builtin_dynamic_object_size for subobject types (PR #78526)

2024-01-19 Thread Bill Wendling via cfe-commits
bwendling wrote: > > My answer for the question "what's the semantics of GCC's builtin X?" has > > always been "whatever GCC does." It's the best we can rely upon. But then > > we get into situations like this, where you and @nikic have one > > interpretation of their documentation and I have

[clang] [Clang] Implement the 'counted_by' attribute (PR #76348)

2024-01-22 Thread Bill Wendling via cfe-commits
bwendling wrote: > @bwendling is there any plan / possibility for simple expressions (with no > side effects)? Like: > > ```c > struct libusb_bos_dev_capability_descriptor { > uint8_t bLength; > uint8_t bDescriptorType; > uint8_t bDevCapabilityType; > uint8_t dev_cap

Re: [PATCH] D69876: Allow output constraints on "asm goto"

2020-01-07 Thread Bill Wendling via cfe-commits
Yeah. I reverted the push. The correct code should be in Phabricator now. :-( On Tue, Jan 7, 2020 at 2:45 PM James Y Knight via Phabricator < revi...@reviews.llvm.org> wrote: > jyknight added a comment. > > I think you pushed the incorrect change? This was the clang half, but now > it's showing t

[clang] 34ca5b3 - Remove stale assert.

2020-09-24 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2020-09-24T13:59:42-07:00 New Revision: 34ca5b3392ced08e2320fb4236cca5c7df4ec6e9 URL: https://github.com/llvm/llvm-project/commit/34ca5b3392ced08e2320fb4236cca5c7df4ec6e9 DIFF: https://github.com/llvm/llvm-project/commit/34ca5b3392ced08e2320fb4236cca5c7df4ec6e9.diff

[clang] f97b68e - Fix testcase.

2020-09-24 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2020-09-24T14:34:28-07:00 New Revision: f97b68ef4ddd28a685e502653768c2a34c314cba URL: https://github.com/llvm/llvm-project/commit/f97b68ef4ddd28a685e502653768c2a34c314cba DIFF: https://github.com/llvm/llvm-project/commit/f97b68ef4ddd28a685e502653768c2a34c314cba.diff

[clang] c9b53b3 - Fix regex in test.

2020-09-24 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2020-09-24T15:21:28-07:00 New Revision: c9b53b3bf20d20d5752876be32a9e5887c702e53 URL: https://github.com/llvm/llvm-project/commit/c9b53b3bf20d20d5752876be32a9e5887c702e53 DIFF: https://github.com/llvm/llvm-project/commit/c9b53b3bf20d20d5752876be32a9e5887c702e53.diff

[clang] b76219b - [clang][Sema] Use correct array size for diagnostic

2022-10-20 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-10-20T11:56:49-07:00 New Revision: b76219b590208c1b539e614247f91481900bd7a1 URL: https://github.com/llvm/llvm-project/commit/b76219b590208c1b539e614247f91481900bd7a1 DIFF: https://github.com/llvm/llvm-project/commit/b76219b590208c1b539e614247f91481900bd7a1.diff

[clang] 283e0a8 - [clang] Correct sanitizer behavior in union FAMs

2022-10-20 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-10-20T16:08:11-07:00 New Revision: 283e0a81ef35deec46aa231cb8b9d826060f532a URL: https://github.com/llvm/llvm-project/commit/283e0a81ef35deec46aa231cb8b9d826060f532a DIFF: https://github.com/llvm/llvm-project/commit/283e0a81ef35deec46aa231cb8b9d826060f532a.diff

[clang] 7f93ae8 - [clang] Implement -fstrict-flex-arrays=3

2022-10-27 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-10-27T10:50:04-07:00 New Revision: 7f93ae808634e33e4dc9bce753c909aa5f9a6eb4 URL: https://github.com/llvm/llvm-project/commit/7f93ae808634e33e4dc9bce753c909aa5f9a6eb4 DIFF: https://github.com/llvm/llvm-project/commit/7f93ae808634e33e4dc9bce753c909aa5f9a6eb4.diff

[clang] 7404b85 - [clang][NFC] Use enum for -fstrict-flex-arrays

2022-10-06 Thread Bill Wendling via cfe-commits
Author: Bill Wendling Date: 2022-10-06T10:45:41-07:00 New Revision: 7404b855e528f88bf2a395a0a14937ca6812e8d1 URL: https://github.com/llvm/llvm-project/commit/7404b855e528f88bf2a395a0a14937ca6812e8d1 DIFF: https://github.com/llvm/llvm-project/commit/7404b855e528f88bf2a395a0a14937ca6812e8d1.diff

<    1   2   3   4   5   6   7   8   >