Details
-
Type:
Bug
-
Status: Open
-
Priority:
Medium
-
Resolution: Unresolved
-
Component/s: Compiler
-
Labels:
-
Radar URL:
Description
const char * ToolChain::JobContext::getTemporaryFilePath(const llvm::Twine &name, StringRef suffix) const { SmallString<128> buffer; std::error_code EC = llvm::sys::fs::createTemporaryFile(name, suffix, buffer); if (EC) { // FIXME: This should not take down the entire process. llvm::report_fatal_error("unable to create temporary file for filelist"); } C.addTemporaryFile(buffer.str(), PreserveOnSignal::Yes); // We can't just reference the data in the TemporaryFiles vector because // that could theoretically get copied to a new address. return C.getArgs().MakeArgString(buffer.str()); }
This is obviously not optimal. The immediate action is to return an llvm::Expected<const char *> instead, to represent the failure, but all of the callers are constructing command-lines for the jobs to run for this compilation. That's not currently something that can fail.