[PATCH] Fix incorrect example for insertvalue instruction in LangRef

Dan Liew dan at su-root.co.uk
Mon Sep 8 02:20:12 PDT 2014


Hi Sean,

This patch fixes a mistake in the insertvalue instruction example.
Trying to assemble this with llvm-as

```
define void @main(float %val)
{
    %agg1 = insertvalue {i32, float} undef, i32 1, 0              ;
yields {i32 1, float undef}
    %agg2 = insertvalue {i32, float} %agg1, float %val, 1         ;
yields {i32 1, float %val}
    %agg3 = insertvalue {i32, {float}} %agg1, float %val, 1, 0    ;
yields {i32 undef, float %val}
    ret void
}
```

gives the following error

```
llvm-as: agg.ll:5:40: error: '%agg1' defined with type '{ i32, float }'
    %agg3 = insertvalue {i32, {float}} %agg1, float %val, 1, 0    ;
yields {i32 undef, float %val}
```

Which isn't surprising because {i32, {float}} and {i32, float} are not
the same type.

Using my modified version assembles without error so I think what I've
done is correct.

Is this okay to commit?

Thanks,
Dan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-type-error-in-insertvalue-example-in-LangRef.-ag.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140908/74f6bea3/attachment.bin>


More information about the llvm-commits mailing list