aboutsummaryrefslogtreecommitdiff
path: root/gcc/brig
diff options
context:
space:
mode:
authorPekka Jääskeläinen <pekka.jaaskelainen@parmance.com>2018-05-04 18:04:14 +0000
committerPekka Jääskeläinen <visit0r@gcc.gnu.org>2018-05-04 18:04:14 +0000
commit1e25c5a9bb7042d7bca5a4fa840666dcb16f4918 (patch)
treefbf023370fafe6762118932e262bf3f7cc6c2821 /gcc/brig
parent60a3d46c17e7cee099043c1564181ab2f3c21d41 (diff)
downloadgcc-1e25c5a9bb7042d7bca5a4fa840666dcb16f4918.zip
gcc-1e25c5a9bb7042d7bca5a4fa840666dcb16f4918.tar.gz
gcc-1e25c5a9bb7042d7bca5a4fa840666dcb16f4918.tar.bz2
[BRIGFE] skip multiple forward declarations of the same function
From-SVN: r259950
Diffstat (limited to 'gcc/brig')
-rw-r--r--gcc/brig/ChangeLog5
-rw-r--r--gcc/brig/brigfrontend/brig-function-handler.cc4
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/brig/ChangeLog b/gcc/brig/ChangeLog
index 7da06bc..7326964 100644
--- a/gcc/brig/ChangeLog
+++ b/gcc/brig/ChangeLog
@@ -1,5 +1,10 @@
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
+ * brig/brigfrontend/brig-function-handler.cc: Skip multiple forward
+ declarations of the same function.
+
+2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
+
* brig/brig-lang.c: Do not allow optimizations based on known C
builtins.
diff --git a/gcc/brig/brigfrontend/brig-function-handler.cc b/gcc/brig/brigfrontend/brig-function-handler.cc
index c524dbe..d64135d 100644
--- a/gcc/brig/brigfrontend/brig-function-handler.cc
+++ b/gcc/brig/brigfrontend/brig-function-handler.cc
@@ -80,6 +80,10 @@ brig_directive_function_handler::operator () (const BrigBase *base)
if (m_parent.m_analyzing)
return bytes_consumed;
+ /* There can be multiple forward declarations of the same function.
+ Skip all but the first one. */
+ if (!is_definition && m_parent.function_decl (func_name) != NULL_TREE)
+ return bytes_consumed;
tree fndecl;
tree ret_value = NULL_TREE;