Add a flag to omit the xray_fn_idx to cut size overhead and relocations
roughly in half at the cost of reduced performance for single function
patching. Minor additions to compiler-rt support per-function patching
without the index.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Basic/CodeGenOptions.def | ||
---|---|---|
114 | Nit: a variable name with a positive meaning may be easier to understand. | |
clang/test/Driver/XRay/xray-function-index-flags.cpp | ||
6 | If c++11 is not relevant, drop it. | |
20 | I know some tests may be inconsistent but the prevailing style is to place REQUIRES: at the top. | |
compiler-rt/lib/xray/xray_init.cpp | ||
94 | std:: is uncommon. LLVM style is ++I | |
95 | spell out the concrete type if non-obvious. | |
llvm/test/CodeGen/AArch64/xray-omit-function-index.ll | ||
6 | CHECK-COUNT | |
34 | No newline at end of file |
clang/include/clang/Basic/CodeGenOptions.def | ||
---|---|---|
114 | I had the entire patch that way at first, making the index something you would enable (defaulting to true) but it was much worse. | |
clang/test/Driver/XRay/xray-function-index-flags.cpp | ||
20 | I already committed this, but I can do a quick follow up for these nits. |
clang/include/clang/Basic/CodeGenOptions.def | ||
---|---|---|
114 | The variable naming should be easily inferrable from the option name. The option does not say omit. Doesn't XRayFunctionIndex work? How can it be much worse? | |
clang/include/clang/Driver/Options.td | ||
1284 | This should use OptOutFFlag. I fixed it. | |
clang/test/Driver/XRay/xray-function-index-flags.cpp | ||
6 | Already dropped and cleaned a bit. | |
20 | Fixed. |
clang/include/clang/Basic/CodeGenOptions.def | ||
---|---|---|
114 | Sure just changing the variable name is fine of course. I meant it was worse (many tests needing to be changed) when I tried to make the index opt-in not opt-out and just have the Driver set it by default. | |
clang/include/clang/Driver/Options.td | ||
1284 | Thanks for the fixes! |
clang/include/clang/Basic/CodeGenOptions.def | ||
---|---|---|
114 | I mean you can use a variable named XRayFunctionIndex which defaults to true. This is similar to an XRayOmitFunctionIndex which defaults to false. |
clang/include/clang/Basic/CodeGenOptions.def | ||
---|---|---|
114 | Yep, saw your change - works for me. Thanks! |
Nit: a variable name with a positive meaning may be easier to understand.