Merge pull request #81037 from aschwaighofer/irgen_coroFrameAlloc_cleanup

IRGen: Centralize logic that decides whether the platform suppports typed malloc
This commit is contained in:
Arnold Schwaighofer
2025-04-24 13:21:16 -07:00
committed by GitHub
3 changed files with 8 additions and 7 deletions

View File

@@ -3781,10 +3781,15 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
Args.hasFlag(OPT_enable_async_frame_push_pop_metadata,
OPT_disable_async_frame_push_pop_metadata,
Opts.EmitAsyncFramePushPopMetadata);
bool platformSupportsTypedMalloc = !llvm::Triple(Triple).isOSLinux() &&
!llvm::Triple(Triple).isOSWindows();
Opts.EmitTypeMallocForCoroFrame =
Args.hasFlag(OPT_enable_emit_type_malloc_for_coro_frame,
OPT_disable_emit_type_malloc_for_coro_frame,
Opts.EmitTypeMallocForCoroFrame);
(Opts.EmitTypeMallocForCoroFrame && platformSupportsTypedMalloc));
Opts.AsyncFramePointerAll = Args.hasFlag(OPT_enable_async_frame_pointer_all,
OPT_disable_async_frame_pointer_all,
Opts.AsyncFramePointerAll);