[PATCH] D89503: SourceManager: Factor out helpers for common SLocEntry lookup pattern, NFC
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 15 15:21:05 PDT 2020
dexonsmith created this revision.
dexonsmith added a reviewer: arphaman.
Herald added a subscriber: ributzka.
dexonsmith requested review of this revision.
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.
https://reviews.llvm.org/D89503
Files:
clang/include/clang/Basic/SourceManager.h
clang/lib/Basic/SourceManager.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89503.298487.patch
Type: text/x-patch
Size: 11067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201015/46821536/attachment-0001.bin>
More information about the cfe-commits
mailing list