The rest of this file is derived directly from llvmAsmParser.y.
*)
-ArithmeticOps ::= add | sub | mul | 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 ;
LocalName ::= LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT ;
OptLocalName ::= LocalName | _ ;
-OptAddrSpace ::= - addrspace "(" ^ EUINT64VAL ^ ")" | _ ;
+OptAddrSpace ::= - addrspace ^ "(" ^ EUINT64VAL ^ ")" | _ ;
OptLocalAssign ::= LocalName "=" | _ ;
GVInternalLinkage
::= + internal
| weak
+ | "weak_odr"
| linkonce
+ | "linkonce_odr"
| appending
| dllexport
| common
+ | private
;
GVExternalLinkage
::= + _
| internal
| linkonce
+ | "linkonce_odr"
| weak
+ | "weak_odr"
| dllexport
;
-AliasLinkage ::= + _ | weak | internal ;
+AliasLinkage ::= + _ | weak | "weak_odr" | internal ;
OptCallingConv ::= + _ |
ccc |
cc EUINT64VAL ;
ParamAttr ::= zeroext
- | zext
| signext
- | sext
| inreg
| sret
| noalias
+ | nocapture
| byval
| nest
| align EUINT64VAL
OptParamAttrs ::= + _ | OptParamAttrs ParamAttr ;
+RetAttr ::= inreg
+ | zeroext
+ | signext
+ | noalias
+ ;
+
+OptRetAttrs ::= _
+ | OptRetAttrs RetAttr
+ ;
+
FuncAttr ::= noreturn
| nounwind
+ | inreg
| zeroext
| signext
| readnone
| readonly
+ | inlinehint
+ | alignstack
+ | noinline
+ | alwaysinline
+ | optsize
+ | ssp
+ | sspreq
;
OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ;
| "[" ^ EUINT64VAL "x" Types ^ "]"
| "<" ^ EUINT64VAL "x" Types ^ ">"
| "{" TypeListI "}"
- | "{" "}"
+ | "{" ^ "}"
| "<" ^ "{" TypeListI "}" ^ ">"
- | "<" ^ "{" "}" ^ ">"
+ | "<" ^ "{" ^ "}" ^ ">"
;
ArgType ::= Types OptParamAttrs ;
TypeListI ::= Types | TypeListI ^ "," Types ;
ConstVal::= Types "[" ^ ConstVector ^ "]"
- | Types "[" "]"
+ | Types "[" ^ "]"
| Types "c" ^ STRINGCONSTANT
| Types "<" ^ ConstVector ^ ">"
| Types "{" ConstVector "}"
- | Types "{" "}"
+ | Types "{" ^ "}"
| Types "<" ^ "{" ConstVector "}" ^ ">"
- | Types "<" ^ "{" "}" ^ ">"
+ | Types "<" ^ "{" ^ "}" ^ ">"
| Types null
| Types undef
| Types SymbolicValueRef
| Types ConstExpr
| Types zeroinitializer
- | IntType ESINT64VAL
- | IntType ESAPINTVAL
- | IntType EUINT64VAL
- | IntType EUAPINTVAL
- | INTTYPE true
- | INTTYPE false
- | FPType FPVAL ;
+ | Types ESINT64VAL
+ | Types ESAPINTVAL
+ | Types EUINT64VAL
+ | Types EUAPINTVAL
+ | Types true
+ | Types false
+ | Types FPVAL ;
ConstExpr::= CastOps "(" ^ ConstVal to Types ^ ")"
- | getelementptr "(" ^ ConstVal IndexList ^ ")"
+ | getelementptr OptInBounds "(" ^ ConstVal IndexList ^ ")"
| select "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
| ArithmeticOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
| LogicalOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
| icmp IPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
| fcmp FPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
- | vicmp IPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
- | vfcmp FPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
| extractelement "(" ^ ConstVal ^ "," ConstVal ^ ")"
| insertelement "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
- | shufflevector "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")" ;
+ | shufflevector "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
+ | extractvalue "(" ^ ConstVal ^ ConstantIndexList ^ ")"
+ | insertvalue "(" ^ ConstVal ^ "," ConstVal ^ ConstantIndexList ^ ")" ;
ConstVector ::= ConstVector ^ "," ConstVal | ConstVal ;
| declare FunctionProto
| - module asm AsmBlock
| OptLocalAssign type Types
- | OptLocalAssign type void
- | OptGlobalAssign GVVisibilityStyle ThreadLocal GlobalType ConstVal
- OptAddrSpace GlobalVarAttributes
- | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal GlobalType
- ConstVal OptAddrSpace GlobalVarAttributes
- | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal GlobalType
- Types OptAddrSpace GlobalVarAttributes
+ | OptGlobalAssign GVVisibilityStyle ThreadLocal OptAddrSpace GlobalType
+ ConstVal GlobalVarAttributes
+ | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal OptAddrSpace
+ GlobalType ConstVal GlobalVarAttributes
+ | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal OptAddrSpace
+ GlobalType Types GlobalVarAttributes
| OptGlobalAssign GVVisibilityStyle alias AliasLinkage AliaseeRef
| target TargetDefinition
| deplibs "=" LibrariesDefinition
TargetDefinition ::= triple "=" STRINGCONSTANT
| datalayout "=" STRINGCONSTANT ;
-LibrariesDefinition ::= "[" LibList "]";
+LibrariesDefinition ::= "[" ( LibList | _ ) "]";
-LibList ::= LibList ^ "," STRINGCONSTANT | STRINGCONSTANT | _ ;
+LibList ::= LibList ^ "," STRINGCONSTANT | STRINGCONSTANT ;
ArgListH ::= ArgListH ^ "," Types OptParamAttrs OptLocalName
| Types OptParamAttrs OptLocalName ;
ArgList ::= ArgListH | ArgListH ^ "," "..." | "..." | _ ;
-FunctionHeaderH ::= OptCallingConv ResultTypes GlobalName "(" ^ ArgList ^ ")"
+FunctionHeaderH ::= OptCallingConv OptRetAttrs ResultTypes
+ GlobalName ^ "(" ^ ArgList ^ ")"
OptFuncAttrs OptSection OptAlign OptGC ;
BEGIN ::= ( begin | "{" ) ^ "\n";
| undef
| zeroinitializer
| "<" ConstVector ">"
+ | "[" ConstVector "]"
+ | "[" ^ "]"
+ | "c" ^ STRINGCONSTANT
+ | "{" ConstVector "}"
+ | "{" ^ "}"
+ | "<" ^ "{" ConstVector "}" ^ ">"
+ | "<" ^ "{" ^ "}" ^ ">"
| ConstExpr
| asm OptSideEffect STRINGCONSTANT ^ "," STRINGCONSTANT ;
| br label ValueRef
| br INTTYPE ValueRef ^ "," label ValueRef ^ "," label ValueRef
| switch IntType ValueRef ^ "," label ValueRef "[" JumpTable "]"
- | switch IntType ValueRef ^ "," label ValueRef "[" "]"
- | invoke OptCallingConv ResultTypes ValueRef "(" ^ ParamList ^ ")" OptFuncAttrs
+ | switch IntType ValueRef ^ "," label ValueRef "[" ^ "]"
+ | invoke OptCallingConv ResultTypes ValueRef ^ "(" ^ ParamList ^ ")"
+ OptFuncAttrs
to label ValueRef unwind label ValueRef
| unwind
| unreachable ) ^ "\n";
IndexList ::= _ | IndexList ^ "," ResolvedVal ;
+ConstantIndexList ::= "," EUINT64VAL | ConstantIndexList ^ "," EUINT64VAL ;
+
OptTailCall ::= tail call | call ;
InstVal ::=
| LogicalOps Types ValueRef ^ "," ValueRef
| icmp IPredicates Types ValueRef ^ "," ValueRef
| fcmp FPredicates Types ValueRef ^ "," ValueRef
- | vicmp IPredicates Types ValueRef ^ "," ValueRef
- | vfcmp FPredicates Types ValueRef ^ "," ValueRef
| CastOps ResolvedVal to Types
| select ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
- | vaarg ResolvedVal ^ "," Types
+ | "va_arg" ResolvedVal ^ "," Types
| extractelement ResolvedVal ^ "," ResolvedVal
| insertelement ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
| shufflevector ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
| phi PHIList
- | OptTailCall OptCallingConv ResultTypes ValueRef "(" ^ ParamList ^ ")"
+ | OptTailCall OptCallingConv ResultTypes ValueRef ^ "(" ^ ParamList ^ ")"
OptFuncAttrs
| MemoryInst ;
OptVolatile ::= - volatile | _ ;
+OptExact ::= - exact | _ ;
+OptNSW ::= - nsw | _ ;
+OptNUW ::= - nuw | _ ;
+OptNW ::= OptNUW OptNSW ;
+OptInBounds ::= - inbounds | _ ;
MemoryInst ::= malloc Types OptCAlign
| malloc Types ^ "," INTTYPE ValueRef 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 ;