aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-02-29 14:04:29 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-02-29 14:04:29 +0100
commit4e51e84d86629fa57ad8ac9849c4d582f442bb94 (patch)
tree774826077f4a2499ec33c92f6fdcf44865683bb9 /gcc
parent75424e6ccb57f69987a329e8df68f751af4bcc25 (diff)
parent705de6d54ca95b8277a15fe9a2255af6168ae086 (diff)
downloadgcc-4e51e84d86629fa57ad8ac9849c4d582f442bb94.zip
gcc-4e51e84d86629fa57ad8ac9849c4d582f442bb94.tar.gz
gcc-4e51e84d86629fa57ad8ac9849c4d582f442bb94.tar.bz2
Merge commit '705de6d54ca95b8277a15fe9a2255af6168ae086' into HEAD [#2123]
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/backend/rust-compile-base.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc
index 984492f..4d6f027 100644
--- a/gcc/rust/backend/rust-compile-base.cc
+++ b/gcc/rust/backend/rust-compile-base.cc
@@ -657,6 +657,12 @@ HIRCompileBase::compile_function (
// we don't mangle the main fn since we haven't implemented the main shim
bool is_main_fn = fn_name.compare ("main") == 0;
+ if (is_main_fn)
+ {
+ rust_assert (!main_identifier_node);
+ /* So that 'MAIN_NAME_P' works. */
+ main_identifier_node = get_identifier (ir_symbol_name.c_str ());
+ }
std::string asm_name = fn_name;
unsigned int flags = 0;