LangRef description of 'add nsw' doesn't match reality

The langref says for the 'add' instruction:

Syntax:

  <result> = add <ty> <op1>, <op2> ; yields {ty}:result
  <result> = nuw add <ty> <op1>, <op2> ; yields {ty}:result
  <result> = nsw add <ty> <op1>, <op2> ; yields {ty}:result
  <result> = nuw nsw add <ty> <op1>, <op2> ; yields {ty}:result

But llvm-as does not accept that sequence, only ... = add nsw ... (which
is also what llvm-gcc generates). E.g.

16:29|melis@juggle2:~> cat add.ll | grep nsw
  %2 = nsw add i32 %1, 1 ; <i32> [#uses=1]
16:29|melis@juggle2:~> llvm-as add.ll
llvm-as: add.ll:14:8: error: expected instruction opcode
  %2 = nsw add i32 %1, 1 ; <i32> [#uses=1]
       ^
16:29|melis@juggle2:~> cat add2.ll | grep nsw
  %2 = add nsw i32 %1, 1 ; <i32> [#uses=1]
16:29|melis@juggle2:~> llvm-as add2.ll
16:29|melis@juggle2:~>

It seems the other variants of add (and sub) described also should list
the opcode first, followed by the wrap flag.

Paul

Thanks for spotting this; I just committed a documentation fix for this.

Thanks,

Dan