[lld] 70c0dbf - [lld-macho][NFC] Replace config param with a global in hasCompatVersion() helper.
    Vy Nguyen via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Mar  6 08:33:12 PST 2021
    
    
  
Author: Vy Nguyen
Date: 2021-03-06T11:32:51-05:00
New Revision: 70c0dbf151ab5240f78a160a3675e4f5b98aa403
URL: https://github.com/llvm/llvm-project/commit/70c0dbf151ab5240f78a160a3675e4f5b98aa403
DIFF: https://github.com/llvm/llvm-project/commit/70c0dbf151ab5240f78a160a3675e4f5b98aa403.diff
LOG: [lld-macho][NFC] Replace config param with a global in hasCompatVersion() helper.
Differential Revision: https://reviews.llvm.org/D98115
Added: 
    
Modified: 
    lld/MachO/InputFiles.cpp
Removed: 
    
################################################################################
diff  --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index 2d7932352618..ae9a4e89db8f 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -339,10 +339,9 @@ static macho::Symbol *createDefined(const structs::nlist_64 &sym,
 }
 
 // Checks if the version specified in `cmd` is compatible with target
-// version in `config`. IOW, check if cmd's version >= config's version.
+// version. IOW, check if cmd's version >= config's version.
 static bool hasCompatVersion(const InputFile *input,
-                             const build_version_command *cmd,
-                             const Configuration *config) {
+                             const build_version_command *cmd) {
 
   if (config->target.Platform != static_cast<PlatformKind>(cmd->platform)) {
     error(toString(input) + " has platform " +
@@ -512,7 +511,7 @@ ObjFile::ObjFile(MemoryBufferRef mb, uint32_t modTime, StringRef archiveName)
 
   if (const auto *cmd =
           findCommand<build_version_command>(hdr, LC_BUILD_VERSION)) {
-    if (!hasCompatVersion(this, cmd, config))
+    if (!hasCompatVersion(this, cmd))
       return;
   }
 
@@ -673,7 +672,7 @@ DylibFile::DylibFile(MemoryBufferRef mb, DylibFile *umbrella,
 
   if (const build_version_command *cmd =
           findCommand<build_version_command>(hdr, LC_BUILD_VERSION)) {
-    if (!hasCompatVersion(this, cmd, config))
+    if (!hasCompatVersion(this, cmd))
       return;
   }
 
        
    
    
More information about the llvm-commits
mailing list