[all-commits] [llvm/llvm-project] 3afe3d: [clang-tidy] Fix readability-static-accessed-throu...

AMS21 via All-commits all-commits at lists.llvm.org
Tue Apr 4 00:25:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3afe3dbfa0157608aa1d058f6be28e0060aaf9c6
      https://github.com/llvm/llvm-project/commit/3afe3dbfa0157608aa1d058f6be28e0060aaf9c6
  Author: AMS21 <AMS21.github at gmail.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/readability/static-accessed-through-instance.cpp

  Log Message:
  -----------
  [clang-tidy] Fix readability-static-accessed-through-instance check for anonymous structs

Previously we would provide a fixit which looked like
this `unnamed struct at ...::f()` but which is obviously
not valid C/C++.

Since there is no real nice way to accesses a static function
from an anonymous struct anyways we simply ignore all
anonymous structs.

Fixes llvm#61736

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D147411


  Commit: 25956d55d02489964428ab5f55e609ff16c6632d
      https://github.com/llvm/llvm-project/commit/25956d55d02489964428ab5f55e609ff16c6632d
  Author: AMS21 <AMS21.github at gmail.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/unchecked-optional-access.cpp
    M clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp

  Log Message:
  -----------
  [clang-tidy] Allow bugprone-unchecked-optional-access to handle calls to `std::forward`

The check now understands that calling `std::forward`
will not modify the underlying optional value.

This fixes llvm#59705

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D147383


  Commit: e588ef8a7a531380836e17242c2c2276559df0b9
      https://github.com/llvm/llvm-project/commit/e588ef8a7a531380836e17242c2c2276559df0b9
  Author: AMS21 <AMS21.github at gmail.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
    M clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h

  Log Message:
  -----------
  [clang-tidy] Small refactor for ExceptionAnalyzer

- Use llvm::DenseMap<> with pre-allocation instead of std::map<> for FunctionCache
- Avoid double lookup for FunctionCache
- Use try_emplace instead of insert
- Simplify definition of State enum

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D147376


Compare: https://github.com/llvm/llvm-project/compare/745a957f9dc5...e588ef8a7a53


More information about the All-commits mailing list