This is an archive of the discontinued LLVM Phabricator instance.

SourceManager: Use the same fake SLocEntry whenever it fails to load
ClosedPublic

Authored by dexonsmith on Oct 19 2020, 3:55 PM.

Details

Summary

Instead of putting a fake SLocEntry at LoadedSLocEntryTable[Index]
when it fails to load in SourceManager::loadSLocEntry, allocate a fake
one. Unless someone is sniffing the address of the returned SLocEntry
(doubtful), this won't be a functionality change. Note that
SLocEntryLoaded[Index] wasn't being set to true either before or
after this change so no accessor is every going to look at
LoadedSLocEntryTable[Index].

As a side effect, drop the mutable from LoadedSLocEntryTable.

Diff Detail

Event Timeline

dexonsmith created this revision.Oct 19 2020, 3:55 PM
dexonsmith requested review of this revision.Oct 19 2020, 3:55 PM
This revision is now accepted and ready to land.Oct 26 2020, 3:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 26 2020, 5:57 PM