[llvm] [clang] [clang-tools-extra] [llvm] Support IFuncs on Darwin platforms (PR #73686)

Ahmed Bougacha via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 16:00:59 PST 2023


================
@@ -144,7 +144,12 @@ bool CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, const CallBase &CB,
   // Try looking through a bitcast from one function type to another.
   // Commonly happens with calls to objc_msgSend().
   const Value *CalleeV = CB.getCalledOperand()->stripPointerCasts();
-  if (const Function *F = dyn_cast<Function>(CalleeV))
+  if (const GlobalIFunc *IF = dyn_cast<GlobalIFunc>(CalleeV);
+      IF && MF.getTarget().getTargetTriple().isOSBinFormatMachO()) {
----------------
ahmedbougacha wrote:

Heh, I did a double-take on the nesting; maybe embrace the dumber `isa<>`/`cast<>`? ;)

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


More information about the cfe-commits mailing list