// Check for errors opening or creating archive file.
if (!ArchiveFile.is_open() || ArchiveFile.bad()) {
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
+ TmpArchive.eraseFromDisk();
if (ErrMsg)
*ErrMsg = "Error opening archive file: " + archPath.str();
return true;
for (MembersList::iterator I = begin(), E = end(); I != E; ++I) {
if (writeMember(*I, ArchiveFile, CreateSymbolTable,
TruncateNames, Compress, ErrMsg)) {
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
+ TmpArchive.eraseFromDisk();
ArchiveFile.close();
return true;
}
std::ofstream FinalFile(FinalFilePath.c_str(), io_mode);
if (!FinalFile.is_open() || FinalFile.bad()) {
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
+ TmpArchive.eraseFromDisk();
if (ErrMsg)
*ErrMsg = "Error opening archive file: " + FinalFilePath.str();
return true;
if (foreignST) {
if (writeMember(*foreignST, FinalFile, false, false, false, ErrMsg)) {
FinalFile.close();
- if (TmpArchive.exists())
- TmpArchive.eraseFromDisk();
+ TmpArchive.eraseFromDisk();
return true;
}
}
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";
}
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>();
}
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);