[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-07 Thread Ziqing Luo via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodule-name=safe_buffers_test_base -x c++ %S/Inputs/SafeBuffers/safe_buffers_test.modulemap -std=c++20\ +// RUN: -o %t/safe_buffers_test_base.pcm -Wunsafe-buffer-usage

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-07 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/92031 >From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Mon, 13 May 2024 13:31:21 -0700 Subject: [PATCH 1/5] fix safe buffer opt-out region serialization ---

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-04 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 edited https://github.com/llvm/llvm-project/pull/92031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-04 Thread Ziqing Luo via cfe-commits
ziqingluo-90 wrote: Learned more about how loaded files & ASTs are managed in clang. Now opt-out regions in a loaded AST can span over multiple files (within one TU). They now behave in a consistent way when they are from loaded files or local files.

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-06-04 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/92031 >From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Mon, 13 May 2024 13:31:21 -0700 Subject: [PATCH 1/4] fix safe buffer opt-out region serialization ---

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-31 Thread Ziqing Luo via cfe-commits
ziqingluo-90 wrote: Just realized how stupid I am (O_o)---the current implementation only compares source locations with opt-out regions that are in the same source file, for all source locations from loaded files. This is not going to work for cases like below. ``` // in a pch header:

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-31 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 edited https://github.com/llvm/llvm-project/pull/92031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Fix false positives for constant cases (PR #92432)

2024-05-20 Thread Ziqing Luo via cfe-commits
@@ -420,25 +420,64 @@ AST_MATCHER(ArraySubscriptExpr, isSafeArraySubscript) { //already duplicated // - call both from Sema and from here - const auto *BaseDRE = - dyn_cast(Node.getBase()->IgnoreParenImpCasts()); - if (!BaseDRE) + if (const auto *BaseDRE = +

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-16 Thread Ziqing Luo via cfe-commits
@@ -1551,6 +1567,58 @@ bool Preprocessor::isPPInSafeBufferOptOutRegion(SourceLocation ) { return InSafeBufferOptOutRegion; } +SmallVector +Preprocessor::serializeSafeBufferOptOutMap() const { + assert(!InSafeBufferOptOutRegion && + "Attempt to serialize safe

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-16 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/92031 >From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Mon, 13 May 2024 13:31:21 -0700 Subject: [PATCH 1/3] fix safe buffer opt-out region serialization ---

[clang] [Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-16 Thread Ziqing Luo via cfe-commits
@@ -1551,6 +1567,58 @@ bool Preprocessor::isPPInSafeBufferOptOutRegion(SourceLocation ) { return InSafeBufferOptOutRegion; } +SmallVector +Preprocessor::serializeSafeBufferOptOutMap() const { + assert(!InSafeBufferOptOutRegion && ziqingluo-90 wrote: Oh,

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-15 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/92031 >From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Mon, 13 May 2024 13:31:21 -0700 Subject: [PATCH 1/2] fix safe buffer opt-out region serialization ---

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-15 Thread Ziqing Luo via cfe-commits
ziqingluo-90 wrote: > I'm very happy that this is going somewhere! Everything makes sense to me but > I also don't know a lot about this stuff. > > > During serialization, it only serializes regions of the current translation > > unit. Regions from loaded files are not serialized. > > Hmm

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-15 Thread Ziqing Luo via cfe-commits
@@ -1551,6 +1567,58 @@ bool Preprocessor::isPPInSafeBufferOptOutRegion(SourceLocation ) { return InSafeBufferOptOutRegion; } +SmallVector +Preprocessor::serializeSafeBufferOptOutMap() const { + assert(!InSafeBufferOptOutRegion && ziqingluo-90 wrote: It's

[clang] [WIP][Safe Buffers] Serialize unsafe_buffer_usage pragmas (PR #92031)

2024-05-13 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/92031 A pair of `#pragma clang unsafe_buffer_usage begin/end` pragmas marks a warning-opt-out region. The begin and end locations (opt-out regions) are stored in preprocessor instances (PP) and will be queried

[clang] Add handling of the `-nostdlibinc` option to ccc-analyzer (PR #88017)

2024-04-09 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/88017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add handling of the `-nostdlibinc` option to ccc-analyzer (PR #88017)

2024-04-08 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/88017 Compiler options recognizable to ccc-analyzer are stored in maps. An option missing in the map will be dropped by ccc-analyzer. This causes a build error in one of our projects that only happens in

[clang] [-Wunsafe-buffer-usage][NFC] clang-format UnsafeBufferUsage.cpp (PR #82027)

2024-02-27 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM! Thanks for re-formatting the code. https://github.com/llvm/llvm-project/pull/82027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [-Wunsafe-buffer-usage] Minimize fixit range for pointer variables (PR #81935)

2024-02-16 Thread Ziqing Luo via cfe-commits
@@ -2326,15 +2312,21 @@ static FixItList fixLocalVarDeclWithSpan(const VarDecl *D, ASTContext , return {}; FixIts.insert(FixIts.end(), std::make_move_iterator(InitFixIts->begin()), std::make_move_iterator(InitFixIts->end())); -// If the

[clang] [-Wunsafe-buffer-usage] Minimize fixit range for pointer variables (PR #81935)

2024-02-16 Thread Ziqing Luo via cfe-commits
@@ -2326,15 +2312,21 @@ static FixItList fixLocalVarDeclWithSpan(const VarDecl *D, ASTContext , return {}; FixIts.insert(FixIts.end(), std::make_move_iterator(InitFixIts->begin()), std::make_move_iterator(InitFixIts->end())); -// If the

[clang] [-Wunsafe-buffer-usage] Minimize fixit range for pointer variables (PR #81935)

2024-02-16 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/81935 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Minimize fixit range for pointer variables (PR #81935)

2024-02-16 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 edited https://github.com/llvm/llvm-project/pull/81935 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Fixits for array decayed to pointer (PR #80347)

2024-02-13 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM! (We probably do not need to use `CHECK-DAG` at most places in our tests since we have fixed the non-deterministic issue, but it's irrelevant to this PR.) https://github.com/llvm/llvm-project/pull/80347

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-07 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. I left all my comments here. I didn't think quite through for some of them so feel free to ignore if they don't make sense to you. Other parts LGTM! https://github.com/llvm/llvm-project/pull/80084

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-07 Thread Ziqing Luo via cfe-commits
@@ -2495,10 +2471,100 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext , +

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-07 Thread Ziqing Luo via cfe-commits
@@ -2495,10 +2471,100 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext , +

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-07 Thread Ziqing Luo via cfe-commits
@@ -2495,10 +2471,100 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext , +

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-07 Thread Ziqing Luo via cfe-commits
@@ -2495,10 +2471,100 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext , +

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-07 Thread Ziqing Luo via cfe-commits
@@ -2495,10 +2471,100 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext , +

[clang] [-Wunsafe-buffer-usage] Fix debug notes for unclaimed DREs (PR #80787)

2024-02-06 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM! I think I did something similar locally when I collected data of unclaimed DREs on those big adopter projects. So I guess the data that we used to find major missing patterns for fix-its is still valid.

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-02 Thread Ziqing Luo via cfe-commits
@@ -2495,10 +2470,97 @@ static FixItList fixVariableWithSpan(const VarDecl *VD, return fixLocalVarDeclWithSpan(VD, Ctx, getUserFillPlaceHolder(), Handler); } +static FixItList fixVarDeclWithArray(const VarDecl *D, const ASTContext , +

[clang] [-Wunsafe-buffer-usage] Introduce std::array fixits (PR #80084)

2024-02-02 Thread Ziqing Luo via cfe-commits
@@ -0,0 +1,164 @@ +// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage \ +// RUN:-fsafe-buffer-usage-suggestions \ +// RUN:-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +typedef int * Int_ptr_t; +typedef int Int_t; + +void simple(unsigned idx) { +

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-26 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/77148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wcompletion-handler] Fix a non-termination issue (PR #78380)

2024-01-26 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/78380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wcompletion-handler] Fix a non-termination issue (PR #78380)

2024-01-25 Thread Ziqing Luo via cfe-commits
ziqingluo-90 wrote: @SavchenkoValeriy, sorry for the late response. Your suggested fix works for my minimal example as well as my local project where this bug was originated. And I failed to come up with a new counter-example for the fix so I believe it will also prevent future

[clang] [-Wcompletion-handler] Fix a non-termination issue (PR #78380)

2024-01-25 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/78380 >From e7c3a3fc2a4f5d5714044a1c407bfe56f328680d Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Tue, 16 Jan 2024 17:45:01 -0800 Subject: [PATCH 1/4] [-Wcompletion-handler] Fix a non-termination issue The

[clang] [-Wcompletion-handler] Fix a non-termination issue (PR #78380)

2024-01-25 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/78380 >From e7c3a3fc2a4f5d5714044a1c407bfe56f328680d Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Tue, 16 Jan 2024 17:45:01 -0800 Subject: [PATCH 1/3] [-Wcompletion-handler] Fix a non-termination issue The

[clang] [-Wunsafe-buffer-usage] Fix AST matcher of UUCAddAssignGadget (PR #79392)

2024-01-25 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM, It's great to catch and fix this bug! https://github.com/llvm/llvm-project/pull/79392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-23 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 1b169f49a129a5a69a82386b486c8a46ecfc815a Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/3] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-22 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 6ba957670ca593094b4545c35801585da2ee02a8 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Fix the crash introduced by the unsafe invocation of span::data warning (PR #78815)

2024-01-19 Thread Ziqing Luo via cfe-commits
@@ -2263,15 +2263,27 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { MsgParam = 3; } else if (const auto *ECE = dyn_cast(Operation)) { QualType destType = ECE->getType(); -const uint64_t dSize = -

[clang] [-Wunsafe-buffer-usage] Fix the crash introduced by the unsafe invocation of span::data warning (PR #78815)

2024-01-19 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM! Feel free to ignore my comment if it doesn't make sense to you. https://github.com/llvm/llvm-project/pull/78815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [-Wunsafe-buffer-usage] Fix the crash introduced by the unsafe invocation of span::data warning (PR #78815)

2024-01-19 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 edited https://github.com/llvm/llvm-project/pull/78815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-08 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 6ba957670ca593094b4545c35801585da2ee02a8 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From 4714b0c03897ab61322e3a16288994ccb01dbfac Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/77148 >From fb93d83d65ef1c52857b4471ccda2e82447d45dc Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Fri, 5 Jan 2024 13:39:39 -0800 Subject: [PATCH 1/2] [-Wunsafe-buffer-usage] Add a new warning for use of

[clang] [-Wunsafe-buffer-usage] Add a new warning for uses of std::span two-parameter constructors (PR #77148)

2024-01-05 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/77148 The PR contains two commits: 1. adding a new waring under a sub-group of `-Wunsafe-buffer-usage` 2. teach the analyzer to be quiet on some benign cases >From 475d918fb0b5991be7ce559ef6ef7f20c6b231e5 Mon Sep

[clang] Warning for unsafe invocation of span::data (PR #75650)

2023-12-20 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/75650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Add a subgroup `-Wunsafe-buffer-usage-in-container` (PR #75665)

2023-12-18 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/75665 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Warning for unsafe invocation of span::data (PR #75650)

2023-12-15 Thread Ziqing Luo via cfe-commits
@@ -2261,6 +2261,21 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { // note_unsafe_buffer_operation doesn't have this mode yet. assert(!IsRelatedToDecl && "Not implemented yet!"); MsgParam = 3; + } else if (const auto *ECE =

[clang] Warning for unsafe invocation of span::data (PR #75650)

2023-12-15 Thread Ziqing Luo via cfe-commits
@@ -721,6 +721,33 @@ class UnsafeBufferUsageAttrGadget : public WarningGadget { DeclUseList getClaimedVarUseSites() const override { return {}; } }; +// Warning gadget for unsafe invocation of span::data method. +// Triggers when the pointer returned by the invocation is

[clang] [-Wunsafe-buffer-usage] Add a subgroup `-Wunsafe-buffer-usage-in-container` (PR #75665)

2023-12-15 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/75665 Add a sub diagnostic group under `-Wunsafe-buffer-usage` controlled by `-Wunsafe-buffer-usage-in-container`. The subgroup will include warnings on misuses of `std::span`, `std::vector`, and `std::array`.

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-12-08 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 closed https://github.com/llvm/llvm-project/pull/74020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-12-07 Thread Ziqing Luo via cfe-commits
ziqingluo-90 wrote: Plan to merge this PR tomorrow. https://github.com/llvm/llvm-project/pull/74020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-12-04 Thread Ziqing Luo via cfe-commits
@@ -2487,15 +2486,15 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext ) { // Clean up constructed object even if there are no attributes to // keep the number of objects in limbo as small as possible. - if (auto Object =

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-12-04 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/74020 >From 9c2718abce31d61c079e0945313fe14ad0f334b3 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Mon, 4 Dec 2023 14:37:10 -0800 Subject: [PATCH] Thread safety analysis: Fix a bug in handling temporary

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-12-04 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/74020 >From 81701bfc9052eed567abb76ac05d44cb99298303 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Mon, 4 Dec 2023 14:37:10 -0800 Subject: [PATCH] Thread safety analysis: Fix a bug in handling temporary

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-12-04 Thread Ziqing Luo via cfe-commits
ziqingluo-90 wrote: @aaronpuchert Thanks for your comment! I have addressed them. Do you mind to take an another look and approve it if it looks good to you? https://github.com/llvm/llvm-project/pull/74020 ___ cfe-commits mailing list

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-12-04 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/74020 >From 00083bb1573561361ff0782f425ebec2a5218f34 Mon Sep 17 00:00:00 2001 From: ziqingluo-90 Date: Mon, 4 Dec 2023 14:37:10 -0800 Subject: [PATCH] Thread safety analysis: Fix a bug in handling temporary

[clang] Thread safety analysis: Fix a bug in handling temporary constructors (PR #74020)

2023-11-30 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/74020 The commit 54bfd04846156dbd5e0a6b88f539c3d4569a455f introduces general handling of constructor and destructor calls. Consider a pair of TEMPORARY constructor and destructor calls of a "SCOPED_CAPABILITY"

[clang] [-Wunsafe-buffer-usage] Add FixableGadget for AddAssign in UnspecifiedUntypedContext (PR #71862)

2023-11-13 Thread Ziqing Luo via cfe-commits
@@ -1028,6 +1028,50 @@ class UPCPreIncrementGadget : public FixableGadget { } }; +// Representing a pointer type expression of the form `Ptr += n` in an +// Unspecified Untyped Context (UUC): +class UUCAddAssignGadget : public FixableGadget { +private: + static constexpr

[clang] 700baeb - [-Wunsafe-buffer-usage] Use `Strategy` to determine whether to fix a parameter

2023-09-21 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-09-21T15:06:22-07:00 New Revision: 700baeb765cfe8628eb68bc24319b3db0209dd84 URL: https://github.com/llvm/llvm-project/commit/700baeb765cfe8628eb68bc24319b3db0209dd84 DIFF: https://github.com/llvm/llvm-project/commit/700baeb765cfe8628eb68bc24319b3db0209dd84.diff

[clang] 33f6161 - [-Wunsafe-buffer-usage] Group parameter fix-its

2023-09-21 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-09-21T12:45:30-07:00 New Revision: 33f6161d9eaaa7c5a01ee8e50dec440d3052d34a URL: https://github.com/llvm/llvm-project/commit/33f6161d9eaaa7c5a01ee8e50dec440d3052d34a DIFF: https://github.com/llvm/llvm-project/commit/33f6161d9eaaa7c5a01ee8e50dec440d3052d34a.diff

[clang] b58e528 - [-Wunsafe-buffer-usage] Stop generating incorrect fix-its for variable declarations with unsupported specifiers

2023-08-21 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-08-21T16:34:44-07:00 New Revision: b58e52889808e0e8da55ac77f651762f202aa4c5 URL: https://github.com/llvm/llvm-project/commit/b58e52889808e0e8da55ac77f651762f202aa4c5 DIFF: https://github.com/llvm/llvm-project/commit/b58e52889808e0e8da55ac77f651762f202aa4c5.diff

[clang] 3a67b91 - [-Wunsafe-buffer-usage] Refactor to let local variable fix-its and parameter fix-its share common code

2023-08-21 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-08-21T14:50:04-07:00 New Revision: 3a67b912386e70073efcb2225c6354b85048b1ae URL: https://github.com/llvm/llvm-project/commit/3a67b912386e70073efcb2225c6354b85048b1ae DIFF: https://github.com/llvm/llvm-project/commit/3a67b912386e70073efcb2225c6354b85048b1ae.diff

[clang] ac9a76d - Revert "[-Wunsafe-buffer-usage][NFC] Slightly refactor and optimize the code"

2023-08-17 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-08-17T16:42:30-07:00 New Revision: ac9a76d7487b9af1ace626eb90064194cb12c53d URL: https://github.com/llvm/llvm-project/commit/ac9a76d7487b9af1ace626eb90064194cb12c53d DIFF: https://github.com/llvm/llvm-project/commit/ac9a76d7487b9af1ace626eb90064194cb12c53d.diff

[clang] 8437847 - [-Wunsafe-buffer-usage][NFC] Slightly refactor and optimize the code

2023-08-17 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-08-17T16:24:47-07:00 New Revision: 843784764ab58e35f8aa2da97f07dc5e810f4bcb URL: https://github.com/llvm/llvm-project/commit/843784764ab58e35f8aa2da97f07dc5e810f4bcb DIFF: https://github.com/llvm/llvm-project/commit/843784764ab58e35f8aa2da97f07dc5e810f4bcb.diff

[clang] 41279e8 - [-Wunsafe-buffer-usage] Refactor and improve for parameter fix-its

2023-08-17 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-08-17T15:27:38-07:00 New Revision: 41279e870fa577f8a7f7030b8e45da250d0def9e URL: https://github.com/llvm/llvm-project/commit/41279e870fa577f8a7f7030b8e45da250d0def9e DIFF: https://github.com/llvm/llvm-project/commit/41279e870fa577f8a7f7030b8e45da250d0def9e.diff

[clang] cfcf76c - [-Wunsafe-buffer-usage] Ignore the FixableGadgets that will not be fixed at an earlier stage

2023-07-25 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-07-25T16:58:27-07:00 New Revision: cfcf76c6ad72581917fc65b598e3b64ca28c5ce1 URL: https://github.com/llvm/llvm-project/commit/cfcf76c6ad72581917fc65b598e3b64ca28c5ce1 DIFF: https://github.com/llvm/llvm-project/commit/cfcf76c6ad72581917fc65b598e3b64ca28c5ce1.diff

[clang] 4b5f17e - [-Wunsafe-buffer-usage] Do not assert that function parameters have names

2023-07-19 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-07-19T14:14:28-07:00 New Revision: 4b5f17e008c684998a5ee10454d34714736eb6c5 URL: https://github.com/llvm/llvm-project/commit/4b5f17e008c684998a5ee10454d34714736eb6c5 DIFF: https://github.com/llvm/llvm-project/commit/4b5f17e008c684998a5ee10454d34714736eb6c5.diff

[clang] 6251b04 - [-Wunsafe-buffer-usage] A follow-up fix to 762af11d4c5d0bd1e76f23a07087773db09ef17d

2023-04-13 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-04-13T11:24:46-07:00 New Revision: 6251b04fc76a45d5a9c00bfb5010b9bbbcefb9b0 URL: https://github.com/llvm/llvm-project/commit/6251b04fc76a45d5a9c00bfb5010b9bbbcefb9b0 DIFF: https://github.com/llvm/llvm-project/commit/6251b04fc76a45d5a9c00bfb5010b9bbbcefb9b0.diff

[clang] 762af11 - [-Wunsafe-buffer-usage] Add a Fixable for pointer pre-increment

2023-04-12 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-04-12T14:51:46-07:00 New Revision: 762af11d4c5d0bd1e76f23a07087773db09ef17d URL: https://github.com/llvm/llvm-project/commit/762af11d4c5d0bd1e76f23a07087773db09ef17d DIFF: https://github.com/llvm/llvm-project/commit/762af11d4c5d0bd1e76f23a07087773db09ef17d.diff

[clang] 88f7f01 - [-Wunsafe-buffer-usage] Match unsafe pointers being casted to bool or participating in pointer subtractions

2023-04-11 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-04-11T15:09:51-07:00 New Revision: 88f7f018e23b24d3c31dd2b4f3cd68481d1739c1 URL: https://github.com/llvm/llvm-project/commit/88f7f018e23b24d3c31dd2b4f3cd68481d1739c1 DIFF: https://github.com/llvm/llvm-project/commit/88f7f018e23b24d3c31dd2b4f3cd68481d1739c1.diff

[clang] ca6ceeb - Reland "[-Wunsafe-buffer-usage] Fix-Its transforming `[any]` to `()[any]`"

2023-04-05 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-04-05T14:54:03-07:00 New Revision: ca6ceeb0d6cd5b8545410d878c8d7bcce9538a3a URL: https://github.com/llvm/llvm-project/commit/ca6ceeb0d6cd5b8545410d878c8d7bcce9538a3a DIFF: https://github.com/llvm/llvm-project/commit/ca6ceeb0d6cd5b8545410d878c8d7bcce9538a3a.diff

[clang] cd26529 - [-Wunsafe-buffer-usage] Fixits for assignments to array subscript expressions

2023-02-23 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-23T15:02:46-08:00 New Revision: cd2652963b6b97c01329419f15c336e5560afa98 URL: https://github.com/llvm/llvm-project/commit/cd2652963b6b97c01329419f15c336e5560afa98 DIFF: https://github.com/llvm/llvm-project/commit/cd2652963b6b97c01329419f15c336e5560afa98.diff

[clang] f78c343 - [-Wunsafe-buffer-usage] Create Fix-Its only if they are emitted

2023-02-23 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-23T14:47:43-08:00 New Revision: f78c34346635e25919e2777b1b1cbb9627d5ad43 URL: https://github.com/llvm/llvm-project/commit/f78c34346635e25919e2777b1b1cbb9627d5ad43 DIFF: https://github.com/llvm/llvm-project/commit/f78c34346635e25919e2777b1b1cbb9627d5ad43.diff

[clang] 03cc52d - [-Wunsafe-buffer-usage] To disable a test on Windows systems.

2023-02-08 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-08T17:38:19-08:00 New Revision: 03cc52dfd1dbb4a59b479da55e87838fb93d2067 URL: https://github.com/llvm/llvm-project/commit/03cc52dfd1dbb4a59b479da55e87838fb93d2067 DIFF: https://github.com/llvm/llvm-project/commit/03cc52dfd1dbb4a59b479da55e87838fb93d2067.diff

[clang] 829bcb0 - [-Wunsafe-buffer-usage] Add unsafe buffer checking opt-out pragmas

2023-02-08 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-08T14:12:03-08:00 New Revision: 829bcb06ec43ab4b56b95ff040ec9d36feeaf06a URL: https://github.com/llvm/llvm-project/commit/829bcb06ec43ab4b56b95ff040ec9d36feeaf06a DIFF: https://github.com/llvm/llvm-project/commit/829bcb06ec43ab4b56b95ff040ec9d36feeaf06a.diff

[clang] 9aa00c8 - Revert "[-Wunsafe-buffer-usage] Add unsafe buffer checking opt-out pragmas"

2023-02-07 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-07T17:06:20-08:00 New Revision: 9aa00c8a306561c4e3ddb09058e66bae322a0769 URL: https://github.com/llvm/llvm-project/commit/9aa00c8a306561c4e3ddb09058e66bae322a0769 DIFF: https://github.com/llvm/llvm-project/commit/9aa00c8a306561c4e3ddb09058e66bae322a0769.diff

[clang] aef05b5 - [-Wunsafe-buffer-usage] Add unsafe buffer checking opt-out pragmas

2023-02-07 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-07T16:54:39-08:00 New Revision: aef05b5dc5c566bcaa15b66c989ccb8d2841ac71 URL: https://github.com/llvm/llvm-project/commit/aef05b5dc5c566bcaa15b66c989ccb8d2841ac71 DIFF: https://github.com/llvm/llvm-project/commit/aef05b5dc5c566bcaa15b66c989ccb8d2841ac71.diff

[clang] 692da62 - [-Wunsafe-buffer-usage] Filter out conflicting fix-its

2023-02-07 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-07T16:15:28-08:00 New Revision: 692da6245d719fcee9d55936a021d9f9e301c557 URL: https://github.com/llvm/llvm-project/commit/692da6245d719fcee9d55936a021d9f9e301c557 DIFF: https://github.com/llvm/llvm-project/commit/692da6245d719fcee9d55936a021d9f9e301c557.diff

[clang] bdf4f2b - [-Wunsafe-buffer-usage] Generate fix-it for local variable declarations

2023-02-07 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-07T15:40:19-08:00 New Revision: bdf4f2bea50e87f5b9273e3bbc9a7753bca3a6bb URL: https://github.com/llvm/llvm-project/commit/bdf4f2bea50e87f5b9273e3bbc9a7753bca3a6bb DIFF: https://github.com/llvm/llvm-project/commit/bdf4f2bea50e87f5b9273e3bbc9a7753bca3a6bb.diff

[clang] 622be09 - Revert "[-Wunsafe-buffer-usage] Generate fix-it for local variable declarations"

2023-02-07 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-07T14:47:43-08:00 New Revision: 622be09c815266632e204eaf1c7a35f050220459 URL: https://github.com/llvm/llvm-project/commit/622be09c815266632e204eaf1c7a35f050220459 DIFF: https://github.com/llvm/llvm-project/commit/622be09c815266632e204eaf1c7a35f050220459.diff

[clang] a29e676 - [-Wunsafe-buffer-usage] Generate fix-it for local variable declarations

2023-02-07 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-02-07T13:17:44-08:00 New Revision: a29e67614c3b7018287e5f68c57bba7618aa880e URL: https://github.com/llvm/llvm-project/commit/a29e67614c3b7018287e5f68c57bba7618aa880e DIFF: https://github.com/llvm/llvm-project/commit/a29e67614c3b7018287e5f68c57bba7618aa880e.diff

[clang] f58b025 - Revert "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations"

2023-01-04 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-01-04T17:16:21-08:00 New Revision: f58b025354ee2d3bcd7ab2399a11429ec940c1e0 URL: https://github.com/llvm/llvm-project/commit/f58b025354ee2d3bcd7ab2399a11429ec940c1e0 DIFF: https://github.com/llvm/llvm-project/commit/f58b025354ee2d3bcd7ab2399a11429ec940c1e0.diff

[clang] f84f17c - [-Wunsafe-buffer-usage] Add an unsafe gadget for pointer-arithmetic operations

2023-01-04 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-01-04T16:50:21-08:00 New Revision: f84f17c489f7cb84d72e84a6b1b6c54bd8d52717 URL: https://github.com/llvm/llvm-project/commit/f84f17c489f7cb84d72e84a6b1b6c54bd8d52717 DIFF: https://github.com/llvm/llvm-project/commit/f84f17c489f7cb84d72e84a6b1b6c54bd8d52717.diff

[clang] b2ac5fd - [-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations

2023-01-04 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2023-01-04T15:51:56-08:00 New Revision: b2ac5fd724c44cf662caed84bd8f84af574b981d URL: https://github.com/llvm/llvm-project/commit/b2ac5fd724c44cf662caed84bd8f84af574b981d DIFF: https://github.com/llvm/llvm-project/commit/b2ac5fd724c44cf662caed84bd8f84af574b981d.diff

[clang] b17baa1 - [ASTMatchers] Adding a new matcher for callee declarations of Obj-C

2022-07-21 Thread Ziqing Luo via cfe-commits
Author: Ziqing Luo Date: 2022-07-21T13:35:31-07:00 New Revision: b17baa1db613a2ce777aa122feb87488750a64d0 URL: https://github.com/llvm/llvm-project/commit/b17baa1db613a2ce777aa122feb87488750a64d0 DIFF: https://github.com/llvm/llvm-project/commit/b17baa1db613a2ce777aa122feb87488750a64d0.diff