[lld] r293138 - ELF: Simplify naming of object files created with save-temps.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 18:18:28 PST 2017


Author: pcc
Date: Wed Jan 25 20:18:28 2017
New Revision: 293138

URL: http://llvm.org/viewvc/llvm-project?rev=293138&view=rev
Log:
ELF: Simplify naming of object files created with save-temps.

Now we never append a number to the file name for task ID 0.

This is similar to r293132 in the gold plugin.

Modified:
    lld/trunk/ELF/LTO.cpp
    lld/trunk/test/ELF/lto/parallel-internalize.ll
    lld/trunk/test/ELF/lto/parallel.ll
    lld/trunk/test/ELF/lto/thinlto.ll

Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=293138&r1=293137&r2=293138&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Wed Jan 25 20:18:28 2017
@@ -147,7 +147,7 @@ std::vector<InputFile *> BitcodeCompiler
     if (Buff[I].empty())
       continue;
     if (Config->SaveTemps) {
-      if (MaxTasks == 1)
+      if (I == 0)
         saveBuffer(Buff[I], Config->OutputFile + ".lto.o");
       else
         saveBuffer(Buff[I], Config->OutputFile + Twine(I) + ".lto.o");

Modified: lld/trunk/test/ELF/lto/parallel-internalize.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/parallel-internalize.ll?rev=293138&r1=293137&r2=293138&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/parallel-internalize.ll (original)
+++ lld/trunk/test/ELF/lto/parallel-internalize.ll Wed Jan 25 20:18:28 2017
@@ -1,9 +1,10 @@
 ; REQUIRES: x86
 ; RUN: llvm-as -o %t.bc %s
+; RUN: rm -f %t.lto.o %t1.lto.o
 ; RUN: ld.lld -m elf_x86_64 --lto-partitions=2 -save-temps -o %t %t.bc \
 ; RUN:   -e foo --lto-O0
 ; RUN: llvm-readobj -t -dyn-symbols %t | FileCheck %s
-; RUN: llvm-nm %t0.lto.o | FileCheck --check-prefix=CHECK0 %s
+; RUN: llvm-nm %t.lto.o | FileCheck --check-prefix=CHECK0 %s
 ; RUN: llvm-nm %t1.lto.o | FileCheck --check-prefix=CHECK1 %s
 
 ; CHECK:      Symbols [

Modified: lld/trunk/test/ELF/lto/parallel.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/parallel.ll?rev=293138&r1=293137&r2=293138&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/parallel.ll (original)
+++ lld/trunk/test/ELF/lto/parallel.ll Wed Jan 25 20:18:28 2017
@@ -1,7 +1,8 @@
 ; REQUIRES: x86
 ; RUN: llvm-as -o %t.bc %s
+; RUN: rm -f %t.lto.o %t1.lto.o
 ; RUN: ld.lld -m elf_x86_64 --lto-partitions=2 -save-temps -o %t %t.bc -shared
-; RUN: llvm-nm %t0.lto.o | FileCheck --check-prefix=CHECK0 %s
+; RUN: llvm-nm %t.lto.o | FileCheck --check-prefix=CHECK0 %s
 ; RUN: llvm-nm %t1.lto.o | FileCheck --check-prefix=CHECK1 %s
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

Modified: lld/trunk/test/ELF/lto/thinlto.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/thinlto.ll?rev=293138&r1=293137&r2=293138&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/thinlto.ll (original)
+++ lld/trunk/test/ELF/lto/thinlto.ll Wed Jan 25 20:18:28 2017
@@ -3,16 +3,18 @@
 ; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
 
 ; First force single-threaded mode
+; RUN: rm -f %t.lto.o %t1.lto.o
 ; RUN: ld.lld -save-temps --thinlto-jobs=1 -shared %t.o %t2.o -o %t
-; RUN: llvm-nm %t0.lto.o | FileCheck %s --check-prefix=NM1-SINGLE
+; RUN: llvm-nm %t.lto.o | FileCheck %s --check-prefix=NM1-SINGLE
 ; RUN: llvm-nm %t1.lto.o | FileCheck %s --check-prefix=NM2-SINGLE
 
 ; NM1-SINGLE: T f
 ; NM2-SINGLE: T g
 
 ; Next force multi-threaded mode
+; RUN: rm -f %t2.lto.o %t21.lto.o
 ; RUN: ld.lld -save-temps --thinlto-jobs=2 -shared %t.o %t2.o -o %t2
-; RUN: llvm-nm %t20.lto.o | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm %t2.lto.o | FileCheck %s --check-prefix=NM1
 ; RUN: llvm-nm %t21.lto.o | FileCheck %s --check-prefix=NM2
 
 ; NM1: T f




More information about the llvm-commits mailing list