[all-commits] [llvm/llvm-project] b03ae7: clang/Lex: Stop using SourceManager::getBuffer

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Mon Oct 19 17:28:50 PDT 2020


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

  Changed paths:
    M clang/lib/Lex/ModuleMap.cpp
    M clang/lib/Lex/PPDirectives.cpp

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

Update clang/lib/Lex to stop relying on a `MemoryBuffer*`, using the
`MemoryBufferRef` from `getBufferOrNone` since both locations had logic
for checking validity of the buffer. There's 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/D89402




More information about the All-commits mailing list