From ded6b1d654075237b49d4186c03eed2f1ecc8073 Mon Sep 17 00:00:00 2001 From: Rohan Jacob-Rao Date: Mon, 10 Aug 2015 10:54:37 -0700 Subject: [PATCH] Fix parsing of boolean constants --- infer/src/llvm/lLexer.mll | 1 - infer/src/llvm/lParser.mly | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/infer/src/llvm/lLexer.mll b/infer/src/llvm/lLexer.mll index 4213b65a1..6aeacefba 100644 --- a/infer/src/llvm/lLexer.mll +++ b/infer/src/llvm/lLexer.mll @@ -60,7 +60,6 @@ rule token = parse (* TYPES *) | "void" { VOID } - | "i1" { BIT (* INT 1 *) } | 'i' (pos_int as width) { INT (int_of_string width) } | "half" { HALF } | "float" { FLOAT } diff --git a/infer/src/llvm/lParser.mly b/infer/src/llvm/lParser.mly index eea33c03b..024f83316 100644 --- a/infer/src/llvm/lParser.mly +++ b/infer/src/llvm/lParser.mly @@ -33,7 +33,6 @@ (* TYPES *) %token VOID -%token BIT (* i1 *) %token INT %token HALF %token FLOAT @@ -241,7 +240,7 @@ instr: | RET tp = typ op = operand { Ret (Some (tp, op)) } | RET VOID { Ret None } | BR LABEL lbl = variable { UncondBranch lbl } - | BR BIT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) } + | BR i=INT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) } (* Memory access operations *) | var = variable EQUALS ALLOCA tp = typ align? { Alloc (var, tp, 1) } | var = variable EQUALS LOAD tp = ptr_typ ptr = variable align? { Load (var, tp, ptr) }