Lines Matching defs:Thunk
40 static void setThunkProperties(CodeGenModule &CGM, const ThunkInfo &Thunk,
45 !Thunk.Return.isEmpty());
71 const ThunkInfo &Thunk) {
95 Thunk.Return);
153 // no-op thunk for the regular definition) call va_start/va_end.
159 GlobalDecl GD, const ThunkInfo &Thunk) {
174 CGM.ErrorUnsupported(MD, "return-adjusting thunk with variadic arguments");
179 // Clone to thunk.
213 CGM.getCXXABI().performThisAdjustment(*this, ThisPtr, Thunk.This);
218 if (!Thunk.Return.isEmpty()) {
226 RV = PerformReturnAdjustment(*this, ResultType, RV, Thunk);
293 const ThunkInfo *Thunk,
296 "Please use a new CGF for this thunk");
301 Thunk ? CGM.getCXXABI().performThisAdjustment(
302 *this, LoadCXXThisAddress(), Thunk->This)
306 // inalloca, or an unprototyped thunk, use musttail. Emit an error if this
307 // thunk requires a return adjustment, since that is impossible with musttail.
309 if (Thunk && !Thunk->Return.isEmpty()) {
312 MD, "return-adjusting thunk with incomplete parameter type");
318 MD, "non-trivial argument copy for return-adjusting thunk");
377 if (Thunk && !Thunk->Return.isEmpty())
378 RV = PerformReturnAdjustment(*this, ResultType, RV, *Thunk);
395 // Emitting a musttail call thunk doesn't use any of the CGCall.cpp machinery
449 const ThunkInfo &Thunk,
471 &Thunk, IsUnprototyped);
483 // is purely an optimization. Emit the thunk if optimizations are enabled and
508 llvm::Constant *Thunk = CGM.GetAddrOfThunk(Name, ThunkVTableTy, GD);
514 return Thunk;
517 // cases in the MS ABI, we may need to build an unprototyped musttail thunk.
525 llvm::Function *ThunkFn = cast<llvm::Function>(Thunk->stripPointerCasts());
531 // Remove the name from the old thunk function and get a new thunk.
537 // If needed, replace the old thunk with a bitcast.
544 // Remove the old thunk.
553 // There is already a thunk emitted for this function, do nothing.
561 // If this will be unprototyped, add the "thunk" attribute so that LLVM knows
566 ThunkFn->addFnAttr("thunk");
597 // Normal thunk body generation.
619 for (const ThunkInfo& Thunk : *ThunkInfoVector)
620 maybeEmitThunk(GD, Thunk, /*ForVTable=*/false);