This is an archive of the discontinued LLVM Phabricator instance.

[llvm][vfs] Abstract in-memory node creation
ClosedPublic

Authored by jansvoboda11 on Jan 19 2022, 1:31 AM.

Details

Summary

The creation of in-memory VFS nodes happens in a single function that deduces what kind of node to create from the arguments. This leads to complicated if-then-else logic that's difficult to cleanly extend.

This patch abstracts away in-memory node creation via a type-erased factory function that's passed instead.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jan 19 2022, 1:31 AM
jansvoboda11 requested review of this revision.Jan 19 2022, 1:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2022, 1:31 AM
dexonsmith accepted this revision.Jan 19 2022, 1:55 PM

LGTM, I think this cleanup makes sense.

This revision is now accepted and ready to land.Jan 19 2022, 1:55 PM
This revision was automatically updated to reflect the committed changes.