[PATCH] D117648: [llvm][vfs] Abstract in-memory node creation

Jan Svoboda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 01:31:11 PST 2022


jansvoboda11 created this revision.
jansvoboda11 added reviewers: sammccall, dexonsmith.
Herald added a subscriber: hiraditya.
jansvoboda11 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117648

Files:
  llvm/include/llvm/Support/VirtualFileSystem.h
  llvm/lib/Support/VirtualFileSystem.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117648.401133.patch
Type: text/x-patch
Size: 7146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220119/c0444aed/attachment.bin>


More information about the llvm-commits mailing list