summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Object/COFFModuleDefinition.h1
-rw-r--r--llvm/lib/Object/COFFModuleDefinition.cpp12
2 files changed, 9 insertions, 4 deletions
diff --git a/llvm/include/llvm/Object/COFFModuleDefinition.h b/llvm/include/llvm/Object/COFFModuleDefinition.h
index 17491b81d5b..be139a2833b 100644
--- a/llvm/include/llvm/Object/COFFModuleDefinition.h
+++ b/llvm/include/llvm/Object/COFFModuleDefinition.h
@@ -28,6 +28,7 @@ namespace object {
struct COFFModuleDefinition {
std::vector<COFFShortExport> Exports;
std::string OutputFile;
+ std::string ImportName;
uint64_t ImageBase = 0;
uint64_t StackReserve = 0;
uint64_t StackCommit = 0;
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