mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Convert a use of sys::Path::GetTemporaryDirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183987 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -66,18 +66,17 @@ StringRef llvm::DOT::getColorString(unsigned ColorNumber) {
|
||||
return Colors[ColorNumber % NumColors];
|
||||
}
|
||||
|
||||
std::string llvm::createGraphFilename(const Twine &Name) {
|
||||
std::string ErrMsg;
|
||||
sys::Path Filename = sys::Path::GetTemporaryDirectory(&ErrMsg);
|
||||
if (Filename.isEmpty()) {
|
||||
errs() << "Error: " << ErrMsg << "\n";
|
||||
return "";
|
||||
}
|
||||
Filename.appendComponent((Name + ".dot").str());
|
||||
if (Filename.makeUnique(true,&ErrMsg)) {
|
||||
errs() << "Error: " << ErrMsg << "\n";
|
||||
std::string llvm::createGraphFilename(const Twine &Name, int &FD) {
|
||||
FD = -1;
|
||||
SmallString<128> Filename;
|
||||
error_code EC = sys::fs::unique_file(Twine(Name) + "-%%%%%%%.dot",
|
||||
FD, Filename);
|
||||
if (EC) {
|
||||
errs() << "Error: " << EC.message() << "\n";
|
||||
return "";
|
||||
}
|
||||
|
||||
errs() << "Writing '" << Filename << "'... ";
|
||||
return Filename.str();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user