From 3335e4fa087697878b152bf441fa623771d9cc84 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 31 Mar 2025 12:42:16 -0700 Subject: [PATCH] Reduce /analyze compiler memory consumption. This addresses all of the tests that were consuming 3+ GB for x86 /analyze:only: Test | Before | After | -------------------------------------|--------------:|--------------:| `P0896R4_ranges_alg_copy` | 3,036,147,712 | 657,166,336 | `P0896R4_ranges_alg_transform_unary` | 3,199,823,872 | 695,132,160 | `P2321R2_views_adjacent` | 3,887,595,520 | 1,020,297,216 | `P2321R2_views_adjacent_transform` | 3,404,570,624 | 940,150,784 | `P2441R2_views_join_with` | 3,391,266,816 | 892,010,496 | --- tests/std/tests/P0896R4_ranges_alg_copy/test.cpp | 2 ++ tests/std/tests/P0896R4_ranges_alg_transform_unary/test.cpp | 2 ++ tests/std/tests/P2321R2_views_adjacent/test.cpp | 4 ++++ tests/std/tests/P2321R2_views_adjacent_transform/test.cpp | 4 ++++ tests/std/tests/P2441R2_views_join_with/test.cpp | 2 ++ 5 files changed, 14 insertions(+) diff --git a/tests/std/tests/P0896R4_ranges_alg_copy/test.cpp b/tests/std/tests/P0896R4_ranges_alg_copy/test.cpp index 1258d60a984..6c3222ea1d5 100644 --- a/tests/std/tests/P0896R4_ranges_alg_copy/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_copy/test.cpp @@ -49,6 +49,8 @@ struct instantiator { }; int main() { +#ifndef _PREFAST_ // TRANSITION, GH-1030 static_assert((test_in_write(), true)); +#endif test_in_write(); } diff --git a/tests/std/tests/P0896R4_ranges_alg_transform_unary/test.cpp b/tests/std/tests/P0896R4_ranges_alg_transform_unary/test.cpp index 9ca63672353..18227e9270a 100644 --- a/tests/std/tests/P0896R4_ranges_alg_transform_unary/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_transform_unary/test.cpp @@ -54,6 +54,8 @@ struct instantiator { }; int main() { +#ifndef _PREFAST_ // TRANSITION, GH-1030 static_assert((test_in_write(), true)); +#endif test_in_write(); } diff --git a/tests/std/tests/P2321R2_views_adjacent/test.cpp b/tests/std/tests/P2321R2_views_adjacent/test.cpp index ff27008b641..aec4e02d68a 100644 --- a/tests/std/tests/P2321R2_views_adjacent/test.cpp +++ b/tests/std/tests/P2321R2_views_adjacent/test.cpp @@ -1016,9 +1016,13 @@ int main() { test_one<3>(span{}, span>{}); } +#ifndef _PREFAST_ // TRANSITION, GH-1030 static_assert((instantiation_test(), true)); +#endif instantiation_test(); +#ifndef _PREFAST_ // TRANSITION, GH-1030 static_assert((instantiation_input_only_test(), true)); +#endif instantiation_input_only_test(); } diff --git a/tests/std/tests/P2321R2_views_adjacent_transform/test.cpp b/tests/std/tests/P2321R2_views_adjacent_transform/test.cpp index 26c0e892c5b..4854bb7e655 100644 --- a/tests/std/tests/P2321R2_views_adjacent_transform/test.cpp +++ b/tests/std/tests/P2321R2_views_adjacent_transform/test.cpp @@ -1063,9 +1063,13 @@ int main() { static_assert(CanMemberBase); } +#ifndef _PREFAST_ // TRANSITION, GH-1030 static_assert((instantiation_test(), true)); +#endif instantiation_test(); +#ifndef _PREFAST_ // TRANSITION, GH-1030 static_assert((instantiation_input_only_test(), true)); +#endif instantiation_input_only_test(); } diff --git a/tests/std/tests/P2441R2_views_join_with/test.cpp b/tests/std/tests/P2441R2_views_join_with/test.cpp index cc1d2559778..017c3e12aac 100644 --- a/tests/std/tests/P2441R2_views_join_with/test.cpp +++ b/tests/std/tests/P2441R2_views_join_with/test.cpp @@ -782,7 +782,9 @@ int main() { assert(ranges::empty(filtered_and_joined)); } +#ifndef _PREFAST_ // TRANSITION, GH-1030 static_assert(instantiation_test()); +#endif instantiation_test(); test_valueless_iterator();