[llvm] ecf132d - [llvm-libtool-darwin] Remove var to fix use

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 11:09:00 PST 2022


Author: Keith Smiley
Date: 2022-02-03T11:07:14-08:00
New Revision: ecf132debcda6b718093d52da6cde2f5e5a7c63a

URL: https://github.com/llvm/llvm-project/commit/ecf132debcda6b718093d52da6cde2f5e5a7c63a
DIFF: https://github.com/llvm/llvm-project/commit/ecf132debcda6b718093d52da6cde2f5e5a7c63a.diff

LOG: [llvm-libtool-darwin] Remove var to fix use

This seems to have been moved so the second use is invalid on Linux but
not macOS

Added: 
    

Modified: 
    llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
index a5c664c6de1d1..8b6b2645d1f81 100644
--- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
@@ -360,9 +360,8 @@ class MembersBuilder {
 
       auto *O = dyn_cast<MachOObjectFile>(ObjOrErr->get());
       uint32_t FileCPUType, FileCPUSubtype;
-      StringRef ArchName = O->getArchTriple().getArchName();
       std::tie(FileCPUType, FileCPUSubtype) = MachO::getCPUTypeFromArchitecture(
-          MachO::getArchitectureFromName(ArchName));
+          MachO::getArchitectureFromName(O->getArchTriple().getArchName()));
 
       // If -arch_only is specified then skip this file if it doesn't match
       // the architecture specified.
@@ -373,7 +372,7 @@ class MembersBuilder {
       if (!NoWarningForNoSymbols && O->symbols().empty())
         WithColor::warning() << "'" + Member.MemberName +
                                     "': has no symbols for architecture " +
-                                    ArchName + "\n";
+                                    O->getArchTriple().getArchName() + "\n";
 
       uint64_t FileCPUID = getCPUID(FileCPUType, FileCPUSubtype);
       Builder.Data.MembersPerArchitecture[FileCPUID].push_back(


        


More information about the llvm-commits mailing list