[PATCH] D119049: [LLD] Allow usage of LLD as a library
Alexandre Ganea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 11:23:10 PST 2023
aganea added inline comments.
================
Comment at: lld/Common/CMakeLists.txt:34
Filesystem.cpp
+ LLDLibrary.cpp
Memory.cpp
----------------
sbc100 wrote:
> Can we come up with a better name for this file maybe? That name makes me think its specifically for the library use case but that isn't true.
>
> Also, we don't capitalize lld elsewhere, with in the filenames or directory names.
>
> How about `lldMain.cpp`, or perhaps we can come up with a name that doesn't start with `lld` at all?
>
>
`DriversMain.cpp` ?
================
Comment at: lld/include/lld/Common/Driver.h:27
// by cleanup.
-SafeReturn safeLldMain(int argc, const char **argv, llvm::raw_ostream &stdoutOS,
+SafeReturn safeLldMain(std::vector<const char *> &args,
+ llvm::raw_ostream &stdoutOS,
----------------
sbc100 wrote:
> Why not `llvm::ArrayRef<const char *>`?
Please see updated diff. We had `std::vector` just because of how the `-flavor` flag is treated and then stripped from `args`. I changed to `llvm::ArrayRef` as you suggested and added `-flavor` in all drivers as a shallow flag. If we want to go that route, I could send a separate patch for that change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119049/new/
https://reviews.llvm.org/D119049
More information about the llvm-commits
mailing list