[PATCH] D93351: [llvm-shlib] Build backend libraries as loadable modules
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 16 08:41:48 PST 2020
serge-sans-paille added inline comments.
================
Comment at: llvm/tools/llvm-shlib/libllvm.cpp:21
+
+ snprintf(SharedObjectName, 100, "LLVM%sBackend.so", Target);
+ Handle = dlopen(SharedObjectName, RTLD_LAZY | RTLD_NOLOAD);
----------------
It's probably safer to just use an ``llvm::raw_string_ostream`` here, as your code breaks if a Target has a very long name.
================
Comment at: llvm/tools/llvm-shlib/libllvm.cpp:40
+ if (!InitFunc) { \
+ return; \
+ } \
----------------
Not all targets have all these features, so I guess it's fine to ignore the errors when loading fails (?) But some are mandatory, maybe split the mandatory and non-mandatory components?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93351/new/
https://reviews.llvm.org/D93351
More information about the llvm-commits
mailing list