Add comment to wl_compiler_add explaining the lifetime requirements for the source files

This commit is contained in:
2025-10-15 20:53:20 +02:00
parent cbfc1e7778
commit 4cff48b9e1
+4
View File
@@ -67,6 +67,10 @@ WL_Compiler *wl_compiler_init(WL_Arena *arena);
// //
// WL_ADD_LINK all sources were processed and // WL_ADD_LINK all sources were processed and
// the unit is ready for linking // the unit is ready for linking
//
// Note that the source of all files needs to
// stay alive until the program is linked as the
// compiler may keep references to it until then.
WL_AddResult wl_compiler_add(WL_Compiler *compiler, WL_String path, WL_String content); WL_AddResult wl_compiler_add(WL_Compiler *compiler, WL_String path, WL_String content);
// Links a compilation unit producing an executable. // Links a compilation unit producing an executable.