From 762a2447c3f57e9a09c014d39fe2869499e0dbd9 Mon Sep 17 00:00:00 2001 From: David Mak Date: Wed, 15 Jan 2025 16:08:55 +0800 Subject: [PATCH] [core] codegen: Remove obsolete comments Comments regarding the need for `llvm.stack{save,restore}` is obsolete now that `NDIter::indices` is allocated at the beginning of the function. --- nac3core/src/codegen/types/ndarray/nditer.rs | 5 ----- nac3core/src/codegen/values/ndarray/nditer.rs | 4 ---- 2 files changed, 9 deletions(-) diff --git a/nac3core/src/codegen/types/ndarray/nditer.rs b/nac3core/src/codegen/types/ndarray/nditer.rs index 1d83742f..45b6bb0a 100644 --- a/nac3core/src/codegen/types/ndarray/nditer.rs +++ b/nac3core/src/codegen/types/ndarray/nditer.rs @@ -163,11 +163,6 @@ impl<'ctx> NDIterType<'ctx> { } /// Allocate an [`NDIter`] that iterates through the given `ndarray`. - /// - /// Note: This function allocates an array on the stack at the current builder location, which - /// may lead to stack explosion if called in a hot loop. Therefore, callers are recommended to - /// call `llvm.stacksave` before calling this function and call `llvm.stackrestore` after the - /// [`NDIter`] is no longer needed. #[must_use] pub fn construct( &self, diff --git a/nac3core/src/codegen/values/ndarray/nditer.rs b/nac3core/src/codegen/values/ndarray/nditer.rs index dd900d64..86f370e5 100644 --- a/nac3core/src/codegen/values/ndarray/nditer.rs +++ b/nac3core/src/codegen/values/ndarray/nditer.rs @@ -137,10 +137,6 @@ impl<'ctx> NDArrayValue<'ctx> { /// /// `body` has access to [`BreakContinueHooks`] to short-circuit and [`NDIterValue`] to /// get properties of the current iteration (e.g., the current element, indices, etc.) - /// - /// Note: The caller is recommended to call `llvm.stacksave` and `llvm.stackrestore` before and - /// after invoking this function respectively. See [`NDIterType::construct`] for an explanation - /// on why this is suggested. pub fn foreach<'a, G, F>( &self, generator: &mut G,