[lld] r299184 - Re-apply r299168 and r299169 now that the libdeps are fixed.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 30 21:47:07 PDT 2017
Author: pcc
Date: Thu Mar 30 23:47:07 2017
New Revision: 299184
URL: http://llvm.org/viewvc/llvm-project?rev=299184&view=rev
Log:
Re-apply r299168 and r299169 now that the libdeps are fixed.
Modified:
lld/trunk/COFF/InputFiles.cpp
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=299184&r1=299183&r2=299184&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Thu Mar 30 23:47:07 2017
@@ -355,13 +355,12 @@ void BitcodeFile::parse() {
SymbolBody *Alias = Symtab->addUndefined(Saver.save(Fallback));
checkAndSetWeakAlias(Symtab, this, Sym->body(), Alias);
} else {
- Expected<int> ComdatIndex = ObjSym.getComdatIndex();
- bool IsCOMDAT = ComdatIndex && *ComdatIndex != -1;
+ bool IsCOMDAT = ObjSym.getComdatIndex() != -1;
Sym = Symtab->addRegular(this, SymName, IsCOMDAT);
}
SymbolBodies.push_back(Sym->body());
}
- Directives = check(Obj->getLinkerOpts());
+ Directives = Obj->getCOFFLinkerOpts();
}
MachineTypes BitcodeFile::getMachineType() {
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=299184&r1=299183&r2=299184&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Mar 30 23:47:07 2017
@@ -818,7 +818,7 @@ static Symbol *createBitcodeSymbol(const
uint8_t Visibility = mapVisibility(ObjSym.getVisibility());
bool CanOmitFromDynSym = ObjSym.canBeOmittedFromSymbolTable();
- int C = check(ObjSym.getComdatIndex(), F->LogName);
+ int C = ObjSym.getComdatIndex();
if (C != -1 && !KeptComdats[C])
return Symtab<ELFT>::X->addUndefined(NameRef, /*IsLocal=*/false, Binding,
Visibility, Type, CanOmitFromDynSym,
@@ -855,10 +855,8 @@ void BitcodeFile::parse(DenseSet<CachedH
Obj = check(lto::InputFile::create(MBRef), this->LogName);
std::vector<bool> KeptComdats;
- for (StringRef S : Obj->getComdatTable()) {
- StringRef N = Saver.save(S);
- KeptComdats.push_back(ComdatGroups.insert(CachedHashStringRef(N)).second);
- }
+ for (StringRef S : Obj->getComdatTable())
+ KeptComdats.push_back(ComdatGroups.insert(CachedHashStringRef(S)).second);
for (const lto::InputFile::Symbol &ObjSym : Obj->symbols())
Symbols.push_back(createBitcodeSymbol<ELFT>(KeptComdats, ObjSym, this));
More information about the llvm-commits
mailing list