[lld] r208428 - [PECOFF] DLL extension can be omitted in .def file.

Rui Ueyama ruiu at google.com
Fri May 9 09:35:26 PDT 2014


Author: ruiu
Date: Fri May  9 11:35:26 2014
New Revision: 208428

URL: http://llvm.org/viewvc/llvm-project?rev=208428&view=rev
Log:
[PECOFF] DLL extension can be omitted in .def file.

Modified:
    lld/trunk/lib/Driver/WinLinkModuleDef.cpp
    lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp

Modified: lld/trunk/lib/Driver/WinLinkModuleDef.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkModuleDef.cpp?rev=208428&r1=208427&r2=208428&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkModuleDef.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkModuleDef.cpp Fri May  9 11:35:26 2014
@@ -153,6 +153,8 @@ bool Parser::parseOne(Directive *&ret) {
     uint64_t baseaddr;
     if (!parseName(name, baseaddr))
       return false;
+    if (!StringRef(name).endswith_lower(".dll"))
+      name.append(".dll");
     ret = new (_alloc) Library(name, baseaddr);
     return true;
   }

Modified: lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp?rev=208428&r1=208427&r2=208428&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/WinLinkModuleDefTest.cpp Fri May  9 11:35:26 2014
@@ -144,7 +144,7 @@ TEST_F(ParserTest, Multiple) {
         "VERSION 12");
   EXPECT_EQ(3U, _dirs.size());
   auto *lib = cast<moduledef::Library>(_dirs[0]);
-  EXPECT_EQ("foo", lib->getName());
+  EXPECT_EQ("foo.dll", lib->getName());
 
   const std::vector<PECOFFLinkingContext::ExportDesc> &exports =
       cast<moduledef::Exports>(_dirs[1])->getExports();





More information about the llvm-commits mailing list