[PECOFF] Add /IMPLIB command line option.
This option is to override the default import file path.
llvm-svn: 207175
diff --git a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
index b3c66fd..474b148 100644
--- a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
@@ -268,6 +268,14 @@
<< "' specified more than once.\n";
}
+std::string PECOFFLinkingContext::getOutputImportLibraryPath() const {
+ if (!_implib.empty())
+ return _implib;
+ SmallString<128> path = outputPath();
+ llvm::sys::path::replace_extension(path, ".lib");
+ return path.str();
+}
+
void PECOFFLinkingContext::addPasses(PassManager &pm) {
pm.add(std::unique_ptr<Pass>(new pecoff::SetSubsystemPass(*this)));
pm.add(std::unique_ptr<Pass>(new pecoff::EdataPass(*this)));