summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/COFFModuleDefinition.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-07-19 02:01:22 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-07-19 02:01:22 +0000
commit08e5f6853bcc39b0695ef140b387851a8624270f (patch)
treeb4bc5108c3c21cdc954cd595e4278e3c1e3bede9 /llvm/lib/Object/COFFModuleDefinition.cpp
parent984f1dc338437eaa8a66a42f3f4294d51543ec26 (diff)
downloadbcm5719-llvm-08e5f6853bcc39b0695ef140b387851a8624270f.tar.gz
bcm5719-llvm-08e5f6853bcc39b0695ef140b387851a8624270f.zip
Object: preserve more information about DEF file
Preserve the actual library name as provided by the user. This is required to properly replicate link's behaviour about the module import name handling. This requires an associated change to lld for updating the tests for the proper behaviour for the import library module name handling in various cases. Associated tests will be part of the lld change. llvm-svn: 308406
Diffstat (limited to 'llvm/lib/Object/COFFModuleDefinition.cpp')
-rw-r--r--llvm/lib/Object/COFFModuleDefinition.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Object/COFFModuleDefinition.cpp b/llvm/lib/Object/COFFModuleDefinition.cpp
index 5fa06e977fd..ed9140d1fe0 100644
--- a/llvm/lib/Object/COFFModuleDefinition.cpp
+++ b/llvm/lib/Object/COFFModuleDefinition.cpp
@@ -188,13 +188,17 @@ private:
std::string Name;
if (Error Err = parseName(&Name, &Info.ImageBase))
return Err;
- // Append the appropriate file extension if not already present.
- if (!sys::path::has_extension(Name))
- Name += IsDll ? ".dll" : ".exe";
+
+ Info.ImportName = Name;
// Set the output file, but don't override /out if it was already passed.
- if (Info.OutputFile.empty())
+ if (Info.OutputFile.empty()) {
Info.OutputFile = Name;
+ // Append the appropriate file extension if not already present.
+ if (!sys::path::has_extension(Name))
+ Info.OutputFile += IsDll ? ".dll" : ".exe";
+ }
+
return Error::success();
}
case KwVersion:
OpenPOWER on IntegriCloud