From c23a29ff7b7f3bd2ca603e07a7973159fa4dae23 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Mon, 5 Aug 2024 15:18:59 -0400 Subject: [PATCH] Update clambcc/clambc-compiler.py --- clambcc/clambc-compiler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clambcc/clambc-compiler.py b/clambcc/clambc-compiler.py index a21afcbc22..adeeef7c05 100755 --- a/clambcc/clambc-compiler.py +++ b/clambcc/clambc-compiler.py @@ -652,7 +652,12 @@ def createInputSourceFile(clangLLVM: ClangLLVM, name: str, args: list, options: 'clambc-lcompiler', 'verify', - # TODO: What does this do? + # This pass loops over all of the functions in the input module, looking for a main function. + # If a main function is found, all other functions and all global variables with initializers are marked as internal. + # + # We maintain a list of public API functions to NOT internalize. See `INTERNALIZE_API_LIST`, above. + # + # See: https://llvm.org/docs/Passes.html#internalize-internalize-global-symbols 'internalize', 'verify',