[llvm] [CFI][annotation] Leave alone function pointers in function annotations (PR #80173)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 01:21:54 PST 2024


================
@@ -1392,6 +1402,10 @@ void LowerTypeTestsModule::replaceWeakDeclarationWithJumpTablePtr(
   // Don't use range based loop, because use list will be modified.
   while (!PlaceholderFn->use_empty()) {
     Use &U = *PlaceholderFn->use_begin();
+    if (isFunctionAnnotation(U.getUser())) {
+      U.set(F);
+      continue;
+    }
----------------
nikic wrote:

Is this check actually needed? If I'm reading the code right, your check inside replaceCfiUses() will already prevent the replacement of F with PlaceholderFn in the annotation, no?

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


More information about the llvm-commits mailing list