llvm.org GIT mirror llvm / 9f5d48b
Do error checking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30842 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 13 years ago
1 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
343343
344344 std::string ErrMsg;
345345 sys::Path TempDir = sys::Path::GetTemporaryDirectory(&ErrMsg);
346 if (TempDir.isEmpty()) {
347 std::cerr << "lto: " << ErrMsg << "\n";
348 return LTO_WRITE_FAILURE;
349 }
346350 sys::Path tmpAsmFilePath(TempDir);
347351 if (!tmpAsmFilePath.appendComponent("lto")) {
348352 std::cerr << "lto: " << ErrMsg << "\n";
398402 args.push_back(tmpAsmFilePath.c_str());
399403 args.push_back(0);
400404
401 sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 1);
405 if (sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 1, &ErrMsg)) {
406 std::cerr << "lto: " << ErrMsg << "\n";
407 return LTO_ASM_FAILURE;
408 }
402409
403410 tmpAsmFilePath.eraseFromDisk();
404411 TempDir.eraseFromDisk(true);