This is an archive of the discontinued LLVM Phabricator instance.

clang/Basic: Stop using SourceManager::getBuffer, NFC
ClosedPublic

Authored by dexonsmith on Oct 14 2020, 7:41 AM.

Details

Summary

Update clang/lib/Basic to stop relying on a MemoryBuffer*, using the
MemoryBufferRef from getBufferOrNone or getBufferOrFake instead of
getBuffer.

Diff Detail

Event Timeline

dexonsmith created this revision.Oct 14 2020, 7:41 AM
arphaman accepted this revision.Oct 14 2020, 6:37 PM
This revision is now accepted and ready to land.Oct 14 2020, 6:37 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2020, 7:43 PM
nikic added a subscriber: nikic.Oct 18 2020, 1:49 AM

FYI this showed up as a 1% compile-time regression in terms of instructions retired for O0-g builds: https://llvm-compile-time-tracker.com/compare.php?from=32a4ad3b6ce6028a371b028cf06fa5feff9534bf&to=54c1bcab90102481fe43b73f8547d47446ba2163&stat=instructions

Looking at the diff, it's not really obvious to me what could cause that, possibly GCC is just really bad at optimizing Optional<MemoryBufferRef>.