[all-commits] [llvm/llvm-project] a71c9d: [NFC][analyzer] Remove CheckerNameRef::getName() (...

Donát Nagy via All-commits all-commits at lists.llvm.org
Tue Mar 11 08:33:32 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a71c9d8438622013eddf04cf4c81ab0f22a83055
      https://github.com/llvm/llvm-project/commit/a71c9d8438622013eddf04cf4c81ab0f22a83055
  Author: Donát Nagy <donat.nagy at ericsson.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
    M clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
    M clang/lib/StaticAnalyzer/Core/BugReporter.cpp
    M clang/lib/StaticAnalyzer/Core/Checker.cpp
    M clang/lib/StaticAnalyzer/Core/CheckerManager.cpp

  Log Message:
  -----------
  [NFC][analyzer] Remove CheckerNameRef::getName() (#130780)

`CheckerNameRef` is a trivial wrapper around a `StringRef` which is
guaranteed to be owned by the `CheckerRegistry` (the only `friend` of
the class) because other code can't call the private constructor.

This class had offered two ways to recover the plain `StringRef`: an an
`operator StringRef()` for implicit conversion and a method `StringRef
getName()` which could be called explicitly.

However this method name was really confusing, because it implies "get
the name of this object" instead of "get this name as a plain
`StringRef`"; so I removed it from the codebase and used
`static_cast<StringRef>` in the two locations where the cast wasn't
performed implicitly.

This commit "prepares the ground" for planned improvements in checker
name handling.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list