aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-11-08 19:50:24 +0100
committerEugen Wissner <belka@caraus.de>2026-11-08 19:50:24 +0100
commitafa516a3bae3a2dd4bb4a92cb12f3f6fcdcc8e5c (patch)
tree8cf468bee3e762a270a256dda2ddc53d410fe861 /gcc
parent39db5d5b89dfd2086d73d171487ab9f185a0adf0 (diff)
downloadelna-afa516a3bae3a2dd4bb4a92cb12f3f6fcdcc8e5c.tar.gz
Fix comparison with an exported constant
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc/elna-builtins.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/gcc/elna-builtins.cc b/gcc/gcc/elna-builtins.cc
index 69b8229..a364ce6 100644
--- a/gcc/gcc/elna-builtins.cc
+++ b/gcc/gcc/elna-builtins.cc
@@ -431,6 +431,14 @@ namespace elna::gcc
}
}
+ static void declare_constant(const std::string& name,
+ const boot::constant_info& info, const std::shared_ptr<symbol_table>& symbols)
+ {
+ tree type = get_inner_alias(info.symbol, symbols);
+ tree constant_tree = constant_to_tree(info.value, symbols, type);
+ symbols->enter(name, constant_tree);
+ }
+
void rewrite_symbol_table(const std::shared_ptr<boot::symbol_table>& info_table,
const std::shared_ptr<symbol_table>& symbols, const bool imported)
{
@@ -458,6 +466,10 @@ namespace elna::gcc
{
declare_procedure(symbol_name, *procedure_info, symbols);
}
+ else if (const auto constant_info = symbol_info->is_constant())
+ {
+ declare_constant(symbol_name, *constant_info, symbols);
+ }
}
}
}