[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-08-05 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. In D145138#4561799 , @PiotrZSL wrote: > Test are failing, and I do not think that converting c-strings into > std::array is a good idea +1, they should typically be `char const*` instead. Repository: rG LLVM Github

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-08-04 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. Test are failing, and I do not think that converting c-strings into std::array is a good idea Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 ___

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-08-03 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 546991. ccotter marked an inline comment as done. ccotter added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang-tid

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-04-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:588 +: ClangTidyCheck(Name, Context), + IncludeInserter(Options.getLocalOrGlobal("IncludeStyle", + utils::IncludeSo

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-04-01 Thread Chris Cotter via Phabricator via cfe-commits
ccotter marked 5 inline comments as done. ccotter added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:496 + const Expr *SpelledExpr = E->IgnoreUnlessSpelledInSource(); + if (dyn_cast(SpelledExpr)) +

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-04-01 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 510270. ccotter added a comment. - format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp clan

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-04-01 Thread Chris Cotter via Phabricator via cfe-commits
ccotter marked an inline comment as done. ccotter added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays.cpp:170-172 + char init4[] = "abcdef"; + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not declare C-style arrays, use std

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-04-01 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 510267. ccotter added a comment. - Add tests for char[] Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCh

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-04-01 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 510262. ccotter added a comment. - Fix double curly brace matching in tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang-tidy/mode

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-26 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 508451. ccotter added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp clang-

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-25 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 508351. ccotter marked 8 inline comments as done. ccotter added a comment. - feedback Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-25 Thread Piotr Zegar via Phabricator via cfe-commits
PiotrZSL added a comment. To be honest, that's lot of hard to understand code that at start is unmaintainable. I don't see anyone even trying to understand all this and do some fixes in future. Consider some refactoring, to reduce amount of code, split it into some functions, add some comments

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-25 Thread Chris Cotter via Phabricator via cfe-commits
ccotter added inline comments. Herald added a subscriber: PiotrZSL. Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:588 +: ClangTidyCheck(Name, Context), + IncludeInserter(Options.getLocalOrGlobal("IncludeStyle", +

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-02 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:588 +: ClangTidyCheck(Name, Context), + IncludeInserter(Options.getLocalOrGlobal("IncludeStyle", + utils::IncludeS

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-02 Thread Chris Cotter via Phabricator via cfe-commits
ccotter marked 2 inline comments as done. ccotter added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:588 +: ClangTidyCheck(Name, Context), + IncludeInserter(Options.getLocalOrGlobal("IncludeStyle", +

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-02 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 502040. ccotter added a comment. - Add option doc, remove auto Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang-tidy/modernize/AvoidCA

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-02 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:94 + + auto StartOfFile = SM.getLocForStartOfFile(SM.getFileID(Location)); + while (Location != StartOfFile) { Please do not use `auto` unless type is

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-01 Thread Chris Cotter via Phabricator via cfe-commits
ccotter updated this revision to Diff 501733. ccotter added a comment. - Add more tests for whitespace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145138/new/ https://reviews.llvm.org/D145138 Files: clang-tools-extra/clang-tidy/modernize/Avoid

[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

2023-03-01 Thread Chris Cotter via Phabricator via cfe-commits
ccotter added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:532 + // TODO: How can I get FileCheck to accept '{{}}' as a non-regex match? + FixIts.push_back(FixItHint::CreateInsertion(InitRange.getBegin(), "{ ")); + FixIt