Write temporary file names if debugging is enabled.

llvm-svn: 195062
This commit is contained in:
Rui Ueyama 2013-11-19 00:11:28 +00:00
parent db3d8554be
commit 265134c731
2 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include "lld/ReaderWriter/Simple.h"
#include "lld/ReaderWriter/Writer.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Path.h"
using namespace lld;
@ -27,6 +28,9 @@ void RoundTripNativePass::perform(std::unique_ptr<MutableFile> &mergedFile) {
StringRef outFile = llvm::sys::path::filename(_context.outputPath());
if (llvm::sys::fs::createTemporaryFile(outFile, "native", tmpNativeFile))
return;
DEBUG_WITH_TYPE("RoundTripNativePass", {
llvm::dbgs() << "RoundTripNativePass: " << tmpNativeFile << "\n";
});
// The file that is written would be kept around if there is a problem
// writing to the file or when reading atoms back from the file.

View File

@ -13,6 +13,7 @@
#include "lld/ReaderWriter/Simple.h"
#include "lld/ReaderWriter/Writer.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Path.h"
// Skip YAML files larger than this to avoid OOM error. The YAML reader consumes
@ -31,6 +32,9 @@ void RoundTripYAMLPass::perform(std::unique_ptr<MutableFile> &mergedFile) {
StringRef outFile = llvm::sys::path::filename(_context.outputPath());
if (llvm::sys::fs::createTemporaryFile(outFile, "yaml", tmpYAMLFile))
return;
DEBUG_WITH_TYPE("RoundTripYAMLPass", {
llvm::dbgs() << "RoundTripYAMLPass: " << tmpYAMLFile << "\n";
});
// The file that is written would be kept around if there is a problem
// writing to the file or when reading atoms back from the file.