From 4167bd1b44527a17de240ac476b467fdfb4cdedc Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Wed, 3 Dec 2025 00:20:54 +0000 Subject: [PATCH] [llvm-link] Add more detail to `--internalize` description While the functionality of this flag is obvious in the implementation, tool users may not know what it does with the short description provided. Notably, it is not obvious from the short description that: * Functions provided will be converted to internal linkage (and thus discarded if unused) even if unreferenced. * Functions in the first file will not be internalized, even if referenced by a later one. --- llvm/tools/llvm-link/llvm-link.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp index 33c3e6fc350fb..fbc6c31f75c62 100644 --- a/llvm/tools/llvm-link/llvm-link.cpp +++ b/llvm/tools/llvm-link/llvm-link.cpp @@ -75,9 +75,12 @@ static cl::opt OutputFilename("o", cl::desc("Override output filename"), cl::init("-"), cl::value_desc("filename"), cl::cat(LinkCategory)); -static cl::opt Internalize("internalize", - cl::desc("Internalize linked symbols"), - cl::cat(LinkCategory)); +static cl::opt + Internalize("internalize", + cl::desc("Internalize linked symbols - maintains existing " + "linkage for the first input and converts linkage in" + " all other inputs to `internal`"), + cl::cat(LinkCategory)); static cl::opt DisableDITypeMap("disable-debug-info-type-map",