viroulep added a comment.

Thanks for your review @w2yehia!



================
Comment at: llvm/lib/Passes/PassPluginLoader.cpp:23
+void PassPluginLoader::operator=(const std::string &Filename) {
+  sys::SmartScopedLock<true> Lock(*PluginsLock);
+  auto PassPlugin = PassPlugin::Load(Filename);
----------------
w2yehia wrote:
> why do we need a lock? 
> Is there a use case where multiple threads enter this function.
> Right now, the only place we create a `PassPluginLoader` is in 
> `cl::opt<PassPluginLoader> PassPlugins`.
That's a very good question that I couldn't answer: I based the implementation 
on what is done over in [[ 
https://github.com/llvm/llvm-project/blame/main/llvm/lib/Support/PluginLoader.cpp
 | PluginLoader ]], but I too wondered why it was guarded ([[ 
https://github.com/llvm/llvm-project/commit/bee30f58fb3f65d980fa15c14aa9546145521619
 | this commit ]] introduces it but I couldn't find more details).

I'm fine with removing it unless someone can provide a use case where we need 
it; I'll update the patch!



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130889

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to