[lld] 2f3256a - [lld/mac] Use C++17 structured bindings in two more places
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 8 08:09:55 PDT 2022
Author: Nico Weber
Date: 2022-08-08T11:09:44-04:00
New Revision: 2f3256a02ec330efd492e2d5a1cf8162cd78983a
URL: https://github.com/llvm/llvm-project/commit/2f3256a02ec330efd492e2d5a1cf8162cd78983a
DIFF: https://github.com/llvm/llvm-project/commit/2f3256a02ec330efd492e2d5a1cf8162cd78983a.diff
LOG: [lld/mac] Use C++17 structured bindings in two more places
No behavior change.
Added:
Modified:
lld/MachO/Driver.cpp
lld/MachO/SymbolTable.cpp
Removed:
################################################################################
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 583917aec73c..218e0d5a92e6 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -724,10 +724,7 @@ static TargetInfo *createTargetInfo(InputArgList &args) {
MachO::Target(getArchitectureFromName(archName), PLATFORM_MACCATALYST);
}
- uint32_t cpuType;
- uint32_t cpuSubtype;
- std::tie(cpuType, cpuSubtype) = getCPUTypeFromArchitecture(config->arch());
-
+ auto [cpuType, cpuSubtype] = getCPUTypeFromArchitecture(config->arch());
switch (cpuType) {
case CPU_TYPE_X86_64:
return createX86_64TargetInfo();
diff --git a/lld/MachO/SymbolTable.cpp b/lld/MachO/SymbolTable.cpp
index 3f341e146d84..de4af3c8a945 100644
--- a/lld/MachO/SymbolTable.cpp
+++ b/lld/MachO/SymbolTable.cpp
@@ -257,8 +257,7 @@ static Defined *createBoundarySymbol(const Undefined &sym) {
static void handleSectionBoundarySymbol(const Undefined &sym, StringRef segSect,
Boundary which) {
- StringRef segName, sectName;
- std::tie(segName, sectName) = segSect.split('$');
+ auto [segName, sectName] = segSect.split('$');
// Attach the symbol to any InputSection that will end up in the right
// OutputSection -- it doesn't matter which one we pick.
More information about the llvm-commits
mailing list