[PATCH 1/3] Add missing case statements to LLParser for improved error messages

Stephen Lin swlin at post.harvard.edu
Thu Apr 18 06:29:30 PDT 2013


Seems like someone else had the same idea I did. I've updated the
patch to reflect the latest changes to trunk.

The 'sspstrong' and 'noduplicate' issues seem to be fixed already;
I've standardized the code organization to avoid splitting the set of
function attributes into two columns, since that's what is done now in
trunk in one function (but not another) and moved 'align' to the
correct category again.

Stephen

On Mon, Apr 8, 2013 at 2:24 PM, Stephen Lin <swlin at post.harvard.edu> wrote:
> Hi,
>
> I noticed a couple of missing case statements in
> "lib/AsmParser/LLParser.cpp" for checking parameter attributes; also,
> an error case was in the wrong category for checking return attribute.
>
> This seemed partly due to the fact that cases were organized into two
> columns, but sorted alphabetically in column-major order, which is
> difficult to modify. I've reorganized the case statements into
> row-major order, to make this easier to maintain in the future.
>
> Affected cases tare the following:
> --------
> * Using sspstrong as a parameter attribute:
>   code:
>     define i32 @f(i32 sspstrong %g) {
>      ret i32 0
>     }
>   error before:
>     1:19: error: expected ')' at end of argument list
>   error after:
>     1:19: error: invalid use of function-only attribute
>
> * Using noduplicate as a parameter attribute:
>   code:
>     define i32 @f(i32 noduplicate %g) {
>      ret i32 0
>     }
>   error before:
>     1:19: error: expected ')' at end of argument list
>   error after:
>     1:19: error: invalid use of function-only attribute
>
> * Using align as a parameter attribute:
>   code:
>     define align 4 i32 @f(i32 %g) {
>      ret i32 0
>     }
>   error before:
>     1:8: error: invalid use of function-only attribute
>   error after:
>     1:8: error: invalid use of parameter-only attribute
> --------
>
> I don't have commit access so if anyone could review and commit on my
> behalf, I would appreciate it.
>
> Thanks,
> Stephen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llparser-fixup.patch
Type: application/octet-stream
Size: 2568 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130418/995056e0/attachment.obj>


More information about the llvm-commits mailing list