Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
[oota-llvm.git] / lib / Linker / LinkModules.cpp
index dd0b07e09bda59f24a4ad2ef0327dfa2d82260e7..c710d7ee8692a2c93c2fdfe3ff02621bcb252a54 100644 (file)
@@ -1301,10 +1301,9 @@ Linker::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) {
 
   // If the source library's module id is in the dependent library list of the
   // destination library, remove it since that module is now linked in.
-  sys::Path modId;
-  modId.set(Src->getModuleIdentifier());
-  if (!modId.isEmpty())
-    Dest->removeLibrary(modId.getBasename());
+  const std::string &modId = Src->getModuleIdentifier();
+  if (!modId.empty())
+    Dest->removeLibrary(sys::path::stem(modId));
 
   return false;
 }