Skip to content

Commit

Permalink
Comment assumptions about string_view null termination
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <anna.rift@hpe.com>
  • Loading branch information
riftEmber committed Jan 7, 2025
1 parent 8cc22da commit 99e8e4a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/include/files.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<void(std::string_view)> restoreSavedString);
Expand Down

0 comments on commit 99e8e4a

Please sign in to comment.