From c5e81a1cf86f9512aa8c22928e66f20489eb453b Mon Sep 17 00:00:00 2001 From: Anna Rift Date: Fri, 22 Nov 2024 10:30:13 -0800 Subject: [PATCH] Avoid recomputing tmp path Signed-off-by: Anna Rift --- compiler/util/files.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/util/files.cpp b/compiler/util/files.cpp index 8a29dee561a3..a4695f1d8061 100644 --- a/compiler/util/files.cpp +++ b/compiler/util/files.cpp @@ -208,9 +208,10 @@ void restoreDriverTmp(const char* tmpFilePath, // Create file iff it did not already exist, for simpler reading logic in the // rest of the function. fileinfo* tmpFileDummy = openTmpFile(tmpFilePath, "a"); + const char* path = tmpFileDummy->pathname; closefile(tmpFileDummy); - std::ifstream fileStream(genIntermediateFilename(tmpFilePath)); + std::ifstream fileStream(path); std::string line; while (std::getline(fileStream, line)) { restoreSavedString(line.c_str());