From 99e8e4a748b8e186901b3185682a6a54d8777543 Mon Sep 17 00:00:00 2001 From: Anna Rift Date: Wed, 11 Dec 2024 09:59:45 -0800 Subject: [PATCH] Comment assumptions about string_view null termination Signed-off-by: Anna Rift --- compiler/include/files.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/include/files.h b/compiler/include/files.h index c40e387637ab..4d9e9e8e0374 100644 --- a/compiler/include/files.h +++ b/compiler/include/files.h @@ -98,6 +98,7 @@ void addLibFile(const char* filename, bool fromCmdLine = false); void addIncInfo(const char* incDir, bool fromCmdLine = false); // Save (append) provided string into the given tmp file. +// Input string is assumed to be null-terminated. // For storing information that needs to be saved between driver phases. void saveDriverTmp(const char* tmpFilePath, std::string_view stringToSave, bool appendNewline = true); @@ -109,6 +110,7 @@ void saveDriverTmpMultiple(const char* tmpFilePath, bool noNewlines = false); // Feed strings from the specified tmp file (one per line) into the given // restoring function, which should copy any it needs to keep. +// Restored string will be null-terminated. // For accessing information saved between driver phases with saveDriverTmp. void restoreDriverTmp(const char* tmpFilePath, std::function restoreSavedString);