[all-commits] [llvm/llvm-project] af4fb4: clang/StaticAnalyzer: Stop using SourceManager::ge...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Wed Oct 14 21:34:44 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: af4fb416bd355960ce93f271a0591f24f58d25ec
      https://github.com/llvm/llvm-project/commit/af4fb416bd355960ce93f271a0591f24f58d25ec
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2020-10-15 (Thu, 15 Oct 2020)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
    M clang/lib/StaticAnalyzer/Core/BugReporter.cpp
    M clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
    M clang/lib/StaticAnalyzer/Core/IssueHash.cpp
    M clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
    M clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
    M clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

  Log Message:
  -----------
  clang/StaticAnalyzer: Stop using SourceManager::getBuffer

Update clang/lib/StaticAnalyzer to stop relying on a `MemoryBuffer*`,
using the `MemoryBufferRef` from `getBufferOrNone` or the
`Optional<MemoryBufferRef>` from `getBufferOrFake`, depending on whether
there's logic for checking validity of the buffer. The change to
clang/lib/StaticAnalyzer/Core/IssueHash.cpp is potentially a
functionality change, since the logic was wrong (it checked for
`nullptr`, which was never returned by the old API), but if that was
reachable the new behaviour should be better.

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




More information about the All-commits mailing list