forked from OSchip/llvm-project
COFF: Suppress "Duplicate entry" warning of lib.exe
We create a module-definition file and give that to lib.exe to create an import library file. A module-definition has to be syntactically and semantically correct, of course. There was a case that we created a module-definition file that lib.exe would complain for duplicate entries. If a user gives an unmangled and mangled name for the same symbol, we would end up having two duplicate lines for the mangled name in a module- definition file. This patch fixes that issue by uniquefying entries by mangled symbol name. llvm-svn: 243587
This commit is contained in:
parent
dd2eb13ac4
commit
966acb2e2f
|
@ -444,17 +444,16 @@ std::error_code fixupExports() {
|
|||
std::map<StringRef, Export *> Map;
|
||||
std::vector<Export> V;
|
||||
for (Export &E : Config->Exports) {
|
||||
auto Pair = Map.insert(std::make_pair(E.Name, &E));
|
||||
auto Pair = Map.insert(std::make_pair(E.ExtLibName, &E));
|
||||
bool Inserted = Pair.second;
|
||||
if (Inserted) {
|
||||
V.push_back(E);
|
||||
continue;
|
||||
}
|
||||
Export *Existing = Pair.first->second;
|
||||
if (E == *Existing)
|
||||
if (E == *Existing || E.Name != Existing->Name)
|
||||
continue;
|
||||
llvm::errs() << "warning: duplicate /export option: " << E.Name << "\n";
|
||||
continue;
|
||||
}
|
||||
Config->Exports = std::move(V);
|
||||
|
||||
|
|
Loading…
Reference in New Issue