[PATCH] D124164: [include-cleaner] Include-cleaner library structure, and simplistic AST walking.

2022-04-28 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson accepted this revision. CJ-Johnson added inline comments. Comment at: clang-tools-extra/include-cleaner/lib/WalkAST.cpp:18 +class ASTWalker : public RecursiveASTVisitor { + DeclCallback Callback; + Apologies for my ignorance of LLVM style. Should this

[PATCH] D117840: [clang-tidy] Update bugprone-stringview-nullptr to consistently prefer the empty string when passing arguments to constructors/functions

2022-01-20 Thread CJ Johnson 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 rGa5684114445a: [clang-tidy] Update bugprone-stringview-nullptr to c

[PATCH] D117840: [clang-tidy] Update bugprone-stringview-nullptr to consistently prefer the empty string when passing arguments to constructors/functions

2022-01-20 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. CJ-Johnson requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Previously, function(nullptr) would have been fixed with function({}). This unfort

[PATCH] D114823: Filter string_view from the nullptr diagnosis of bugprone-string-constructor to prevent duplicate warnings with bugprone-stringview-nullptr

2022-01-12 Thread CJ Johnson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG81c330e23dd4: Filter string_view from the nullptr diagnosis of bugprone-string-constructor to… (authored by CJ-Johnson). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-12 Thread CJ Johnson 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 rG7e29da875ca9: Add support for return values in bugprone-stringview-nullptr (authored by CJ-Johnson). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:263 + auto HandleConstructorInvocation = + makeRule(cxxConstructExpr(hasAnyArgument(ignoringImpCasts( +BasicStringViewConstruct

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 399436. CJ-Johnson marked an inline comment as done. CJ-Johnson added a comment. Add code comment about the choice of hasAnyArgument Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews.

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 399376. CJ-Johnson added a comment. Nits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews.llvm.org/D115121 Files: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp

[PATCH] D114823: Filter string_view from the nullptr diagnosis of bugprone-string-constructor to prevent duplicate warnings with bugprone-stringview-nullptr

2022-01-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. In D114823#3229990 , @njames93 wrote: > I'm in 2 minds about this. This diagnostic is a good fit for this warning and > shouldn't be removed. Likewise duplicate diagnostics from different checks is > annoying. Maybe a better

[PATCH] D114823: Filter string_view from the nullptr diagnosis of bugprone-string-constructor to prevent duplicate warnings with bugprone-stringview-nullptr

2022-01-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 399370. CJ-Johnson added a comment. Only filter out basic_string_view when bugprone-stringview-nullptr is enabled Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114823/new/ https://reviews.llvm.org/D114823 F

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-11 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 399139. CJ-Johnson added a comment. Nit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews.llvm.org/D115121 Files: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-11 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 399135. CJ-Johnson added a comment. Rebase on head Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews.llvm.org/D115121 Files: clang-tools-extra/clang-tidy/bugprone/StringviewNullptr

[PATCH] D115121: Update bugprone-stringview-nullptr to support return statements and constructors for any T which accepts basic_string_view

2022-01-11 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 399134. CJ-Johnson edited the summary of this revision. CJ-Johnson added a comment. Nit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews.llvm.org/D115121 Files: clang-tools-extra/

[PATCH] D115121: Update bugprone-stringview-nullptr to prefer the empty string for most edits

2022-01-11 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 399130. CJ-Johnson added a comment. Switching back to original plan of adding support for return statements Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews.llvm.org/D115121 Files:

[PATCH] D115452: Prevent abseil-cleanup-ctad check from stomping on surrounding context

2021-12-09 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson created this revision. CJ-Johnson added a reviewer: ymandel. Herald added a subscriber: carlosgalvezp. CJ-Johnson requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. This change applies two fixes to the abseil-cleanup-cta

[PATCH] D115121: Add support for return values in bugprone-stringview-nullptr

2021-12-06 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 392157. CJ-Johnson added a comment. Switch to using empty string edits everywhere except equality comparison Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews.llvm.org/D115121 Files:

[PATCH] D115121: Add support for return values in bugprone-stringview-nullptr

2021-12-05 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-stringview-nullptr.cpp:94-95 + +// TODO: Handle cases where types, such as Class and Struct below, are +// constructed with null arguments. +class Class { I a

[PATCH] D115121: Add support for return values in bugprone-stringview-nullptr

2021-12-05 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-stringview-nullptr.cpp:735 void function_invocation() /* f */ { + // Single Argument Function Invocation This diff is also noisy, but it's about adding missing

[PATCH] D115121: Add support for return values in bugprone-stringview-nullptr

2021-12-05 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 391940. CJ-Johnson added a comment. Add missing tests for function arguments and fix incorrect warning message for static_cast cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115121/new/ https://reviews

[PATCH] D115121: Add support for return values in bugprone-stringview-nullptr

2021-12-05 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:174-194 return applyFirst( {HandleTemporaryCXXFunctionalCastExpr, HandleTemporaryCXXTemporaryObjectExprAndCompoundLiteralExpr, - HandleTemporary

[PATCH] D115121: Add support for return values in bugprone-stringview-nullptr

2021-12-05 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson created this revision. CJ-Johnson added a reviewer: ymandel. Herald added a subscriber: carlosgalvezp. CJ-Johnson requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. bugprone-stringview-nullptr was not initially written w

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-12-01 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 391140. CJ-Johnson added a comment. Delete non-functional test cases (which were previously commented out) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files:

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-12-01 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 391068. CJ-Johnson added a comment. Add missing comment lines Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/Bugpro

[PATCH] D114823: Filter string_view from the nullptr diagnosis of bugprone-string-constructor to prevent duplicate warnings with bugprone-stringview-nullptr

2021-12-01 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 391040. CJ-Johnson marked an inline comment as done. CJ-Johnson added a comment. Switch to early return for the filter Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114823/new/ https://reviews.llvm.org/D1148

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-30 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. Pinging this thread with https://reviews.llvm.org/D113148 If we land both this revision and that one, then duplicate warnings won't be a problem. :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://rev

[PATCH] D114823: Filter string_view from the nullptr diagnosis of bugprone-string-constructor to prevent duplicate warnings with bugprone-stringview-nullptr

2021-11-30 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson created this revision. CJ-Johnson added reviewers: ymandel, alexfh, njames93, hokein, whisperity. Herald added subscribers: carlosgalvezp, rnkovacs. CJ-Johnson requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Updates t

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-30 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 390822. CJ-Johnson added a comment. Rebase on head Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModul

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-30 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 390820. CJ-Johnson added a comment. Address nits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-22 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. Thank you all for the feedback! Would it be ok to proceed with removing the `nullptr` checking for `basic_string_view` in `bugprone-string-constructor`, as Alex indicated? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-22 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 388973. CJ-Johnson added a comment. Rebase on head Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModul

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-22 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 388972. CJ-Johnson marked 6 inline comments as done. CJ-Johnson added a comment. Address reviewer comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files:

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 386904. CJ-Johnson marked 3 inline comments as done. CJ-Johnson added a comment. Address review comments from Yitzie Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson marked 5 inline comments as done. CJ-Johnson added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:75 + compoundLiteralExpr(has(StringViewConstructingFromNullExpr)), + changeTo(node("null_argument_expr"), cat(""))

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385635. CJ-Johnson added a comment. Add missing test cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneT

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385575. CJ-Johnson added a comment. Add additional tests for sv.empty() cases to ensure parens are removed where appropriate Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.or

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385532. CJ-Johnson added a comment. Rebase on head Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModul

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385531. CJ-Johnson added a comment. Add missing newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidy

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385530. CJ-Johnson added a comment. Add AST matcher support and tests for {{}} case where a null pointer is implicitly created Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-stringview-nullptr.cpp:84 + +(void)(std::string_view({nullptr})) /* a3 */; +// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: constructing basic_string_view from null is undefin

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385495. CJ-Johnson added a comment. Update test file to use truncated messages Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tid

[PATCH] D113195: [clang-tidy] Add check for initialization of `absl::Cleanup`.

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385489. CJ-Johnson added a comment. Fix documentation nit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113195/new/ https://reviews.llvm.org/D113195 Files: clang-tools-extra/clang-tidy/abseil/AbseilTidyMo

[PATCH] D113195: [clang-tidy] Add check for initialization of `absl::Cleanup`.

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385487. CJ-Johnson added a comment. Address nits and update the absl::Cleanup stub to be accurate with the real interface (with associated changes to the AST matcher) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D113195: [clang-tidy] Add check for initialization of `absl::Cleanup`.

2021-11-08 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson marked 4 inline comments as done. CJ-Johnson added a comment. Thanks for the review! I'll apply the same fixes to the string_view diff as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113195/new/ https://reviews.llvm.org/D113195 __

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-05 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385133. CJ-Johnson added a comment. nits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp cl

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-05 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 385130. CJ-Johnson added a comment. Remove double brackets for list initialization and use default initialization to avoid most vexing parse Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https:/

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384890. CJ-Johnson added a comment. Change static_cast suggested edit to use parens instead of braces Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clan

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384881. CJ-Johnson marked an inline comment as done. CJ-Johnson added a comment. Fix spelling error Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson marked an inline comment as done. CJ-Johnson added a comment. Thanks for the additional info, @aaron.ballman! I had not considered the issues with duplicate warnings. I agree that it would be annoying for users. That being the case, the second option ("remove the string_view nullptr c

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. In D113148#3108993 , @aaron.ballman wrote: > Generally speaking, we prefer to improve the existing checks. I think > `bugprone-string-constructor` would probably be a better place for the > constructor-related functionality.

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384775. CJ-Johnson added a comment. Remove trailing whitespace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/Bugpr

[PATCH] D113195: Suggests switching the initialization pattern of absl::Cleanup instances from the factory function to class template argument deduction (CTAD) in C++17 and higher.

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384774. CJ-Johnson added a comment. Add trailing newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113195/new/ https://reviews.llvm.org/D113195 Files: clang-tools-extra/clang-tidy/abseil/AbseilTidyMod

[PATCH] D113195: Suggests switching the initialization pattern of absl::Cleanup instances from the factory function to class template argument deduction (CTAD) in C++17 and higher.

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384773. CJ-Johnson added a comment. Remove unwanted changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113195/new/ https://reviews.llvm.org/D113195 Files: clang-tools-extra/clang-tidy/abseil/AbseilTidy

[PATCH] D113195: Suggests switching the initialization pattern of absl::Cleanup instances from the factory function to class template argument deduction (CTAD) in C++17 and higher.

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson created this revision. CJ-Johnson added a reviewer: ymandel. Herald added subscribers: carlosgalvezp, mgorny. CJ-Johnson requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Suggests switching the initialization pattern of

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-04 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. In D113148#3107897 , @Sockke wrote: > This seems to be an existing check. Have you compared it with > **bugprone-string-constructor**? Thanks for the suggestion! From what I can tell, bugprone-string-constructor check only h

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-03 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384599. CJ-Johnson added a comment. Add missing newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidy

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-03 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384598. CJ-Johnson added a comment. Remove mistaken changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/Bugprone

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-03 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 384597. CJ-Johnson added a comment. Remove mistaken changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113148/new/ https://reviews.llvm.org/D113148 Files: clang-tools-extra/clang-tidy/bugprone/Bugprone

[PATCH] D17993: [CodeGen] Apply 'nonnull' and 'dereferenceable(N)' to 'this' pointer arguments.

2020-11-16 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. In D17993#2398337 , @jdoerfert wrote: > Please modify the commit subject and add a proper message. Thank you for the reminder! It slipped my mind. Fixed :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ ht

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-11-16 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 305603. Herald added a subscriber: lxfind. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 Files: clang/docs/ReleaseNotes.rst clang/lib/CodeGen/CGCall.cpp clang/test/CXX/except/except.spec/p14-ir.cpp

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-11-07 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: clang/test/CodeGenCXX/this-nonnull.cpp:1-2 +// RUN: %clang_cc1 -S -emit-llvm -o - -triple %itanium_abi_triple %s | FileCheck %s -check-prefix=CHECK-YES +// RUN: %clang_cc1 -S -emit-llvm -o - -fno-delete-null-pointer-checks -triple %

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-11-07 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 303648. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 Files: clang/docs/ReleaseNotes.rst clang/lib/CodeGen/CGCall.cpp clang/test/CXX/except/except.spec/p14-ir.cpp clang/test/CodeGen/arm64-microsof

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-11-02 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson marked an inline comment as done. CJ-Johnson added a comment. In D17993#2367447 , @rsmith wrote: > Thanks! We should also have a test for the behavior when targeting the MS > ABI, where we sometimes don't emit the `nonnull dereferenceable` beca

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-11-02 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 302236. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 Files: clang/docs/ReleaseNotes.rst clang/lib/CodeGen/CGCall.cpp clang/test/CXX/except/except.spec/p14-ir.cpp clang/test/CodeGen/arm64-microsof

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-31 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. The new tests can be found in this-nonnull.cpp: https://reviews.llvm.org/differential/changeset/?ref=2242268 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 ___ cfe-commits

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-31 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 302107. CJ-Johnson marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CXX/except/except.spec/p14-ir.cpp clang/test/CodeGen

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-31 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson marked an inline comment as done. CJ-Johnson added inline comments. Comment at: clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp:126 // -// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](i8* %[[RIGHT]]) +// CHECK: call x86_thiscallcc void %[[V

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2174 + } + unsigned ArgNo = 0; jdoerfert wrote: > Even if null pointer is valid we should place dereferenceable. > > We also could never place nonnull and let the middle-end make the

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 297655. CJ-Johnson added a comment. Apply dereferenceable even if null is a valid address CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CXX/except/exce

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp:1082 +bool isGFX9Plus(const MCSubtargetInfo &STI) { + return isGFX9(STI) || isGFX10(STI); +} CJ-Johnson wrote: > arsenm wrote: > > How are these changes related? > This

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp:1082 +bool isGFX9Plus(const MCSubtargetInfo &STI) { + return isGFX9(STI) || isGFX10(STI); +} arsenm wrote: > How are these changes related? This is a mistake. I did not

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 297647. CJ-Johnson added a comment. Update with full diff context CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CXX/except/except.spec/p14-ir.cpp cla

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 297645. CJ-Johnson added a comment. Herald added subscribers: llvm-commits, kerbowa, hiraditya, nhaehnle, arsenm. Herald added a project: LLVM. Update diff with full context CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. In D17993#2325610 , @jdoerfert wrote: > Can you please upload again with full context? My apologies, I am new to LLVM contribution. What is the best way to do that such that it squashes all of my local git commits? CHANGES S

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 297640. CJ-Johnson edited the summary of this revision. CJ-Johnson added a comment. Herald added subscribers: jdoerfert, aheejin, sbc100, jvesely, dschuff. Rebasing on head, removing flag changes since that was added in https://reviews.llvm.org/D47894 and

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-12 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson commandeered this revision. CJ-Johnson added a reviewer: bkramer. CJ-Johnson added a comment. The patch is ready! Commandeering this change :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 ___

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-09 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. After chatting with bkramer , I'm working on rebasing this diff so that it can be landed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17993/new/ https://reviews.llvm.org/D17993 _

[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.

2020-10-09 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added inline comments. Comment at: include/clang/Driver/Options.td:1157 +def fno_delete_null_pointer_checks : Flag<["-"], "fno-delete-null-pointer-checks">, + Group, Flags<[CC1Option]>; rjmccall wrote: > Please include HelpText, and it's probably w

[PATCH] D32199: [TySan] A Type Sanitizer (Clang)

2020-07-16 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson added a comment. Hello to everyone following along! My apologies for the lack of activity; I should have made a comment sooner. Back in December/January I was exploring working on TySan (met with Hal and Richard, in addition to rebasing the diffs). After digging into the problem spa

[PATCH] D32199: [TySan] A Type Sanitizer (Clang)

2020-01-02 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 235948. CJ-Johnson edited the summary of this revision. CJ-Johnson added a comment. Herald added a project: clang. Fixing rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D32199/new/ https://reviews.llvm.

[PATCH] D32199: [TySan] A Type Sanitizer (Clang)

2020-01-02 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson updated this revision to Diff 235944. CJ-Johnson added a comment. Rebase on head CHANGES SINCE LAST ACTION https://reviews.llvm.org/D32199/new/ https://reviews.llvm.org/D32199 Files: clang/include/clang/Basic/Features.def clang/include/clang/Basic/Sanitizers.def clang/includ

[PATCH] D32199: [TySan] A Type Sanitizer (Clang)

2020-01-02 Thread CJ Johnson via Phabricator via cfe-commits
CJ-Johnson commandeered this revision. CJ-Johnson added a reviewer: hfinkel. CJ-Johnson added a comment. After discussing things with Hal, I'm going to take over these diffs and try to update them to the new pass manager :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D32199/new/ https