[llvm] r279014 - [LTO] Change addSaveTemps API: do not add dot to the supplied prefix path
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 17 17:12:34 PDT 2016
Author: mehdi_amini
Date: Wed Aug 17 19:12:33 2016
New Revision: 279014
URL: http://llvm.org/viewvc/llvm-project?rev=279014&view=rev
Log:
[LTO] Change addSaveTemps API: do not add dot to the supplied prefix path
Summary:
It does not play well with directories (end up with a bunch of hidden
files).
Also, do not strip the 0 suffix for the first task, especially since
0 can be used by ThinLTO as well now.
Reviewers: tejohnson
Subscribers: mehdi_amini, pcc, llvm-commits
Differential Revision: https://reviews.llvm.org/D23612
Modified:
llvm/trunk/lib/LTO/LTOBackend.cpp
llvm/trunk/test/LTO/Resolution/X86/alias.ll
llvm/trunk/test/LTO/Resolution/X86/comdat.ll
llvm/trunk/test/tools/gold/X86/opt-level.ll
llvm/trunk/tools/gold/gold-plugin.cpp
llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp
Modified: llvm/trunk/lib/LTO/LTOBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOBackend.cpp?rev=279014&r1=279013&r2=279014&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOBackend.cpp (original)
+++ llvm/trunk/lib/LTO/LTOBackend.cpp Wed Aug 17 19:12:33 2016
@@ -40,7 +40,7 @@ Error Config::addSaveTemps(std::string O
std::error_code EC;
ResolutionFile = llvm::make_unique<raw_fd_ostream>(
- OutputFileName + ".resolution.txt", EC, sys::fs::OpenFlags::F_Text);
+ OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::F_Text);
if (EC)
return errorCodeToError(EC);
@@ -58,9 +58,7 @@ Error Config::addSaveTemps(std::string O
// user hasn't requested using the input module's path, emit to a file
// named from the provided OutputFileName with the Task ID appended.
if (M.getModuleIdentifier() == "ld-temp.o" || !UseInputModulePath) {
- PathPrefix = OutputFileName;
- if (Task != 0)
- PathPrefix += "." + utostr(Task);
+ PathPrefix = OutputFileName + utostr(Task);
} else
PathPrefix = M.getModuleIdentifier();
std::string Path = PathPrefix + "." + PathSuffix + ".bc";
@@ -86,7 +84,7 @@ Error Config::addSaveTemps(std::string O
setHook("5.precodegen", PreCodeGenModuleHook);
CombinedIndexHook = [=](const ModuleSummaryIndex &Index) {
- std::string Path = OutputFileName + ".index.bc";
+ std::string Path = OutputFileName + "index.bc";
std::error_code EC;
raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None);
if (EC) {
Modified: llvm/trunk/test/LTO/Resolution/X86/alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/alias.ll?rev=279014&r1=279013&r2=279014&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/alias.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/alias.ll Wed Aug 17 19:12:33 2016
@@ -1,7 +1,7 @@
; RUN: llvm-as %s -o %t1.o
; RUN: llvm-as %p/Inputs/alias-1.ll -o %t2.o
; RUN: llvm-lto2 -o %t3.o %t2.o %t1.o -r %t2.o,a,px -r %t1.o,a, -r %t1.o,b,px -save-temps
-; RUN: llvm-dis < %t3.o.0.preopt.bc -o - | FileCheck %s
+; RUN: llvm-dis < %t3.o.0.0.preopt.bc -o - | FileCheck %s
; RUN: FileCheck --check-prefix=RES %s < %t3.o.resolution.txt
; CHECK-NOT: alias
Modified: llvm/trunk/test/LTO/Resolution/X86/comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/comdat.ll?rev=279014&r1=279013&r2=279014&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/comdat.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/comdat.ll Wed Aug 17 19:12:33 2016
@@ -20,7 +20,7 @@
; RUN: -r=%t2.o,a23,px \
; RUN: -r=%t2.o,a24,px \
; RUN: -r=%t2.o,a25,px
-; RUN: llvm-dis %t3.o.2.internalize.bc -o - | FileCheck %s
+; RUN: llvm-dis %t3.o.0.2.internalize.bc -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Modified: llvm/trunk/test/tools/gold/X86/opt-level.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/opt-level.ll?rev=279014&r1=279013&r2=279014&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/opt-level.ll (original)
+++ llvm/trunk/test/tools/gold/X86/opt-level.ll Wed Aug 17 19:12:33 2016
@@ -1,13 +1,13 @@
; RUN: llvm-as -o %t.bc %s
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
; RUN: -plugin-opt=O0 -r -o %t.o %t.bc
-; RUN: llvm-dis < %t.o.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s
+; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
; RUN: -plugin-opt=O1 -r -o %t.o %t.bc
-; RUN: llvm-dis < %t.o.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s
+; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \
; RUN: -plugin-opt=O2 -r -o %t.o %t.bc
-; RUN: llvm-dis < %t.o.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s
+; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s
; CHECK-O0: define internal void @foo(
; CHECK-O1: define internal void @foo(
Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=279014&r1=279013&r2=279014&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Wed Aug 17 19:12:33 2016
@@ -796,7 +796,8 @@ static std::unique_ptr<LTO> createLTO()
break;
case options::OT_SAVE_TEMPS:
- check(Conf.addSaveTemps(output_name, /* UseInputModulePath */ true));
+ check(Conf.addSaveTemps(output_name + ".",
+ /* UseInputModulePath */ true));
break;
}
Modified: llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp?rev=279014&r1=279013&r2=279014&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp (original)
+++ llvm/trunk/tools/llvm-lto2/llvm-lto2.cpp Wed Aug 17 19:12:33 2016
@@ -132,7 +132,8 @@ int main(int argc, char **argv) {
};
if (SaveTemps)
- check(Conf.addSaveTemps(OutputFilename), "Config::addSaveTemps failed");
+ check(Conf.addSaveTemps(OutputFilename + "."),
+ "Config::addSaveTemps failed");
LTO Lto(std::move(Conf));
More information about the llvm-commits
mailing list