[all-commits] [llvm/llvm-project] b6c6da: SourceManager: Factor out helpers for common SLocE...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Thu Oct 22 18:32:02 PDT 2020


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

  Changed paths:
    M clang/include/clang/Basic/SourceManager.h
    M clang/lib/Basic/SourceManager.cpp

  Log Message:
  -----------
  SourceManager: Factor out helpers for common SLocEntry lookup pattern, NFC

Add helpers `getSLocEntryOrNull`, which handles the `Invalid` logic
around `getSLocEntry`, and `getSLocEntryForFile`, which also checks for
`SLocEntry::isFile`, and use them to reduce repeated code.

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




More information about the All-commits mailing list