[llvm] Jump table annotations for Linux (PR #112606)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 14:12:16 PDT 2024


================
@@ -162,6 +162,10 @@ static cl::opt<bool> EmitJumpTableSizesSection(
     cl::desc("Emit a section containing jump table addresses and sizes"),
     cl::Hidden, cl::init(false));
 
+static cl::opt<bool> AnnotateJumpTables("annotate-jump-tables",
+                                        cl::desc("Annotate jump tables"),
+                                        cl::Hidden, cl::init(false));
----------------
nickdesaulniers wrote:

`cl::opt` is not great because it usually means that the command line flag that would trigger this needs to also be passed to the linker when performing LTO.  Instead, I think a better approach (though it's more code in LLVM) is to have a module level metadata to signal this codegen behavior, and have the front end emit that when the command line flag is set.

https://github.com/llvm/llvm-project/pull/112606


More information about the llvm-commits mailing list