Page MenuHomePhabricator

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

Authored by dexonsmith on Wed, Oct 14, 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.Wed, Oct 14, 7:41 AM
arphaman accepted this revision.Wed, Oct 14, 6:37 PM
This revision is now accepted and ready to land.Wed, Oct 14, 6:37 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptWed, Oct 14, 7:43 PM
nikic added a subscriber: nikic.Sun, Oct 18, 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>.