I'm attempting to modify a parser generator to emit LLVM code instead of C.
So far the experience has been trivial, but I am now running into an error
regarding labels that I can't seem to solve.
Situation 1: A label is used immediately after a void function call (l6 in
%tmp26 = load i32* @yybegin, align 4
%tmp27 = load i32* @yyend, align 4
call void @yyDo(void (i8*, i32)* @yy_7_body, i32 %tmp26, i32 %tmp27)
br label %l2
I get the following error:
llvm-as: test.ll:578,0: test.ll:578: error: syntax error, unexpected LABELSTR,
expecting LOAD or STORE while reading token: 'l6:'
Why is this label unexpected?
Situation 2: More than 1 label is used to refer to the same location (l11 in
br label %l1
ret i32 1
I get the same error:
llvm-as: test.ll:706,0: test.ll:706: error: syntax error, unexpected LABELSTR,
expecting LOAD or STORE while reading token: 'l11:'
If this code were hand written I'd just use one label here, but the parser
generator automatically creates several labels. When these overlap there are
sometimes multiple labels for the same location in the code. Why is this an
error and is there any way to allow it?
Also, is there a NO-OP instruction in LLVM?
I've attached the complete LLVM code as well.
test.l (22.7 KB)