aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-24 14:29:16 -0800
committerMichael Forney <mforney@mforney.org>2019-02-24 14:29:16 -0800
commit2e803ca5fd925c789b508e1463ea4417f2e1a2f4 (patch)
tree54db554ddd6b190a5fce6bc34779d84b6b314845 /qbe.c
parentb47c6189592aa12cef6daea285fd4c962589a789 (diff)
Make __PRETTY_FUNCTION__ a synonym for __func__
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/qbe.c b/qbe.c
index 3a27b43..68a7d0c 100644
--- a/qbe.c
+++ b/qbe.c
@@ -383,6 +383,11 @@ mkfunc(char *name, struct type *t, struct scope *s)
d = mkdecl(DECLOBJECT, t, LINKNONE);
d->value = mkglobal("__func__", true);
scopeputdecl(s, "__func__", d);
+ /*
+ needed for glibc's assert definition with __GNUC__=4
+ XXX: this should also work at file scope, where it should evaluate to "toplevel"
+ */
+ scopeputdecl(s, "__PRETTY_FUNCTION__", d);
f->namedecl = d;
funclabel(f, mkblock("body"));