This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Also import overwritten file buffers
ClosedPublic

Authored by teemperor on Apr 14 2020, 12:33 AM.

Details

Summary

Overwritten file buffers are at the moment ignored when importing and
instead only the underlying file buffer is imported.

This patch fixes this by not going to the underlying file entry if the file has
an overwritten buffer.

Diff Detail

Event Timeline

teemperor created this revision.Apr 14 2020, 12:33 AM
shafik accepted this revision.Apr 14 2020, 2:36 PM

LGTM

This revision is now accepted and ready to land.Apr 14 2020, 2:36 PM
martong accepted this revision.Apr 15 2020, 8:53 AM

Okay, no objections.
Just out of curiosity, do you guys rewrite the content of a buffer in D78095 or in a later patch?

Okay, no objections.
Just out of curiosity, do you guys rewrite the content of a buffer in D78095 or in a later patch?

D78095 is already rewriting it. In the future we want to load the real source code in LLDB and D78095 is only the fallback code path that will be used when a file can't be found. In that case we just take the real file path with our own made-up file buffer. A follow-up patch actually implements the real file loading. But until that follow-up patch is done, D78095 is essentially what we use in LLDB to always set for every file a overwritten file buffer.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 4:47 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript