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
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.
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).