File 2671-compiler-Add-to_abstr-flag-to-match-from_abstr.patch of Package erlang
From b26eb1a22ea8b2e9814728c9a5ef48caff0e928e Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Fri, 19 Sep 2025 18:02:16 +0200
Subject: [PATCH] compiler: Add +to_abstr flag to match +from_abstr
Also change extension produced by +to_exp flag to .abstr
(the .E extension should only be for source listings).
---
lib/compiler/src/compile.erl | 5 +++--
lib/compiler/test/compile_SUITE.erl | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 7bfe1f737f..f3fe5adb41 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -1665,7 +1665,8 @@ standard_passes() ->
{iff,'P',{src_listing,"P"}},
{iff,'to_pp',{done,"P"}},
- {iff,'dabstr',{listing,"abstr"}}
+ {iff,'dabstr',{listing,"abstr"}},
+ {iff,'to_abstr',{done,"abstr"}}
| abstr_passes(verified_abstr)].
abstr_passes(AbstrStatus) ->
@@ -1689,7 +1690,7 @@ abstr_passes(AbstrStatus) ->
{iff,'dexp',{listing,"expand"}},
{iff,'E',?pass(legalize_vars)},
{iff,'E',{src_listing,"E"}},
- {iff,'to_exp',{done,"E"}},
+ {iff,'to_exp',{done,"abstr"}},
%% Conversion to Core Erlang.
?pass(core),
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index f9fe1d5b7e..37d4f75252 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -552,7 +552,8 @@ do_file_listings(DataDir, PrivDir, [File|Files]) ->
%% Test options that produce a listing file if 'binary' is not given.
do_listing(Simple, TargetDir, to_pp, ".P"),
- do_listing(Simple, TargetDir, to_exp, ".E"),
+ do_listing(Simple, TargetDir, to_abstr, ".abstr"),
+ do_listing(Simple, TargetDir, to_exp, ".abstr"),
do_listing(Simple, TargetDir, to_core0, ".core"),
ok = file:delete(filename:join(TargetDir, File ++ ".core")),
do_listing(Simple, TargetDir, to_core, ".core"),
--
2.51.0