summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/ExtractFunction.cpp3
-rw-r--r--tools/llvm-link/llvm-link.cpp20
-rw-r--r--tools/lto/LTOCodeGenerator.cpp6
3 files changed, 10 insertions, 19 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index eaa2c538d9..7808de545a 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -365,8 +365,7 @@ Module *BugDriver::ExtractMappedBlocksFromModule(const
PI.push_back(getPI(createBlockExtractorPass(EmptyBBs)));
Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg);
- if (uniqueFilename.exists())
- uniqueFilename.eraseFromDisk(); // Free disk space
+ uniqueFilename.eraseFromDisk(); // Free disk space
if (Ret == 0) {
outs() << "*** Basic Block extraction failed, please report a bug!\n";
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index c60e56ae9b..f7dad3da5f 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -62,20 +62,14 @@ static inline std::auto_ptr<Module> LoadFile(const char *argv0,
}
SMDiagnostic Err;
- if (Filename.exists()) {
- if (Verbose) errs() << "Loading '" << Filename.c_str() << "'\n";
- Module* Result = 0;
-
- const std::string &FNStr = Filename.str();
- Result = ParseIRFile(FNStr, Err, Context);
- if (Result) return std::auto_ptr<Module>(Result); // Load successful!
-
- if (Verbose)
- Err.Print(argv0, errs());
- } else {
- errs() << "Bitcode file: '" << Filename.c_str() << "' does not exist.\n";
- }
+ if (Verbose) errs() << "Loading '" << Filename.c_str() << "'\n";
+ Module* Result = 0;
+
+ const std::string &FNStr = Filename.str();
+ Result = ParseIRFile(FNStr, Err, Context);
+ if (Result) return std::auto_ptr<Module>(Result); // Load successful!
+ Err.Print(argv0, errs());
return std::auto_ptr<Module>();
}
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index c4d7e8abe7..911fddfe18 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -183,16 +183,14 @@ const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
genResult = this->generateAssemblyCode(asmFile, errMsg);
}
if ( genResult ) {
- if ( uniqueAsmPath.exists() )
- uniqueAsmPath.eraseFromDisk();
+ uniqueAsmPath.eraseFromDisk();
return NULL;
}
// make unique temp .o file to put generated object file
sys::PathWithStatus uniqueObjPath("lto-llvm.o");
if ( uniqueObjPath.createTemporaryFileOnDisk(true, &errMsg) ) {
- if ( uniqueAsmPath.exists() )
- uniqueAsmPath.eraseFromDisk();
+ uniqueAsmPath.eraseFromDisk();
return NULL;
}
sys::RemoveFileOnSignal(uniqueObjPath);