mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 19:26:06 +00:00
[lld/mac] Use C++17 structured bindings
No behavior change. Differential Revision: https://reviews.llvm.org/D131355
This commit is contained in:
parent
8805cf2660
commit
b99da9d255
@ -152,8 +152,7 @@ void macho::writeMapFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dump table of symbols
|
// Dump table of symbols
|
||||||
Symbols liveSymbols, deadSymbols;
|
auto [liveSymbols, deadSymbols] = getSymbols();
|
||||||
std::tie(liveSymbols, deadSymbols) = getSymbols();
|
|
||||||
|
|
||||||
DenseMap<Symbol *, std::string> liveSymbolStrings =
|
DenseMap<Symbol *, std::string> liveSymbolStrings =
|
||||||
getSymbolStrings(liveSymbols);
|
getSymbolStrings(liveSymbols);
|
||||||
|
@ -51,10 +51,8 @@ Defined *SymbolTable::addDefined(StringRef name, InputFile *file,
|
|||||||
bool isPrivateExtern, bool isThumb,
|
bool isPrivateExtern, bool isThumb,
|
||||||
bool isReferencedDynamically, bool noDeadStrip,
|
bool isReferencedDynamically, bool noDeadStrip,
|
||||||
bool isWeakDefCanBeHidden) {
|
bool isWeakDefCanBeHidden) {
|
||||||
Symbol *s;
|
|
||||||
bool wasInserted;
|
|
||||||
bool overridesWeakDef = false;
|
bool overridesWeakDef = false;
|
||||||
std::tie(s, wasInserted) = insert(name, file);
|
auto [s, wasInserted] = insert(name, file);
|
||||||
|
|
||||||
assert(!isWeakDef || (isa<BitcodeFile>(file) && !isec) ||
|
assert(!isWeakDef || (isa<BitcodeFile>(file) && !isec) ||
|
||||||
(isa<ObjFile>(file) && file == isec->getFile()));
|
(isa<ObjFile>(file) && file == isec->getFile()));
|
||||||
@ -126,9 +124,7 @@ Defined *SymbolTable::aliasDefined(Defined *src, StringRef target) {
|
|||||||
|
|
||||||
Symbol *SymbolTable::addUndefined(StringRef name, InputFile *file,
|
Symbol *SymbolTable::addUndefined(StringRef name, InputFile *file,
|
||||||
bool isWeakRef) {
|
bool isWeakRef) {
|
||||||
Symbol *s;
|
auto [s, wasInserted] = insert(name, file);
|
||||||
bool wasInserted;
|
|
||||||
std::tie(s, wasInserted) = insert(name, file);
|
|
||||||
|
|
||||||
RefState refState = isWeakRef ? RefState::Weak : RefState::Strong;
|
RefState refState = isWeakRef ? RefState::Weak : RefState::Strong;
|
||||||
|
|
||||||
@ -147,9 +143,7 @@ Symbol *SymbolTable::addUndefined(StringRef name, InputFile *file,
|
|||||||
|
|
||||||
Symbol *SymbolTable::addCommon(StringRef name, InputFile *file, uint64_t size,
|
Symbol *SymbolTable::addCommon(StringRef name, InputFile *file, uint64_t size,
|
||||||
uint32_t align, bool isPrivateExtern) {
|
uint32_t align, bool isPrivateExtern) {
|
||||||
Symbol *s;
|
auto [s, wasInserted] = insert(name, file);
|
||||||
bool wasInserted;
|
|
||||||
std::tie(s, wasInserted) = insert(name, file);
|
|
||||||
|
|
||||||
if (!wasInserted) {
|
if (!wasInserted) {
|
||||||
if (auto *common = dyn_cast<CommonSymbol>(s)) {
|
if (auto *common = dyn_cast<CommonSymbol>(s)) {
|
||||||
@ -168,9 +162,7 @@ Symbol *SymbolTable::addCommon(StringRef name, InputFile *file, uint64_t size,
|
|||||||
|
|
||||||
Symbol *SymbolTable::addDylib(StringRef name, DylibFile *file, bool isWeakDef,
|
Symbol *SymbolTable::addDylib(StringRef name, DylibFile *file, bool isWeakDef,
|
||||||
bool isTlv) {
|
bool isTlv) {
|
||||||
Symbol *s;
|
auto [s, wasInserted] = insert(name, file);
|
||||||
bool wasInserted;
|
|
||||||
std::tie(s, wasInserted) = insert(name, file);
|
|
||||||
|
|
||||||
RefState refState = RefState::Unreferenced;
|
RefState refState = RefState::Unreferenced;
|
||||||
if (!wasInserted) {
|
if (!wasInserted) {
|
||||||
@ -203,9 +195,7 @@ Symbol *SymbolTable::addDynamicLookup(StringRef name) {
|
|||||||
|
|
||||||
Symbol *SymbolTable::addLazyArchive(StringRef name, ArchiveFile *file,
|
Symbol *SymbolTable::addLazyArchive(StringRef name, ArchiveFile *file,
|
||||||
const object::Archive::Symbol &sym) {
|
const object::Archive::Symbol &sym) {
|
||||||
Symbol *s;
|
auto [s, wasInserted] = insert(name, file);
|
||||||
bool wasInserted;
|
|
||||||
std::tie(s, wasInserted) = insert(name, file);
|
|
||||||
|
|
||||||
if (wasInserted) {
|
if (wasInserted) {
|
||||||
replaceSymbol<LazyArchive>(s, file, sym);
|
replaceSymbol<LazyArchive>(s, file, sym);
|
||||||
@ -223,9 +213,7 @@ Symbol *SymbolTable::addLazyArchive(StringRef name, ArchiveFile *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Symbol *SymbolTable::addLazyObject(StringRef name, InputFile &file) {
|
Symbol *SymbolTable::addLazyObject(StringRef name, InputFile &file) {
|
||||||
Symbol *s;
|
auto [s, wasInserted] = insert(name, &file);
|
||||||
bool wasInserted;
|
|
||||||
std::tie(s, wasInserted) = insert(name, &file);
|
|
||||||
|
|
||||||
if (wasInserted) {
|
if (wasInserted) {
|
||||||
replaceSymbol<LazyObject>(s, file, name);
|
replaceSymbol<LazyObject>(s, file, name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user