This is an archive of the discontinued LLVM Phabricator instance.

clang/StaticAnalyzer: Stop using SourceManager::getBuffer
ClosedPublic

Authored by dexonsmith on Oct 14 2020, 11:11 AM.

Details

Summary

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.

Diff Detail

Event Timeline

dexonsmith created this revision.Oct 14 2020, 11:11 AM

Fix a warning about an unused Invalid flag.

Szelethus accepted this revision.Oct 14 2020, 2:31 PM

Sounds good! Thanks!

This revision is now accepted and ready to land.Oct 14 2020, 2:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2020, 9:34 PM