This is an archive of the discontinued LLVM Phabricator instance.

Make SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer*
ClosedPublic

Authored by thakis on Apr 3 2019, 9:05 PM.

Details

Summary

Requires making the llvm::MemoryBuffer* stored by SourceManager const, which in turn requires making the accessors for that return const llvm::MemoryBuffer*s and updating all call sites.

The original motivation for this was to use it and fix the TODO in CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag version of createFileID, and since llvm::SourceMgr* hands out a const llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO this way actually works, but this seems like a good change on its own anyways.

No intended behavior change.

Diff Detail

Event Timeline

thakis created this revision.Apr 3 2019, 9:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2019, 9:05 PM
rnk accepted this revision.Apr 4 2019, 1:40 PM

lgtm!

This revision is now accepted and ready to land.Apr 4 2019, 1:40 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2019, 2:06 PM