This is an archive of the discontinued LLVM Phabricator instance.

SourceManager: Factor out helpers for common SLocEntry lookup pattern, NFC
ClosedPublic

Authored by dexonsmith on Oct 15 2020, 3:21 PM.

Details

Summary

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.

Diff Detail