[libc-commits] [PATCH] D151231: [libc][NFC] Move the Linux file implementation to a subdirectory

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon May 29 20:10:07 PDT 2023


jhuber6 added inline comments.


================
Comment at: libc/src/__support/File/CMakeLists.txt:37
+add_subdirectory(${LIBC_TARGET_OS})
+set(target_file libc.src.__support.File.${LIBC_TARGET_OS}.${LIBC_TARGET_OS}_file)
+set(target_dir libc.src.__support.File.${LIBC_TARGET_OS}.${LIBC_TARGET_OS}_dir)
----------------
lntue wrote:
> jhuber6 wrote:
> > lntue wrote:
> > > jhuber6 wrote:
> > > > lntue wrote:
> > > > > Since the targets are moved to separate sub-folders, shall we drop the prefix `${LIBC_TARGET_OS}_` from the target name?
> > > > We could, I was mostly just copying the interface from how we handle OSUtil.
> > > Can you change it so that it matches other folders' structure?
> > I thought that's what we have now. For something like `OSUtil` we have a `linux/` subdirectory which provides `linux_unit`.
> So for example you can see that in `OSUtil`, each sub-target has `io.h` or `syscall.h` instead of `target_io.h` or `target_syscall.h`
Well the files are called `file.cpp` and `dir.cpp`, it's just the CMake target name that's different, I guess in the off-chance that we'd ever build two of these at one time, like there's a generic version or something.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151231/new/

https://reviews.llvm.org/D151231



More information about the libc-commits mailing list