~mpu/qbe

2

Could duplicate parameter names be (un)documented?

Details
Message ID
<d7aaf8e2-0e6a-4045-a01c-e75a49392f50@yyny.dev>
DKIM signature
pass
Download raw message
Patch: +1 -1
Hi - I am working on a QBE parser/serializer implementation.

While testing, I ran into an incompatibility with QBE.
QBE accepts duplicate parameter names, but my implementation does not.
This is because it stores parameter types in a hash map.
Examples:

```qbe
function $x(l %a, d %a) { ... } # different class, same size
function $x(l %a, w %a) { ... } # same class, different size
function $x(l %a, :one %a) { ... } # same class, same size
function $x(l %a, l %a) { ... } # same type
```

My implementation complains as soon as it finds a duplicate,
but QBE only complains when the temporary is used
and the types are incompatible.

Could the behavior of duplicate parameter names be documented?
I would obviously prefer it if duplicate parameters were simply
disallowed like so:

diff --git a/doc/il.txt b/doc/il.txt
index 2d488dc..c7340f1 100644
--- a/doc/il.txt
+++ b/doc/il.txt
@@ -439,7 +439,7 @@ return type of the function.  All return values of this
 function must have this return type.  If the return
 type is missing, the function must not return any value.

The parameter list is a comma separated list of
The parameter list is a comma separated list of unique
 temporary names prefixed by types.  The types are used
 to correctly implement C compatibility.  When an argument
 has an aggregate type, a pointer to the aggregate is passed
Details
Message ID
<ec9d1c9a-e7cf-4204-83d2-d5c2533d5eac@app.fastmail.com>
In-Reply-To
<d7aaf8e2-0e6a-4045-a01c-e75a49392f50@yyny.dev> (view parent)
DKIM signature
pass
Download raw message
On Sun, Apr 21, 2024, at 14:29, Jonne Ransijn wrote:
> Could the behavior of duplicate parameter names be documented?
> I would obviously prefer it if duplicate parameters were simply
> disallowed like so:

That sounds reasonable, I'll update the doc as you suggest.
Details
Message ID
<d9f7db98-ad86-45dc-bb1e-53c3a09b32e4@app.fastmail.com>
In-Reply-To
<ec9d1c9a-e7cf-4204-83d2-d5c2533d5eac@app.fastmail.com> (view parent)
DKIM signature
pass
Download raw message
On Sun, Apr 21, 2024, at 21:04, Quentin Carbonneaux wrote:
> That sounds reasonable, I'll update the doc as you suggest.

Now done on master (582534aa).
Reply to thread Export thread (mbox)