[PATCH] D116511: [clang-cl] Support the /HOTPATCH flag
Alexandre Ganea via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 11 19:04:16 PST 2022
aganea added inline comments.
================
Comment at: clang/include/clang/Driver/Options.td:2493
MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryCount">>;
+def fhotpatch : Flag<["-"], "fhotpatch">, Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Ensure that all functions can be hotpatched at runtime">,
----------------
hans wrote:
> Is this flag also exposed as a driver flag, or is it cc1 only?
>
> I wonder if we should go for a less generic name here, perhaps -fms-hotpatch? For example, the flag above is also about hotpatching, but a different mechanism.
Added `CoreOption`. Changed to `-fms-hotpatch`.
================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:648
Options.ObjectFilenameForDebug = CodeGenOpts.ObjectFilenameForDebug;
+ Options.Hotpatch = CodeGenOpts.HotPatch;
----------------
hans wrote:
> Since it's currently only supported on x86_64, we should probably diagnose trying to use it for other target somewhere.
Actually the whole thing works on ARM/ARM64, it just that these targets don't need the PATCHABLE_OP thing (since they always generate 16-bit/32-bit instructions).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116511/new/
https://reviews.llvm.org/D116511
More information about the cfe-commits
mailing list