================
@@ -85,11 +85,18 @@ void tools::MinGW::Linker::AddLibGCC(const ArgList &Args,
 
   CmdArgs.push_back("-lmoldname");
   CmdArgs.push_back("-lmingwex");
-  for (auto Lib : Args.getAllArgValues(options::OPT_l))
+  for (auto Lib : Args.getAllArgValues(options::OPT_l)) {
     if (StringRef(Lib).starts_with("msvcr") ||
         StringRef(Lib).starts_with("ucrt") ||
-        StringRef(Lib).starts_with("crtdll"))
+        StringRef(Lib).starts_with("crtdll")) {
+      Lib = (llvm::Twine("-l") + Lib).str();
----------------
mstorsjo wrote:

I'd kinda prefer to declare a new variable instead of reusing `Lib` here. 
Especially with `Lib` being declared `auto`, its type is not entirely obvious 
here, so it would feel clearer if we'd declare the new one e.g. explicitly 
`std::string` here.

https://github.com/llvm/llvm-project/pull/149434
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to