[clang] [HIP] Do not include the CUID module hash with the new driver (PR #84332)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Joseph Huber (jhuber6) Changes Summary: The new driver does not need this hash and it can lead to redefined symbol errors when the CUID hash isn't set. --- Full diff: https://github.com/llvm/llvm-project/pull/84332.diff 1 Files

[clang] [HIP] Do not include the CUID module hash with the new driver (PR #84332)

2024-03-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/84332 Summary: The new driver does not need this hash and it can lead to redefined symbol errors when the CUID hash isn't set. >From 012ead550448376f4fefd9fb70418e32f02dba6b Mon Sep 17 00:00:00 2001 From: Joseph

[clang] [clang][CodeGen] Allow memcpy replace with trivial auto var init (PR #84230)

2024-03-07 Thread via cfe-commits
satmandu wrote: Will there be a backport for 18.1.x? (The current patch doesn't apply cleanly to 18.1.0.) https://github.com/llvm/llvm-project/pull/84230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-07 Thread via cfe-commits
@@ -641,3 +652,53 @@ bool Sema::CheckRebuiltStmtAttributes(ArrayRef Attrs) { CheckForDuplicateLoopAttrs(*this, Attrs); return false; } + +ExprResult Sema::ActOnCXXAssumeAttr(Stmt *St, const ParsedAttr , +SourceRange Range) { + if

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. I think this is a case of 'cure is worse than the disease'. Unless this implements our 'identifier' rules, it is just going to reject valid code. Any sort of enforcement here on individual characters NEEDS to follow the

[clang] [llvm] [WebAssembly] Implement an alternative translation for -wasm-enable-sjlj (PR #84137)

2024-03-07 Thread Sam Clegg via cfe-commits
@@ -999,25 +1002,42 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runOnModule(Module ) { // Register __wasm_longjmp function, which calls __builtin_wasm_longjmp. FunctionType *FTy = FunctionType::get( IRB.getVoidTy(), {Int8PtrTy, IRB.getInt32Ty()}, false); -

[clang] [llvm] [WebAssembly] Implement an alternative translation for -wasm-enable-sjlj (PR #84137)

2024-03-07 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 edited https://github.com/llvm/llvm-project/pull/84137 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WebAssembly] Implement an alternative translation for -wasm-enable-sjlj (PR #84137)

2024-03-07 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 commented: Thanks for working on this! I'm excited to see this land and become less emscripten-specific. I'm hoping that once we get the emscripten side landed we can remove the new option very soon too. https://github.com/llvm/llvm-project/pull/84137

[clang] [Driver,BareMetal] Replace -lclang_rt.builtins{,-$arch}.a with an absolute path (PR #82424)

2024-03-07 Thread Emil J via cfe-commits
ekliptik wrote: Hi, this broke our downstream. What is the motivation for this, and how is this intended to be used with compiler-rt locations being set by multilib.yaml? We have something similar to what ARM does for multilibs.yaml but with different paths, and this prevents the driver from

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC () { +assert(OpenACCPtr); erichkeane wrote: I don't buy the 'noticeable impact on assertion build'

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC () { +assert(OpenACCPtr); cor3ntin wrote: Sure. But that's not yet the case. I think we should add

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread via cfe-commits
cor3ntin wrote: > Thank you for all the reviews, I will wait 1 or 2 days before merging it in > case anyone has more comments. Sure! Do you plan to keep working on completing this feature? https://github.com/llvm/llvm-project/pull/77890 ___

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC () { +assert(OpenACCPtr); erichkeane wrote: IMO, there is value to having the assert. I can

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread via cfe-commits
@@ -19185,7 +19185,8 @@ static bool isLayoutCompatible(ASTContext , EnumDecl *ED1, EnumDecl *ED2) { /// Check if two fields are layout-compatible. static bool isLayoutCompatible(ASTContext , FieldDecl *Field1, - FieldDecl *Field2) { +

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2024-03-07 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping @cor3ntin @cjdb https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Mention possibility of underflow in array overflow errors (PR #84201)

2024-03-07 Thread via cfe-commits
NagyDonat wrote: > The change looks correct, but it would be more accurate if 3 different index > error cases would be possible, index is too small (negative), too large, or > can be both too small and too large. >From the point of view of the user this is already true, we have three

[clang] [clang] Clang should detect illegal copy constructor with template class as its parameter (PR #81251)

2024-03-07 Thread via cfe-commits
cor3ntin wrote: > I have removed this entirely, although it may still not be optimal, it did > reduce few more test failures: > > ```c++ > Constructor->hasOneParamOrDefaultArgs() && > Constructor->getTemplateSpecializationKind() != > TSK_ImplicitInstantiation > ``` > > Any

[clang] [clang][Diagnostic] Don't warn about binary literals when using C23. (PR #80244)

2024-03-07 Thread via cfe-commits
cor3ntin wrote: https://github.com/llvm/llvm-project/pull/81658 replaces this PR https://github.com/llvm/llvm-project/pull/80244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Diagnostic] Don't warn about binary literals when using C23. (PR #80244)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/80244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix static operator()/[] call not evaluating object (PR #78356)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/78356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][LLVM][SVE2.1] Created intrinsics for DUPQ instr. (PR #83260)

2024-03-07 Thread via cfe-commits
@@ -2215,6 +2215,15 @@ let TargetGuard = "sve2p1" in { def SVTBXQ : SInst<"svtbxq[_{d}]", "dddu", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_tbxq">; // EXTQ def EXTQ : SInst<"svextq[_{d}]", "dddk", "cUcsUsiUilUlbhfd", MergeNone, "aarch64_sve_extq", [], [ImmCheck<2,

[clang] [llvm] [Clang][LLVM][SVE2.1] Created intrinsics for DUPQ instr. (PR #83260)

2024-03-07 Thread via cfe-commits
@@ -10007,6 +10007,16 @@ multiclass sve2p1_dupq { bits<1> index; let Inst{20} = index; } + + def : SVE_2_Op_Imm_Pat(NAME # _B)>; Lukacma wrote: DOne https://github.com/llvm/llvm-project/pull/83260 ___

[clang] [ClangOffloadBundler] fix unbundling archive (PR #84195)

2024-03-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/84195 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 61b13e0 - [ClangOffloadBundler] fix unbundling archive (#84195)

2024-03-07 Thread via cfe-commits
Author: Yaxun (Sam) Liu Date: 2024-03-07T09:26:16-05:00 New Revision: 61b13e0dfe1b476d9bf0fe477983be8471cfd26b URL: https://github.com/llvm/llvm-project/commit/61b13e0dfe1b476d9bf0fe477983be8471cfd26b DIFF:

[clang] [llvm] [Clang][LLVM][SVE2.1] Created intrinsics for DUPQ instr. (PR #83260)

2024-03-07 Thread via cfe-commits
https://github.com/Lukacma edited https://github.com/llvm/llvm-project/pull/83260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SemaCXX] Implement CWG2351 `void{}` (PR #78060)

2024-03-07 Thread via cfe-commits
cor3ntin wrote: @MitalAshok ping https://github.com/llvm/llvm-project/pull/78060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] [SVE] Created intrinsics for DUPQ instr. (PR #83260)

2024-03-07 Thread via cfe-commits
https://github.com/Lukacma updated https://github.com/llvm/llvm-project/pull/83260 >From c5bceafca67d15bad05afa17ac8875421e4259a3 Mon Sep 17 00:00:00 2001 From: Marian Lukac Date: Wed, 21 Feb 2024 11:11:45 + Subject: [PATCH 1/2] [AArch64] [SVE] Created intrinsics for DUPQ instr. This

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

2024-03-07 Thread via cfe-commits
cor3ntin wrote: @bwendling feel free to fix the conflicts and merge https://github.com/llvm/llvm-project/pull/79365 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add /Zc:__STDC__ flag to clang-cl (PR #68690)

2024-03-07 Thread via cfe-commits
cor3ntin wrote: @xbjfk Once you fix the conflicts, would you like us to merge that for you? Thanks! https://github.com/llvm/llvm-project/pull/68690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Mention possibility of underflow in array overflow errors (PR #84201)

2024-03-07 Thread Balázs Kéri via cfe-commits
balazske wrote: The change looks correct, but it would be more accurate if 3 different index error cases would be possible, index is too small (negative), too large, or can be both too small and too large. https://github.com/llvm/llvm-project/pull/84201

[clang] [analyzer] Mention possibility of underflow in array overflow errors (PR #84201)

2024-03-07 Thread Balázs Kéri via cfe-commits
@@ -603,6 +611,8 @@ void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { auto [WithinUpperBound, ExceedsUpperBound] = compareValueToThreshold(State, ByteOffset, *KnownSize, SVB); +bool AssumedNonNegative = SUR.assumedNonNegative();

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -19185,7 +19185,8 @@ static bool isLayoutCompatible(ASTContext , EnumDecl *ED1, EnumDecl *ED2) { /// Check if two fields are layout-compatible. static bool isLayoutCompatible(ASTContext , FieldDecl *Field1, - FieldDecl *Field2) { +

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/84322 >From 8ffd2e22efc5ae6cc939802f6a2913f334dfcc54 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 7 Mar 2024 07:48:38 -0600 Subject: [PATCH] [LinkerWrapper] Use the correct empty file on Windows Summary:

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread Joseph Huber via cfe-commits
@@ -410,7 +410,10 @@ fatbinary(ArrayRef> InputFiles, Targets.push_back(Saver.save("hipv4-amdgcn-amd-amdhsa--" + Arch)); CmdArgs.push_back(Saver.save(llvm::join(Targets, ","))); - CmdArgs.push_back("-input=/dev/null"); + if (Triple.isOSWindows())

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 597be90f8b72fde59505f3650c20cf9e57b47d57 4a1e095d962e5b76d529fe579f2b449a36117c65 --

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/84322 >From 4a1e095d962e5b76d529fe579f2b449a36117c65 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 7 Mar 2024 07:48:38 -0600 Subject: [PATCH] [LinkerWrapper] Use the correct empty file on Windows Summary:

[clang] [clang][dataflow] When analyzing ctors, don't initialize fields of `*this` with values. (PR #84164)

2024-03-07 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand approved this pull request. https://github.com/llvm/llvm-project/pull/84164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread Michael Kruse via cfe-commits
@@ -410,7 +410,10 @@ fatbinary(ArrayRef> InputFiles, Targets.push_back(Saver.save("hipv4-amdgcn-amd-amdhsa--" + Arch)); CmdArgs.push_back(Saver.save(llvm::join(Targets, ","))); - CmdArgs.push_back("-input=/dev/null"); + if (Triple.isOSWindows())

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/84322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur requested changes to this pull request. https://github.com/llvm/llvm-project/pull/84322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] When analyzing ctors, don't initialize fields of `*this` with values. (PR #84164)

2024-03-07 Thread Yitzhak Mandelbaum via cfe-commits
@@ -799,6 +806,16 @@ PointerValue ::getOrCreateNullPointerValue(QualType PointeeType) { return DACtx->getOrCreateNullPointerValue(PointeeType); } +void Environment::initializeFieldsWithValues(RecordStorageLocation ) { ymand wrote: I don't know of any

[clang] [clang][dataflow] When analyzing ctors, don't initialize fields of `*this` with values. (PR #84164)

2024-03-07 Thread Yitzhak Mandelbaum via cfe-commits
@@ -414,8 +414,15 @@ void Environment::initialize() { } } else if (MethodDecl->isImplicitObjectMemberFunction()) { QualType ThisPointeeType = MethodDecl->getFunctionObjectParameterType(); - setThisPointeeStorageLocation( -

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
hokein wrote: Thank you for all the reviews, I will wait 1 or 2 days before merging it in case anyone has more comments. https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,34 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Joseph Huber (jhuber6) Changes Summary: The clang-offload-bundler uses an empty file to control the bundles made for embedding. Previously this still used `/dev/null` by mistake even on Windows. --- Full diff:

[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)

2024-03-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/84322 Summary: The clang-offload-bundler uses an empty file to control the bundles made for embedding. Previously this still used `/dev/null` by mistake even on Windows. >From eb6dd7ac6cfd52ce18b17a683e55835a261f7138

[clang] [clang] Implement constexpr support for __builtin_popcountg (PR #84318)

2024-03-07 Thread via cfe-commits
Sirraide wrote: This needs a release note, but LGTM otherwise. https://github.com/llvm/llvm-project/pull/84318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement constexpr support for __builtin_popcountg (PR #84318)

2024-03-07 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/84318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][draft] Improve debug info generation. (PR #84202)

2024-03-07 Thread via cfe-commits
abidh wrote: Thanks @kiranchandramohan and @tblah for your comments. I do plan to work on this long term to bring the full debug support to flang. I will work on creating a design document. https://github.com/llvm/llvm-project/pull/84202 ___

[clang] 597be90 - [Clang][NFC] Remove '--' separator in the linker wrapper usage (#84253)

2024-03-07 Thread via cfe-commits
Author: Joseph Huber Date: 2024-03-07T07:40:38-06:00 New Revision: 597be90f8b72fde59505f3650c20cf9e57b47d57 URL: https://github.com/llvm/llvm-project/commit/597be90f8b72fde59505f3650c20cf9e57b47d57 DIFF: https://github.com/llvm/llvm-project/commit/597be90f8b72fde59505f3650c20cf9e57b47d57.diff

[clang] [Clang][NFC] Remove '--' separator in the linker wrapper usage (PR #84253)

2024-03-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/84253 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 48dd118 - [Clang] Fix approved revision of P2266

2024-03-07 Thread via cfe-commits
Author: cor3ntin Date: 2024-03-07T14:40:30+01:00 New Revision: 48dd118f56e007a173b30019e860f0bd373a8ff8 URL: https://github.com/llvm/llvm-project/commit/48dd118f56e007a173b30019e860f0bd373a8ff8 DIFF: https://github.com/llvm/llvm-project/commit/48dd118f56e007a173b30019e860f0bd373a8ff8.diff

[clang] [Clang][NFC] Remove '--' separator in the linker wrapper usage (PR #84253)

2024-03-07 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > > [NFC] > > From a strict interpretation, this is not NFC as this changes clang driver > behavior. The overall behavior combining clang + clang-linker-wrapper may not > change, though... I suppose I just wanted to make it clear that this option didn't do anything, but it

[clang] [Clang] Update value for __cpp_implicit_move (#84216) (PR #84228)

2024-03-07 Thread via cfe-commits
github-actions[bot] wrote: @aniplcc Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a

[clang] [Clang] Update value for __cpp_implicit_move (#84216) (PR #84228)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/84228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 2acccf6 - [Clang] Update value for __cpp_implicit_move (#84216) (#84228)

2024-03-07 Thread via cfe-commits
Author: aniplcc Date: 2024-03-07T14:39:04+01:00 New Revision: 2acccf6717996bea8ade96dafdfc3343e9604694 URL: https://github.com/llvm/llvm-project/commit/2acccf6717996bea8ade96dafdfc3343e9604694 DIFF: https://github.com/llvm/llvm-project/commit/2acccf6717996bea8ade96dafdfc3343e9604694.diff LOG:

[clang] [Clang] Update value for __cpp_implicit_move (#84216) (PR #84228)

2024-03-07 Thread via cfe-commits
cor3ntin wrote: > [This page](https://clang.llvm.org/cxx_status.html) still refers to > [P2266R1](https://wg21.link/p2266r1) but the approved revision is > [P2266R3](https://wg21.link/p2266r3). Should we fix the citation in this PR > or another? I'll do that as NFC, thanks for noticing

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-07 Thread via cfe-commits
@@ -1996,6 +1996,30 @@ Here is an example: }]; } +def AssumeDocs : Documentation { + let Category = DocCatStmt; + let Heading = "assume"; + let Content = [{ +The ``assume`` attribute is used to indicate to the optimizer that a +certain condition can be assumed to be true

[clang] [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (C++ 3.3.2p4) (PR #84150)

2024-03-07 Thread Stefan Gränitz via cfe-commits
https://github.com/weliveindetail closed https://github.com/llvm/llvm-project/pull/84150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4b70d17 - [clang-repl] Names declared in if conditions and for-init statements are local to the inner context (#84150)

2024-03-07 Thread via cfe-commits
Author: Stefan Gränitz Date: 2024-03-07T14:27:04+01:00 New Revision: 4b70d17bcffaffd75a5d8c420396f8dc755b4652 URL: https://github.com/llvm/llvm-project/commit/4b70d17bcffaffd75a5d8c420396f8dc755b4652 DIFF:

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin commented: Generally looks good to me. You should modify cxx_status https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-07 Thread via cfe-commits
@@ -641,3 +652,53 @@ bool Sema::CheckRebuiltStmtAttributes(ArrayRef Attrs) { CheckForDuplicateLoopAttrs(*this, Attrs); return false; } + +ExprResult Sema::ActOnCXXAssumeAttr(Stmt *St, const ParsedAttr , +SourceRange Range) { + if

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM Thanks for working on that! https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread via cfe-commits
@@ -10598,10 +10598,34 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

[clang] [clang][dataflow] When analyzing ctors, don't initialize fields of `*this` with values. (PR #84164)

2024-03-07 Thread via cfe-commits
@@ -414,8 +414,15 @@ void Environment::initialize() { } } else if (MethodDecl->isImplicitObjectMemberFunction()) { QualType ThisPointeeType = MethodDecl->getFunctionObjectParameterType(); - setThisPointeeStorageLocation( -

[clang] [clang][dataflow] When analyzing ctors, don't initialize fields of `*this` with values. (PR #84164)

2024-03-07 Thread via cfe-commits
@@ -799,6 +806,16 @@ PointerValue ::getOrCreateNullPointerValue(QualType PointeeType) { return DACtx->getOrCreateNullPointerValue(PointeeType); } +void Environment::initializeFieldsWithValues(RecordStorageLocation ) { martinboehme wrote: I consciously put

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 5c919832f9176d4b1af1312a4ee7cf30b788958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 21 Feb 2024 14:46:01 +0100 Subject: [PATCH 1/7]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 5c919832f9176d4b1af1312a4ee7cf30b788958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 21 Feb 2024 14:46:01 +0100 Subject: [PATCH 1/6]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1183,6 +1315,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call)); +// The buffer size `*n` must

[clang] [clang] Implement constexpr support for __builtin_popcountg (PR #84318)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: OverMighty (overmighty) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/84318.diff 4 Files Affected: - (modified) clang/docs/LanguageExtensions.rst (+1) - (modified) clang/include/clang/Basic/Builtins.td (+1-1) -

[clang] [clang] Implement constexpr support for __builtin_popcountg (PR #84318)

2024-03-07 Thread via cfe-commits
overmighty wrote: cc @RKSimon https://github.com/llvm/llvm-project/pull/84318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Add context-sensitive test for returning a record by value. (PR #84317)

2024-03-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (martinboehme) Changes I'm making some changes to `Environment::getResultObjectLocation()`, with the ultimate goal of eliminating `RecordValue` entirely, and I'd like to make sure I don't break this behavior (and I've realized we

[clang] [clang] Implement constexpr support for __builtin_popcountg (PR #84318)

2024-03-07 Thread via cfe-commits
https://github.com/overmighty created https://github.com/llvm/llvm-project/pull/84318 None >From 929165caaec24463763a2074f920253c8cb2ae44 Mon Sep 17 00:00:00 2001 From: OverMighty Date: Thu, 7 Mar 2024 12:58:14 + Subject: [PATCH] [clang] Implement constexpr support for __builtin_popcountg

[clang] [clang][dataflow] Add context-sensitive test for returning a record by value. (PR #84317)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/84317 I'm making some changes to `Environment::getResultObjectLocation()`, with the ultimate goal of eliminating `RecordValue` entirely, and I'd like to make sure I don't break this behavior (and I've realized we

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC () { +assert(OpenACCPtr); cor3ntin wrote: In the current design, the assert does nothing useful.

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thank you for this factoring! Personally, I think this is a good model to go with for factoring functionality out of Sema and adding a tiny bit of layering to this part of the compiler (full disclosure: Vlad and I worked on this design offline). However, I added several

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin commented: I have mixed feelings about that. One one hand, i appreciate efforts to decouple Sema, on the other hand It's unclear to me how much benefit we will be able to realize. I think I'm fine with the change as long as there is no attempt to remove

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/84184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread via cfe-commits
@@ -63,17 +67,17 @@ void Sema::ActOnOpenACCConstruct(OpenACCDirectiveKind K, // here as these constructs do not take any arguments. break; default: -Diag(StartLoc, diag::warn_acc_construct_unimplemented) << K; +SemaRef.Diag(StartLoc,

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1196,6 +1342,11 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, E.isStreamEof() ? ErrorFEof : ErrorFEof | ErrorFError; StateFailed = E.setStreamState( StateFailed, StreamState::getOpened(Desc, NewES, !NewES.isFEof())); + // On failure, the

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 5c919832f9176d4b1af1312a4ee7cf30b788958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 21 Feb 2024 14:46:01 +0100 Subject: [PATCH 1/4]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 5c919832f9176d4b1af1312a4ee7cf30b788958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 21 Feb 2024 14:46:01 +0100 Subject: [PATCH 1/3]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Balazs Benics via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/83027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-07 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky edited https://github.com/llvm/llvm-project/pull/83847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

2024-03-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. I haven't gone deep into this PR, but it looks good to me. Please wait for someone else to sign it too. https://github.com/llvm/llvm-project/pull/84191 ___ cfe-commits mailing list

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Balazs Benics via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -1158,6 +1173,123 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent , C.addTransition(StateFailed); } +ProgramStateRef +StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Balazs Benics via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -1158,6 +1173,123 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent , C.addTransition(StateFailed); } +ProgramStateRef +StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Balazs Benics via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -1196,6 +1342,11 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, E.isStreamEof() ? ErrorFEof : ErrorFEof | ErrorFError; StateFailed = E.setStreamState( StateFailed,

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Balazs Benics via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -1183,6 +1315,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE,

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Balazs Benics via cfe-commits
Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?= Message-ID: In-Reply-To: https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/83027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-07 Thread Balazs Benics via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/83027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread via cfe-commits
@@ -19185,7 +19185,8 @@ static bool isLayoutCompatible(ASTContext , EnumDecl *ED1, EnumDecl *ED2) { /// Check if two fields are layout-compatible. static bool isLayoutCompatible(ASTContext , FieldDecl *Field1, - FieldDecl *Field2) { +

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin commented: I only have a comment otherwise LGTM https://github.com/llvm/llvm-project/pull/84313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/84313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Mention possibility of underflow in array overflow errors (PR #84201)

2024-03-07 Thread via cfe-commits
@@ -603,6 +611,8 @@ void ArrayBoundCheckerV2::performCheck(const Expr *E, CheckerContext ) const { auto [WithinUpperBound, ExceedsUpperBound] = compareValueToThreshold(State, ByteOffset, *KnownSize, SVB); +bool AssumedNonNegative = SUR.assumedNonNegative();

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-07 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/83847 >From 2bb165ac6264b36f72716cb35ed2e1b4f72f3eaa Mon Sep 17 00:00:00 2001 From: huqizhi Date: Mon, 4 Mar 2024 21:51:07 +0800 Subject: [PATCH] [Clang][Sema] Allow access to a public template alias declaration that

[clang] d5aecf0 - [clang][nullability] Don't discard expression state before end of full-expression. (#82611)

2024-03-07 Thread via cfe-commits
Author: martinboehme Date: 2024-03-07T13:31:23+01:00 New Revision: d5aecf0c19fc8850d7d34ac8c339bcc7e133b5fb URL: https://github.com/llvm/llvm-project/commit/d5aecf0c19fc8850d7d34ac8c339bcc7e133b5fb DIFF: https://github.com/llvm/llvm-project/commit/d5aecf0c19fc8850d7d34ac8c339bcc7e133b5fb.diff

[clang] [clang][nullability] Don't discard expression state before end of full-expression. (PR #82611)

2024-03-07 Thread via cfe-commits
https://github.com/martinboehme closed https://github.com/llvm/llvm-project/pull/82611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/84313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   >