[llvm] [CFI/MergeFunctions] Modify MergeFunctions to propagate type information (PR #68628)
Oskar Wirga via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 10 08:59:42 PDT 2023
================
@@ -740,6 +740,10 @@ void MergeFunctions::writeThunk(Function *F, Function *G) {
} else {
NewG->copyAttributesFrom(G);
NewG->takeName(G);
+ // Ensure CFI type metadata is propagated to the new function.
+ if (MDNode *TypeMD = G->getMetadata("type")) {
+ NewG->setMetadata("type", TypeMD);
+ }
----------------
oskarwirga wrote:
I am not familiar with other metadata types, but I don't see why not.
https://github.com/llvm/llvm-project/pull/68628
More information about the llvm-commits
mailing list