X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2Fllvm.grm;h=d65f075076cf8ef8eb4c064a8cece328c5d40acf;hb=ac226bbf457f6b5e5210a4a82b1ce678298b2d89;hp=e70533a0cd9c229e7707fc61efcaa16b4c351d4d;hpb=923a579b55b5af1a4d131d9871a3645f01cb33a6;p=oota-llvm.git diff --git a/utils/llvm.grm b/utils/llvm.grm index e70533a0cd9..d65f075076c 100644 --- a/utils/llvm.grm +++ b/utils/llvm.grm @@ -8,6 +8,8 @@ It is strictly syntax-based, and makes no attempt to generate IR that is semantically valid. Most of the IR produced doesn't pass the Verifier. +TODO: Metadata, in all its forms + *) I ::= "title: LLVM assembly language\n" @@ -53,8 +55,8 @@ FPVAL ::= ESAPINTVAL ^ "." ^ EUAPINTVAL | "0x" ^ HexDigitSeq ; The rest of this file is derived directly from llvmAsmParser.y. *) -ArithmeticOps ::= add | fadd | sub | fsub | mul | fmul | - udiv | sdiv | fdiv | urem | srem | frem ; +ArithmeticOps ::= + OptNW add | fadd | OptNW sub | fsub | OptNW mul | fmul | + udiv | OptExact sdiv | fdiv | urem | srem | frem ; LogicalOps ::= shl | lshr | ashr | and | or | xor; CastOps ::= trunc | zext | sext | fptrunc | fpext | bitcast | uitofp | sitofp | fptoui | fptosi | inttoptr | ptrtoint ; @@ -90,6 +92,8 @@ GVInternalLinkage | dllexport | common | private + | "linker_private" + | "linker_private_weak" ; GVExternalLinkage @@ -161,11 +165,18 @@ FuncAttr ::= noreturn | signext | readnone | readonly + | inlinehint + | alignstack | noinline | alwaysinline | optsize | ssp | sspreq + | returns_twice + | nonlazybind + | sanitize_address + | sanitize_thread + | sanitize_memory ; OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ; @@ -233,7 +244,7 @@ ConstVal::= Types "[" ^ ConstVector ^ "]" | Types FPVAL ; ConstExpr::= CastOps "(" ^ ConstVal to Types ^ ")" - | getelementptr "(" ^ ConstVal IndexList ^ ")" + | getelementptr OptInBounds "(" ^ ConstVal IndexList ^ ")" | select "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")" | ArithmeticOps "(" ^ ConstVal ^ "," ConstVal ^ ")" | LogicalOps "(" ^ ConstVal ^ "," ConstVal ^ ")" @@ -393,6 +404,11 @@ InstVal ::= | MemoryInst ; OptVolatile ::= - volatile | _ ; +OptExact ::= - exact | _ ; +OptNSW ::= - nsw | _ ; +OptNUW ::= - nuw | _ ; +OptNW ::= OptNUW OptNSW | OptNSW OptNUW ; +OptInBounds ::= - inbounds | _ ; MemoryInst ::= malloc Types OptCAlign | malloc Types ^ "," INTTYPE ValueRef OptCAlign @@ -402,6 +418,6 @@ MemoryInst ::= malloc Types OptCAlign | OptVolatile load Types ValueRef OptCAlign | OptVolatile store ResolvedVal ^ "," Types ValueRef OptCAlign | getresult Types ValueRef ^ "," EUINT64VAL - | getelementptr Types ValueRef IndexList + | getelementptr OptInBounds Types ValueRef IndexList | extractvalue Types ValueRef ^ ConstantIndexList | insertvalue Types ValueRef ^ "," Types ValueRef ^ ConstantIndexList ;