[PATCH] D158112: [-Wunsafe-buffer-usage] Fix assertion failure in case of BindingDecl

2023-08-17 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2afcda693acb: [-Wunsafe-buffer-usage] Fix assertion failure in case of BindingDecl (authored by t-rasmud). Herald added a project: clang. Herald adde

[PATCH] D157441: [-Wunsafe-buffer-usage] Use `Strategy` to determine whether to fix a parameter

2023-08-17 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2719 + Strategy NaiveStrategy = getNaiveStrategy( + llvm::make_range(VisitedVars.begin(), VisitedVars.end())); VariableGroupsManagerImpl VarGrpMgr(Groups, VarGrpMap, GrpsUnionForParms);

[PATCH] D157018: [-Wunsafe-buffer-usage] Replace assert that declarations are always found

2023-08-15 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGcf1c64b94d94: [-Wunsafe-buffer-usage] Replace assert that declarations are always found (authored by t-rasmud). Herald added a project: clang. Herald

[PATCH] D156762: [-Wunsafe-buffer-usage][NFC] Refactor `getFixIts`---where fix-its are generated

2023-08-03 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2145 -static bool impossibleToFixForVar(const FixableGadgetSets &FixablesForAllVars, - const Strategy &S, - const VarDecl * Var

[PATCH] D156474: [-Wunsafe-buffer-usage][NFC] Slightly refactor and optimize the code

2023-08-02 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud accepted this revision. t-rasmud added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2179 + if (FixItsForVariable.count(GrpMate)) +FinalFixItsForVariable[Var].insert(FinalFixItsForVar

[PATCH] D156474: [-Wunsafe-buffer-usage][NFC] Slightly refactor and optimize the code

2023-08-01 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:1143 + // order is deterministic: + CompareNode> + byVar; NoQ wrote: > ziqingluo-90 wrote: > > To make the order of variables in every group deterministi

[PATCH] D156474: [-Wunsafe-buffer-usage][NFC] Slightly refactor and optimize the code

2023-08-01 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2179 + if (FixItsForVariable.count(GrpMate)) +FinalFixItsForVariable[Var].insert(FinalFixItsForVariable[Var].end(), + FixItsForVariable[GrpM

[PATCH] D154880: [-Wunsafe-buffer-usage] Add a facility for debugging low fixit coverage.

2023-07-26 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa6ae740e743a: [-Wunsafe-buffer-usage] Add a facility for debugging low fixit coverage (authored by t-rasmud). Herald added a project: clang. Changed

[PATCH] D154880: [-Wunsafe-buffer-usage] Add a facility for debugging low fixit coverage.

2023-07-26 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 544547. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154880/new/ https://reviews.llvm.org/D154880 Files: clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Analysis/UnsafeBuffe

[PATCH] D154880: [-Wunsafe-buffer-usage] Add a facility for debugging low fixit coverage.

2023-07-26 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 544521. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154880/new/ https://reviews.llvm.org/D154880 Files: clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Analysis/UnsafeBuffe

[PATCH] D154880: [-Wunsafe-buffer-usage] Add a facility for debugging low fixit coverage.

2023-07-26 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added a comment. In D154880#4533035 , @ziqingluo-90 wrote: > This is a lot of work, thank you @t-rasmud & @NoQ ! > > I have a minor suggestion: can we use some macros to make the debug stub even > shorter? > The prefix `"failed to produce fixit

[PATCH] D154880: [-Wunsafe-buffer-usage] Add a facility for debugging low fixit coverage.

2023-07-26 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 544510. t-rasmud retitled this revision from "[-Wunsafe-buffer-usage][WIP] Add a facility for debugging low fixit coverage." to "[-Wunsafe-buffer-usage] Add a facility for debugging low fixit coverage.". CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D155526: [-Wunsafe-buffer-usage] Fix a fallthrough case in UPCStandalonePointer getFixits

2023-07-25 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG070358ec9235: [-Wunsafe-buffer-usage] Fix a fallthrough case in UPCStandalonePointer getFixits (authored by t-rasmud). Herald added a project: clang. Herald added a subscriber: cfe-commits. Changed prior

[PATCH] D156189: [-Wunsafe-buffer-usage] Refactor to let local variable fix-its and parameter fix-its share common code

2023-07-25 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:1824 + + if (!IdentText) +return {}; When will this condition be satisfied? I just want to understand if there are code examples where there is no identifier text or is it

[PATCH] D150386: [-Wunsafe-buffer-usage] Handle lambda expressions within a method.

2023-07-20 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG27c10337831c: [WIP][-Wunsafe-buffer-usage] Handle lambda expressions within a method. (authored by t-rasmud). Herald added a project: clang. Herald a

[PATCH] D153059: [-Wunsafe-buffer-usage] Group parameter fix-its

2023-07-20 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added a comment. > I'm not sure it makes sense split it up now, probably depends on whether Jan > and Rashmi have the same troubles as me ^.^ I have to admit it is a difficult patch to follow. It also has a lot of clever ideas that deserve attention but might be lost because of the com

[PATCH] D153059: [-Wunsafe-buffer-usage] Group parameter fix-its

2023-07-18 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-multi-parm-span.cpp:306 + b[5] = 5; // expected-note{{used in buffer access here}} +} Can we have a test case with qualifiers on parameters and maybe another with a

[PATCH] D155134: [clang][docs] Defensively turn off exception behavior in dump_ast_matchers.py

2023-07-18 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1e62587a48a3: [clang][docs] Defensively turn off exception behavior in dump_ast_matchers.py (authored by t-rasmud). Herald added a project: clang. He

[PATCH] D155304: [clang][docs] Update LibASTMatchersReference.html

2023-07-18 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3ea673a97b05: [clang][docs] Update LibASTMatchersReference.html (authored by t-rasmud). Herald added a project: clang. Herald added a subscriber: cfe

[PATCH] D154880: [-Wunsafe-buffer-usage][WIP] Add a facility for debugging low fixit coverage.

2023-07-18 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 541745. t-rasmud added a comment. This patch addresses cases 2, 3, and 4 described in the summary (i.e) adds debug notes for unclaimed uses of variables and for failed fixit generation of variable declarations. CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D155524: [-Wunsafe-buffer-usage] Ignore the FixableGadgets that will not be fixed at an earlier stage

2023-07-17 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud accepted this revision. t-rasmud added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2346 + // computed above. We do not want to generate fix-its for such variables, + // since they are neither

[PATCH] D154880: [-Wunsafe-buffer-usage][WIP] Add a facility for debugging low fixit coverage.

2023-07-17 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added a comment. I will add debug notes for the rest of the cases not addressed in this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154880/new/ https://reviews.llvm.org/D154880 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D153059: [-Wunsafe-buffer-usage] Group parameter fix-its

2023-06-29 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-multi-parm-span.cpp:251 +} +// CHECK-NOT: fix-it:{{.*}}:{[[@LINE-1]] Does this patch handle virtual methods? Ideally we'd like the fixed methods to have the same subt

[PATCH] D153059: [-Wunsafe-buffer-usage] Group parameter fix-its

2023-06-29 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-multi-parm-span.cpp:5 + +// FIXME: what about possible diagnostic message non-determinism? + I have used a workaround for non-determinism by using regular expressions

[PATCH] D150489: [-Wunsafe-buffer-usage] Handle pointer initializations for grouping related variables

2023-06-21 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGdb3dcedb9ced: [-Wunsafe-buffer-usage] Handle pointer initializations for grouping related… (authored by t-rasmud). Herald added a project: clang. Her

[PATCH] D153064: [-Wunsafe-buffer-usage] Do not emit fixits for C++ interfaces with C linkage

2023-06-16 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd1ae844dc2cc: [-Wunsafe-buffer-usage] Do not emit fixits for C++ interfaces with C linkage (authored by t-rasmud). Herald added a project: clang. Her

[PATCH] D153059: [-Wunsafe-buffer-usage][WIP] Group parameter fix-its

2023-06-15 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2264 + // variable `x` implicates fixing `y`: DepMapTy PtrAssignmentGraph{}; + ziqingluo-90 wrote: > ziqingluo-90 wrote: > > How about changing the variable name to `PtrImpli

[PATCH] D145739: [-Wunsafe-buffer-usage] Group variables associated by pointer assignments

2023-05-25 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added a comment. Hi Douglas, No worries, I know the root cause for the issue. I will make the necessary changes and re-commit the patch. Thanks, Rashmi Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145739/new/ https://reviews.llvm.org/D

[PATCH] D145739: [-Wunsafe-buffer-usage] Group variables associated by pointer assignments

2023-05-24 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGee6b08e99375: [-Wunsafe-buffer-usage] Group variables associated by pointer assignments (authored by t-rasmud). Herald added a project: clang. Herald

[PATCH] D146669: [-Wunsafe-buffer-usage] Hide fixits/suggestions behind an extra flag, -fsafe-buffer-usage-suggestions.

2023-03-23 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:2159 Sema &S; + bool SuggestSuggestions; Was there a reason for naming this variable SuggestSuggestions? Can this be called EmitSuggestions? I think that would make it uni

[PATCH] D143128: [-Wunsafe-buffer-usage] Fix-Its transforming `&DRE[any]` to `(DRE.data() + any)`

2023-03-06 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added inline comments. Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:1079 +dyn_cast(ArraySub->getBase()->IgnoreImpCasts())) { + // FIXME: this `getASTContext` call is costy, we should pass the + // ASTContext in: Nit: "costly

[PATCH] D138940: [-Wunsafe-buffer-usage] Introduce the `unsafe_buffer_usage` attribute

2023-01-31 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGacc3cc69e4d1: [-Wunsafe-buffer-usage] Introduce the unsafe_buffer_usage attribute (authored by t-rasmud). Herald added a project: clang. Herald added

[PATCH] D126097: [clang-tidy] Adds the NSDateFormatter checker to clang-tidy

2022-08-02 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG95a92995d45f: Adds the NSDateFormatter checker to clang-tidy (auth

[PATCH] D126097: [clang-tidy] Adds the NSDateFormatter checker to clang-tidy

2022-08-01 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 449144. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126097/new/ https://reviews.llvm.org/D126097 Files: clang-tools-extra/clang-tidy/objc/CMakeLists.txt clang-tools-extra/clang-tidy/objc/NSDateFormatterCheck.cpp clang-tools-extra/clang-tidy/

[PATCH] D126097: [clang-tidy] Adds the NSDateFormatter checker to clang-tidy

2022-08-01 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126097/new/ https://reviews.llvm.org/D126097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D126097: [clang-tidy] Adds the NSDateFormatter checker to clang-tidy

2022-07-13 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 444527. t-rasmud added a reviewer: ziqingluo-90. t-rasmud added a comment. Addresses review comments from the previously uploaded diff. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126097/new/ https://reviews.llvm.org/D126097 Files: clang-tools

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-30 Thread Rashmi Mudduluru via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGeb1d908e5cf7: Adds AST matcher for ObjCStringLiteral (authored by t-rasmud). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-30 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added a comment. In D128103#363 , @aaron.ballman wrote: > LGTM! Do you need me to commit on your behalf? If so, what name and email > address would you like me to use for patch attribution? Thank you @aaron.ballman. I believe I have the

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-29 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 441179. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128103/new/ https://reviews.llvm.org/D128103 Files: clang/docs/LibASTMatchersReference.html clang/docs/ReleaseNotes.rs

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-28 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 440766. t-rasmud added a comment. Removes manually added documentation and adds it in the header file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128103/new/ https://reviews.llvm.org/D128103 Files: clang/include/clang/ASTMatchers/ASTMatchers.

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-27 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 440450. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128103/new/ https://reviews.llvm.org/D128103 Files: clang/docs/LibASTMatchersReference.html clang/include/clang/ASTMatchers/ASTMatchers.h clang/lib/ASTMatchers/ASTMatchersInternal.cpp cla

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-27 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 440443. t-rasmud added a comment. Documentation edits and other fixes, thanks to suggestions from @ziqingluo-90 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128103/new/ https://reviews.llvm.org/D128103 Files: clang/docs/LibASTMatchersReference.

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-27 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 440359. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128103/new/ https://reviews.llvm.org/D128103 Files: clang/include/clang/ASTMatchers/ASTMatchers.h clang/lib/ASTMatchers/ASTMatchersInternal.cpp clang/lib/ASTMatchers/Dynamic/Registry.cpp

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-21 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud updated this revision to Diff 438852. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128103/new/ https://reviews.llvm.org/D128103 Files: clang-tools-extra/unittests/clang-tidy/CMakeLists.txt clang-tools-extra/unittests/clang-tidy/ObjCStr

[PATCH] D128103: Adds AST Matcher for ObjCStringLiteral

2022-06-17 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud created this revision. t-rasmud added reviewers: NoQ, usama54321. Herald added subscribers: carlosgalvezp, mgorny. Herald added a project: All. t-rasmud requested review of this revision. Herald added projects: clang, clang-tools-extra. Herald added a subscriber: cfe-commits. Repository:

[PATCH] D126097: Adds the NSDateFormatter checker to clang-tidy

2022-05-20 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud created this revision. t-rasmud added a reviewer: NoQ. Herald added subscribers: carlosgalvezp, mgorny. Herald added a project: All. t-rasmud requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Reports incorrect string patt

[PATCH] D124570: Revert "[analyzer][NFC] Refactor GenericTaintChecker to use CallDescriptionMap"

2022-04-28 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud abandoned this revision. t-rasmud added a comment. Abandoning this patch because it was a downstream problem and I incorrectly diagnosed it on the one source branch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124570/new/ https://review

[PATCH] D124570: Revert "[analyzer][NFC] Refactor GenericTaintChecker to use CallDescriptionMap"

2022-04-28 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud added a comment. In D124570#3479334 , @steakhal wrote: > I'm not comfortable with reverting this. > We depend on taint capabilities downstream, thus we would rather help fixing > the underlying issue. > Do you have a reproducer for the crash in

[PATCH] D124570: Revert "[analyzer][NFC] Refactor GenericTaintChecker to use CallDescriptionMap"

2022-04-27 Thread Rashmi Mudduluru via Phabricator via cfe-commits
t-rasmud created this revision. t-rasmud added a reviewer: NoQ. Herald added subscribers: manas, steakhal, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. t-rasmud requested review of this revis