Home | History | Annotate | Download | only in AsmParser

Lines Matching refs:lltok

224     case lltok::Eof: return false;
225 case lltok::kw_declare: if (ParseDeclare()) return true; break;
226 case lltok::kw_define: if (ParseDefine()) return true; break;
227 case lltok::kw_module: if (ParseModuleAsm()) return true; break;
228 case lltok::kw_target: if (ParseTargetDefinition()) return true; break;
229 case lltok::kw_deplibs: if (ParseDepLibs()) return true; break;
230 case lltok::LocalVarID: if (ParseUnnamedType()) return true; break;
231 case lltok::LocalVar: if (ParseNamedType()) return true; break;
232 case lltok::GlobalID: if (ParseUnnamedGlobal()) return true; break;
233 case lltok::GlobalVar: if (ParseNamedGlobal()) return true; break;
234 case lltok::exclaim: if (ParseStandaloneMetadata()) return true; break;
235 case lltok::MetadataVar:if (ParseNamedMetadata()) return true; break;
242 case lltok::kw_private: // OptionalLinkage
243 case lltok::kw_linker_private: // OptionalLinkage
244 case lltok::kw_linker_private_weak: // OptionalLinkage
245 case lltok::kw_linker_private_weak_def_auto: // FIXME: backwards compat.
246 case lltok::kw_internal: // OptionalLinkage
247 case lltok::kw_weak: // OptionalLinkage
248 case lltok::kw_weak_odr: // OptionalLinkage
249 case lltok::kw_linkonce: // OptionalLinkage
250 case lltok::kw_linkonce_odr: // OptionalLinkage
251 case lltok::kw_linkonce_odr_auto_hide: // OptionalLinkage
252 case lltok::kw_appending: // OptionalLinkage
253 case lltok::kw_dllexport: // OptionalLinkage
254 case lltok::kw_common: // OptionalLinkage
255 case lltok::kw_dllimport: // OptionalLinkage
256 case lltok::kw_extern_weak: // OptionalLinkage
257 case lltok::kw_external: { // OptionalLinkage
265 case lltok::kw_default: // OptionalVisibility
266 case lltok::kw_hidden: // OptionalVisibility
267 case lltok::kw_protected: { // OptionalVisibility
275 case lltok::kw_thread_local: // OptionalThreadLocal
276 case lltok::kw_addrspace: // OptionalAddrSpace
277 case lltok::kw_constant: // GlobalType
278 case lltok::kw_global: // GlobalType
282 case lltok::kw_attributes: if (ParseUnnamedAttrGrp()) return true; break;
291 assert(Lex.getKind() == lltok::kw_module);
295 if (ParseToken(lltok::kw_asm, "expected 'module asm'") ||
306 assert(Lex.getKind() == lltok::kw_target);
310 case lltok::kw_triple:
312 if (ParseToken(lltok::equal, "expected '=' after target triple") ||
317 case lltok::kw_datalayout:
319 if (ParseToken(lltok::equal, "expected '=' after target datalayout") ||
332 assert(Lex.getKind() == lltok::kw_deplibs);
334 if (ParseToken(lltok::equal, "expected '=' after deplibs") ||
335 ParseToken(lltok::lsquare, "expected '=' after deplibs"))
338 if (EatIfPresent(lltok::rsquare))
344 } while (EatIfPresent(lltok::comma));
346 return ParseToken(lltok::rsquare, "expected ']' at end of list");
356 if (ParseToken(lltok::equal, "expected '=' after name") ||
357 ParseToken(lltok::kw_type, "expected 'type' after '='"))
386 if (ParseToken(lltok::equal, "expected '=' after name") ||
387 ParseToken(lltok::kw_type, "expected 'type' after name"))
409 assert(Lex.getKind() == lltok::kw_declare);
419 assert(Lex.getKind() == lltok::kw_define);
431 if (Lex.getKind() == lltok::kw_constant)
433 else if (Lex.getKind() == lltok::kw_global)
454 if (Lex.getKind() == lltok::GlobalID) {
460 lltok::equal, "expected '=' after name"))
470 if (HasLinkage || Lex.getKind() != lltok::kw_alias)
479 assert(Lex.getKind() == lltok::GlobalVar);
486 if (ParseToken(lltok::equal, "expected '=' in global variable") ||
491 if (HasLinkage || Lex.getKind() != lltok::kw_alias)
544 assert(Lex.getKind() == lltok::MetadataVar);
548 if (ParseToken(lltok::equal, "expected '=' here") ||
549 ParseToken(lltok::exclaim, "Expected '!' here") ||
550 ParseToken(lltok::lbrace, "Expected '{' here"))
554 if (Lex.getKind() != lltok::rbrace)
556 if (ParseToken(lltok::exclaim, "Expected '!' here"))
562 } while (EatIfPresent(lltok::comma));
564 if (ParseToken(lltok::rbrace, "expected end of metadata node"))
573 assert(Lex.getKind() == lltok::exclaim);
581 ParseToken(lltok::equal, "expected '=' here") ||
583 ParseToken(lltok::exclaim, "Expected '!' here") ||
584 ParseToken(lltok::lbrace, "Expected '{' here") ||
586 ParseToken(lltok::rbrace, "expected end of metadata node"))
624 assert(Lex.getKind() == lltok::kw_alias);
642 if (Lex.getKind() != lltok::kw_bitcast &&
643 Lex.getKind() != lltok::kw_getelementptr) {
716 ParseOptionalToken(lltok::kw_unnamed_addr, UnnamedAddr,
718 ParseOptionalToken(lltok::kw_externally_initialized,
783 while (Lex.getKind() == lltok::comma) {
786 if (Lex.getKind() == lltok::kw_section) {
789 if (ParseToken(lltok::StringConstant, "expected global section string"))
791 } else if (Lex.getKind() == lltok::kw_align) {
806 assert(Lex.getKind() == lltok::kw_attributes);
810 assert(Lex.getKind() == lltok::AttrGrpID);
816 if (ParseToken(lltok::equal, "expected '=' here") ||
817 ParseToken(lltok::lbrace, "expected '{' here") ||
820 ParseToken(lltok::rbrace, "expected end of attribute group"))
839 lltok::Kind Token = Lex.getKind();
840 if (Token == lltok::kw_nobuiltin)
846 case lltok::rbrace:
850 case lltok::AttrGrpID: {
867 case lltok::StringConstant: {
871 if (EatIfPresent(lltok::equal) &&
880 case lltok::kw_align: {
886 if (ParseToken(lltok::equal, "expected '=' here") ||
896 case lltok::kw_alignstack: {
900 if (ParseToken(lltok::equal, "expected '=' here") ||
910 case lltok::kw_alwaysinline: B.addAttribute(Attribute::AlwaysInline); break;
911 case lltok::kw_inlinehint: B.addAttribute(Attribute::InlineHint); break;
912 case lltok::kw_minsize: B.addAttribute(Attribute::MinSize); break;
913 case lltok::kw_naked: B.addAttribute(Attribute::Naked); break;
914 case lltok::kw_nobuiltin: B.addAttribute(Attribute::NoBuiltin); break;
915 case lltok::kw_noduplicate: B.addAttribute(Attribute::NoDuplicate); break;
916 case lltok::kw_noimplicitfloat: B.addAttribute(Attribute::NoImplicitFloat); break;
917 case lltok::kw_noinline: B.addAttribute(Attribute::NoInline); break;
918 case lltok::kw_nonlazybind: B.addAttribute(Attribute::NonLazyBind); break;
919 case lltok::kw_noredzone: B.addAttribute(Attribute::NoRedZone); break;
920 case lltok::kw_noreturn: B.addAttribute(Attribute::NoReturn); break;
921 case lltok::kw_nounwind: B.addAttribute(Attribute::NoUnwind); break;
922 case lltok::kw_optsize: B.addAttribute(Attribute::OptimizeForSize); break;
923 case lltok::kw_readnone: B.addAttribute(Attribute::ReadNone); break;
924 case lltok::kw_readonly: B.addAttribute(Attribute::ReadOnly); break;
925 case lltok::kw_returns_twice: B.addAttribute(Attribute::ReturnsTwice); break;
926 case lltok::kw_ssp: B.addAttribute(Attribute::StackProtect); break;
927 case lltok::kw_sspreq: B.addAttribute(Attribute::StackProtectReq); break;
928 case lltok::kw_sspstrong: B.addAttribute(Attribute::StackProtectStrong); break;
929 case lltok::kw_sanitize_address: B.addAttribute(Attribute::SanitizeAddress); break;
930 case lltok::kw_sanitize_thread: B.addAttribute(Attribute::SanitizeThread); break;
931 case lltok
932 case lltok::kw_uwtable: B.addAttribute(Attribute::UWTable); break;
935 case lltok::kw_inreg:
936 case lltok::kw_signext:
937 case lltok::kw_zeroext:
942 case lltok::kw_byval:
943 case lltok::kw_nest:
944 case lltok::kw_noalias:
945 case lltok::kw_nocapture:
946 case lltok::kw_sret:
1052 bool LLParser::ParseToken(lltok::Kind T, const char *ErrMsg) {
1062 if (Lex.getKind() != lltok::StringConstant)
1072 if (Lex.getKind() != lltok::APSInt || Lex.getAPSIntVal().isSigned())
1090 case lltok::kw_localdynamic:
1093 case lltok::kw_initialexec:
1096 case lltok::kw_localexec:
1111 if (!EatIfPresent(lltok::kw_thread_local))
1115 if (Lex.getKind() == lltok::lparen) {
1118 ParseToken(lltok::rparen, "expected ')' after thread local model");
1128 if (!EatIfPresent(lltok::kw_addrspace))
1130 return ParseToken(lltok::lparen, "expected '(' in address space") ||
1132 ParseToken(lltok::rparen, "expected ')' in address space");
1142 lltok::Kind Token = Lex.getKind();
1146 case lltok::kw_align: {
1153 case lltok::kw_byval: B.addAttribute(Attribute::ByVal); break;
1154 case lltok::kw_inreg: B.addAttribute(Attribute::InReg); break;
1155 case lltok::kw_nest: B.addAttribute(Attribute::Nest); break;
1156 case lltok::kw_noalias: B.addAttribute(Attribute::NoAlias); break;
1157 case lltok::kw_nocapture: B.addAttribute(Attribute::NoCapture); break;
1158 case lltok::kw_signext: B.addAttribute(Attribute::SExt); break;
1159 case lltok::kw_sret: B.addAttribute(Attribute::StructRet); break;
1160 case lltok::kw_zeroext: B.addAttribute(Attribute::ZExt); break;
1162 case lltok::kw_alignstack: case lltok::kw_nounwind:
1163 case lltok::kw_alwaysinline: case lltok::kw_optsize:
1164 case lltok::kw_inlinehint: case lltok::kw_readnone:
1165 case lltok::kw_minsize: case lltok::kw_readonly:
1166 case lltok::kw_naked: case lltok::kw_returns_twice:
1167 case lltok::kw_nobuiltin: case lltok::kw_sanitize_address:
1168 case lltok::kw_noimplicitfloat: case lltok::kw_sanitize_memory:
1169 case lltok::kw_noinline: case lltok::kw_sanitize_thread:
1170 case lltok::kw_nonlazybind: case lltok::kw_ssp:
1171 case lltok::kw_noredzone: case lltok::kw_sspreq:
1172 case lltok::kw_noreturn: case lltok::kw_uwtable:
1188 lltok::Kind Token = Lex.getKind();
1192 case lltok::kw_inreg: B.addAttribute(Attribute::InReg); break;
1193 case lltok::kw_noalias: B.addAttribute(Attribute::NoAlias); break;
1194 case lltok::kw_signext: B.addAttribute(Attribute::SExt); break;
1195 case lltok::kw_zeroext: B.addAttribute(Attribute::ZExt); break;
1198 case lltok::kw_sret: case lltok::kw_nocapture:
1199 case lltok::kw_byval: case lltok::kw_nest:
1203 case lltok::kw_align: case lltok::kw_noreturn:
1204 case lltok::kw_alignstack: case lltok::kw_nounwind:
1205 case lltok::kw_alwaysinline: case lltok::kw_optsize:
1206 case lltok::kw_inlinehint: case lltok::kw_readnone:
1207 case lltok::kw_minsize: case lltok::kw_readonly:
1208 case lltok::kw_naked: case lltok::kw_returns_twice:
1209 case lltok::kw_nobuiltin: case lltok::kw_sanitize_address:
1210 case lltok::kw_noduplicate: case lltok::kw_sanitize_memory:
1211 case lltok::kw_noimplicitfloat: case lltok::kw_sanitize_thread:
1212 case lltok::kw_noinline: case lltok::kw_ssp:
1213 case lltok::kw_nonlazybind: case lltok::kw_sspreq:
1214 case lltok::kw_noredzone: case lltok::kw_sspstrong:
1215 case lltok::kw_uwtable:
1246 case lltok::kw_private: Res = GlobalValue::PrivateLinkage; break;
1247 case lltok::kw_linker_private: Res = GlobalValue::LinkerPrivateLinkage; break;
1248 case lltok::kw_linker_private_weak:
1251 case lltok::kw_internal: Res = GlobalValue::InternalLinkage; break;
1252 case lltok::kw_weak: Res = GlobalValue::WeakAnyLinkage; break;
1253 case lltok::kw_weak_odr: Res = GlobalValue::WeakODRLinkage; break;
1254 case lltok::kw_linkonce: Res = GlobalValue::LinkOnceAnyLinkage; break;
1255 case lltok::kw_linkonce_odr: Res = GlobalValue::LinkOnceODRLinkage; break;
1256 case lltok::kw_linkonce_odr_auto_hide:
1257 case lltok::kw_linker_private_weak_def_auto: // FIXME: For backwards compat.
1260 case lltok::kw_available_externally:
1263 case lltok::kw_appending: Res = GlobalValue::AppendingLinkage; break;
1264 case lltok::kw_dllexport: Res = GlobalValue::DLLExportLinkage; break;
1265 case lltok::kw_common: Res = GlobalValue::CommonLinkage; break;
1266 case lltok::kw_dllimport: Res = GlobalValue::DLLImportLinkage; break;
1267 case lltok::kw_extern_weak: Res = GlobalValue::ExternalWeakLinkage; break;
1268 case lltok::kw_external: Res = GlobalValue::ExternalLinkage; break;
1284 case lltok::kw_default: Res = GlobalValue::DefaultVisibility; break;
1285 case lltok::kw_hidden: Res = GlobalValue::HiddenVisibility; break;
1286 case lltok::kw_protected: Res = GlobalValue::ProtectedVisibility; break;
1314 case lltok::kw_ccc: CC = CallingConv::C; break;
1315 case lltok::kw_fastcc: CC = CallingConv::Fast; break;
1316 case lltok::kw_coldcc: CC = CallingConv::Cold; break;
1317 case lltok::kw_x86_stdcallcc: CC = CallingConv::X86_StdCall; break;
1318 case lltok::kw_x86_fastcallcc: CC = CallingConv::X86_FastCall; break;
1319 case lltok::kw_x86_thiscallcc: CC = CallingConv::X86_ThisCall; break;
1320 case lltok::kw_arm_apcscc: CC = CallingConv::ARM_APCS; break;
1321 case lltok::kw_arm_aapcscc: CC = CallingConv::ARM_AAPCS; break;
1322 case lltok::kw_arm_aapcs_vfpcc:CC = CallingConv::ARM_AAPCS_VFP; break;
1323 case lltok::kw_msp430_intrcc: CC = CallingConv::MSP430_INTR; break;
1324 case lltok::kw_ptx_kernel: CC = CallingConv::PTX_Kernel; break;
1325 case lltok::kw_ptx_device: CC = CallingConv::PTX_Device; break;
1326 case lltok::kw_spir_kernel: CC = CallingConv::SPIR_KERNEL; break;
1327 case lltok::kw_spir_func: CC = CallingConv::SPIR_FUNC; break;
1328 case lltok::kw_intel_ocl_bicc: CC = CallingConv::Intel_OCL_BI; break;
1329 case lltok::kw_cc: {
1348 if (Lex.getKind() != lltok::MetadataVar)
1358 if (ParseToken(lltok::exclaim, "expected '!' here"))
1365 if (Lex.getKind() == lltok::lbrace) {
1386 lltok::comma));
1395 if (!EatIfPresent(lltok::kw_align))
1415 while (EatIfPresent(lltok::comma)) {
1417 if (Lex.getKind() == lltok::MetadataVar) {
1422 if (Lex.getKind() != lltok::kw_align)
1442 if (EatIfPresent(lltok::kw_singlethread))
1446 case lltok::kw_unordered: Ordering = Unordered; break;
1447 case lltok::kw_monotonic: Ordering = Monotonic; break;
1448 case lltok::kw_acquire: Ordering = Acquire; break;
1449 case lltok::kw_release: Ordering = Release; break;
1450 case lltok::kw_acq_rel: Ordering = AcquireRelease; break;
1451 case lltok::kw_seq_cst: Ordering = SequentiallyConsistent; break;
1462 if (!EatIfPresent(lltok::kw_alignstack))
1465 if (!EatIfPresent(lltok::lparen))
1470 if (!EatIfPresent(lltok::rparen))
1490 if (Lex.getKind() != lltok::comma)
1493 while (EatIfPresent(lltok::comma)) {
1494 if (Lex.getKind() == lltok::MetadataVar) {
1516 case lltok::Type:
1521 case lltok::lbrace:
1526 case lltok::lsquare:
1532 case lltok::less: // Either vector or packed struct.
1535 if (Lex.getKind() == lltok::lbrace) {
1537 ParseToken(lltok::greater, "expected '>' at end of packed struct"))
1542 case lltok::LocalVar: {
1557 case lltok::LocalVarID: {
1585 case lltok::star:
1597 case lltok::kw_addrspace: {
1606 ParseToken(lltok::star, "expected '*' in address space"))
1614 case lltok::lparen:
1629 if (ParseToken(lltok::lparen, "expected '(' in call"))
1633 while (Lex.getKind() != lltok::rparen) {
1636 ParseToken(lltok::comma, "expected ',' in argument list"))
1673 assert(Lex.getKind() == lltok::lparen);
1676 if (Lex.getKind() == lltok::rparen) {
1678 } else if (Lex.getKind() == lltok::dotdotdot) {
1693 if (Lex.getKind() == lltok::LocalVar) {
1706 while (EatIfPresent(lltok::comma)) {
1708 if (EatIfPresent(lltok::dotdotdot)) {
1720 if (Lex.getKind() == lltok::LocalVar) {
1737 return ParseToken(lltok::rparen, "expected ')' at end of argument list");
1743 assert(Lex.getKind() == lltok::lparen);
1790 if (EatIfPresent(lltok::kw_opaque)) {
1802 bool isPacked = EatIfPresent(lltok::less);
1807 if (Lex.getKind() != lltok::lbrace) {
1828 (isPacked && ParseToken(lltok::greater, "expected '>' in packed struct")))
1844 assert(Lex.getKind() == lltok::lbrace);
1848 if (EatIfPresent(lltok::rbrace))
1859 while (EatIfPresent(lltok::comma)) {
1869 return ParseToken(lltok::rbrace, "expected '}' at end of struct");
1878 if (Lex.getKind() != lltok::APSInt || Lex.getAPSIntVal().isSigned() ||
1886 if (ParseToken(lltok::kw_x, "expected 'x' after element count"))
1893 if (ParseToken(isVector ? lltok::greater : lltok::rsquare,
2184 case lltok::GlobalID: // @42
2188 case lltok::GlobalVar: // @foo
2192 case lltok::LocalVarID: // %42
2196 case lltok::LocalVar: // %foo
2200 case lltok::exclaim: // !42, !{...}, or !"foo"
2202 case lltok::APSInt:
2206 case lltok::APFloat:
2210 case lltok::kw_true:
2214 case lltok::kw_false:
2218 case lltok::kw_null: ID.Kind = ValID::t_Null; break;
2219 case lltok::kw_undef: ID.Kind = ValID::t_Undef; break;
2220 case lltok::kw_zeroinitializer: ID.Kind = ValID::t_Zero; break;
2222 case lltok::lbrace: {
2227 ParseToken(lltok::rbrace, "expected end of struct constant"))
2236 case lltok::less: {
2240 bool isPackedStruct = EatIfPresent(lltok::lbrace);
2246 ParseToken(lltok::rbrace, "expected end of packed struct")) ||
2247 ParseToken(lltok::greater, "expected end of constant"))
2278 case lltok::lsquare: { // Array Constant
2283 ParseToken(lltok::rsquare, "expected end of array constant"))
2312 case lltok::kw_c: // c "foo"
2316 if (ParseToken(lltok::StringConstant, "expected string")) return true;
2320 case lltok::kw_asm: {
2325 if (ParseOptionalToken(lltok::kw_sideeffect, HasSideEffect) ||
2326 ParseOptionalToken(lltok::kw_alignstack, AlignStack) ||
2327 ParseOptionalToken(lltok::kw_inteldialect, AsmDialect) ||
2329 ParseToken(lltok::comma, "expected comma in inline asm expression") ||
2330 ParseToken(lltok::StringConstant, "expected constraint string"))
2339 case lltok::kw_blockaddress: {
2346 if (ParseToken(lltok::lparen, "expected '(' in block address expression") ||
2348 ParseToken(lltok::comma, "expected comma in block address expression")||
2350 ParseToken(lltok::rparen, "expected ')' in block address expression"))
2368 case lltok::kw_trunc:
2369 case lltok::kw_zext:
2370 case lltok::kw_sext:
2371 case lltok::kw_fptrunc:
2372 case lltok::kw_fpext:
2373 case lltok::kw_bitcast:
2374 case lltok::kw_uitofp:
2375 case lltok::kw_sitofp:
2376 case lltok::kw_fptoui:
2377 case lltok::kw_fptosi:
2378 case lltok::kw_inttoptr:
2379 case lltok::kw_ptrtoint: {
2384 if (ParseToken(lltok::lparen, "expected '(' after constantexpr cast") ||
2386 ParseToken(lltok::kw_to, "expected 'to' in constantexpr cast") ||
2388 ParseToken(lltok::rparen, "expected ')' at end of constantexpr cast"))
2399 case lltok::kw_extractvalue: {
2403 if (ParseToken(lltok::lparen, "expected '(' in extractvalue constantexpr")||
2406 ParseToken(lltok::rparen, "expected ')' in extractvalue constantexpr"))
2417 case lltok::kw_insertvalue: {
2421 if (ParseToken(lltok::lparen, "expected '(' in insertvalue constantexpr")||
2423 ParseToken(lltok::comma, "expected comma in insertvalue constantexpr")||
2426 ParseToken(lltok::rparen, "expected ')' in insertvalue constantexpr"))
2436 case lltok::kw_icmp:
2437 case lltok::kw_fcmp: {
2442 ParseToken(lltok::lparen, "expected '(' in compare constantexpr") ||
2444 ParseToken(lltok::comma, "expected comma in compare constantexpr") ||
2446 ParseToken(lltok::rparen, "expected ')' in compare constantexpr"))
2470 case lltok::kw_add:
2471 case lltok::kw_fadd:
2472 case lltok::kw_sub:
2473 case lltok::kw_fsub:
2474 case lltok::kw_mul:
2475 case lltok::kw_fmul:
2476 case lltok::kw_udiv:
2477 case lltok::kw_sdiv:
2478 case lltok::kw_fdiv:
2479 case lltok::kw_urem:
2480 case lltok::kw_srem:
2481 case lltok::kw_frem:
2482 case lltok::kw_shl:
2483 case lltok::kw_lshr:
2484 case lltok::kw_ashr: {
2494 if (EatIfPresent(lltok::kw_nuw))
2496 if (EatIfPresent(lltok::kw_nsw)) {
2498 if (EatIfPresent(lltok::kw_nuw))
2503 if (EatIfPresent(lltok::kw_exact))
2506 if (ParseToken(lltok::lparen, "expected '(' in binary constantexpr") ||
2508 ParseToken(lltok::comma, "expected comma in binary constantexpr") ||
2510 ParseToken(lltok::rparen, "expected ')' in binary constantexpr"))
2556 case lltok::kw_and:
2557 case lltok::kw_or:
2558 case lltok::kw_xor: {
2562 if (ParseToken(lltok::lparen, "expected '(' in logical constantexpr") ||
2564 ParseToken(lltok::comma, "expected comma in logical constantexpr") ||
2566 ParseToken(lltok::rparen, "expected ')' in logical constantexpr"))
2578 case lltok::kw_getelementptr:
2579 case lltok::kw_shufflevector:
2580 case lltok::kw_insertelement:
2581 case lltok::kw_extractelement:
2582 case lltok::kw_select: {
2588 InBounds = EatIfPresent(lltok::kw_inbounds);
2589 if (ParseToken(lltok::lparen, "expected '(' in constantexpr") ||
2591 ParseToken(lltok::rparen, "expected ')' in constantexpr"))
2666 if (Lex.getKind() == lltok::rbrace ||
2667 Lex.getKind() == lltok::rsquare ||
2668 Lex.getKind() == lltok::greater ||
2669 Lex.getKind() == lltok::rparen)
2676 while (EatIfPresent(lltok::comma)) {
2685 assert(Lex.getKind() == lltok::lbrace);
2690 ParseToken(lltok::rbrace, "expected end of metadata node"))
2703 assert(Lex.getKind() == lltok::exclaim);
2708 if (Lex.getKind() == lltok::lbrace)
2713 if (Lex.getKind() == lltok::APSInt) {
2932 if (Lex.getKind() == lltok::GlobalVar) {
2934 } else if (Lex.getKind() == lltok::GlobalID) { // @42 is ok.
2946 if (Lex.getKind() != lltok::lparen)
2961 ParseOptionalToken(lltok::kw_unnamed_addr, UnnamedAddr,
2965 (EatIfPresent(lltok::kw_section) &&
2968 (EatIfPresent(lltok::kw_gc) &&
3091 if (Lex.getKind() != lltok::lbrace)
3101 if (Lex.getKind() == lltok::rbrace)
3104 while (Lex.getKind() != lltok::rbrace)
3120 if (Lex.getKind() == lltok::LabelStr) {
3140 if (Lex.getKind() == lltok::LocalVarID) {
3143 if (ParseToken(lltok::equal, "expected '=' after instruction id"))
3145 } else if (Lex.getKind() == lltok::LocalVar) {
3148 if (ParseToken(lltok::equal, "expected '=' after instruction name"))
3160 if (EatIfPresent(lltok::comma))
3189 lltok::Kind Token = Lex.getKind();
3190 if (Token == lltok::Eof)
3199 case lltok::kw_unreachable: Inst = new UnreachableInst(Context); return false;
3200 case lltok::kw_ret: return ParseRet(Inst, BB, PFS);
3201 case lltok::kw_br: return ParseBr(Inst, PFS);
3202 case lltok::kw_switch: return ParseSwitch(Inst, PFS);
3203 case lltok::kw_indirectbr: return ParseIndirectBr(Inst, PFS);
3204 case lltok::kw_invoke: return ParseInvoke(Inst, PFS);
3205 case lltok::kw_resume: return ParseResume(Inst, PFS);
3207 case lltok::kw_add:
3208 case lltok::kw_sub:
3209 case lltok::kw_mul:
3210 case lltok::kw_shl: {
3211 bool NUW = EatIfPresent(lltok::kw_nuw);
3212 bool NSW = EatIfPresent(lltok::kw_nsw);
3213 if (!NUW) NUW = EatIfPresent(lltok::kw_nuw);
3221 case lltok::kw_fadd:
3222 case lltok::kw_fsub:
3223 case lltok::kw_fmul:
3224 case lltok::kw_fdiv:
3225 case lltok::kw_frem: {
3235 case lltok::kw_sdiv:
3236 case lltok::kw_udiv:
3237 case lltok::kw_lshr:
3238 case lltok::kw_ashr: {
3239 bool Exact = EatIfPresent(lltok::kw_exact);
3246 case lltok::kw_urem:
3247 case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1);
3248 case lltok::kw_and:
3249 case lltok::kw_or:
3250 case lltok::kw_xor: return ParseLogical(Inst, PFS, KeywordVal);
3251 case lltok::kw_icmp:
3252 case lltok::kw_fcmp: return ParseCompare(Inst, PFS, KeywordVal);
3254 case lltok::kw_trunc:
3255 case lltok::kw_zext:
3256 case lltok::kw_sext:
3257 case lltok::kw_fptrunc:
3258 case lltok::kw_fpext:
3259 case lltok::kw_bitcast:
3260 case lltok::kw_uitofp:
3261 case lltok::kw_sitofp:
3262 case lltok::kw_fptoui:
3263 case lltok::kw_fptosi:
3264 case lltok::kw_inttoptr:
3265 case lltok::kw_ptrtoint: return ParseCast(Inst, PFS, KeywordVal);
3267 case lltok::kw_select: return ParseSelect(Inst, PFS);
3268 case lltok::kw_va_arg: return ParseVA_Arg(Inst, PFS);
3269 case lltok::kw_extractelement: return ParseExtractElement(Inst, PFS);
3270 case lltok::kw_insertelement: return ParseInsertElement(Inst, PFS);
3271 case lltok::kw_shufflevector: return ParseShuffleVector(Inst, PFS);
3272 lltok::kw_phi: return ParsePHI(Inst, PFS);
3273 case lltok::kw_landingpad: return ParseLandingPad(Inst, PFS);
3274 case lltok::kw_call: return ParseCall(Inst, PFS, false);
3275 case lltok::kw_tail: return ParseCall(Inst, PFS, true);
3277 case lltok::kw_alloca: return ParseAlloc(Inst, PFS);
3278 case lltok::kw_load: return ParseLoad(Inst, PFS);
3279 case lltok::kw_store: return ParseStore(Inst, PFS);
3280 case lltok::kw_cmpxchg: return ParseCmpXchg(Inst, PFS);
3281 case lltok::kw_atomicrmw: return ParseAtomicRMW(Inst, PFS);
3282 case lltok::kw_fence: return ParseFence(Inst, PFS);
3283 case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
3284 case lltok::kw_extractvalue: return ParseExtractValue(Inst, PFS);
3285 case lltok::kw_insertvalue: return ParseInsertValue(Inst, PFS);
3294 case lltok::kw_oeq: P = CmpInst::FCMP_OEQ; break;
3295 case lltok::kw_one: P = CmpInst::FCMP_ONE; break;
3296 case lltok::kw_olt: P = CmpInst::FCMP_OLT; break;
3297 case lltok::kw_ogt: P = CmpInst::FCMP_OGT; break;
3298 case lltok::kw_ole: P = CmpInst::FCMP_OLE; break;
3299 case lltok::kw_oge: P = CmpInst::FCMP_OGE; break;
3300 case lltok::kw_ord: P = CmpInst::FCMP_ORD; break;
3301 case lltok::kw_uno: P = CmpInst::FCMP_UNO; break;
3302 case lltok::kw_ueq: P = CmpInst::FCMP_UEQ; break;
3303 case lltok::kw_une: P = CmpInst::FCMP_UNE; break;
3304 case lltok::kw_ult: P = CmpInst::FCMP_ULT; break;
3305 case lltok::kw_ugt: P = CmpInst::FCMP_UGT; break;
3306 case lltok::kw_ule: P = CmpInst::FCMP_ULE; break;
3307 case lltok::kw_uge: P = CmpInst::FCMP_UGE; break;
3308 case lltok::kw_true: P = CmpInst::FCMP_TRUE; break;
3309 case lltok::kw_false: P = CmpInst::FCMP_FALSE; break;
3314 case lltok::kw_eq: P = CmpInst::ICMP_EQ; break;
3315 case lltok::kw_ne: P = CmpInst::ICMP_NE; break;
3316 case lltok::kw_slt: P = CmpInst::ICMP_SLT; break;
3317 case lltok::kw_sgt: P = CmpInst::ICMP_SGT; break;
3318 case lltok::kw_sle: P = CmpInst::ICMP_SLE; break;
3319 case lltok::kw_sge: P = CmpInst::ICMP_SGE; break;
3320 case lltok::kw_ult: P = CmpInst::ICMP_ULT; break;
3321 case lltok::kw_ugt: P = CmpInst::ICMP_UGT; break;
3322 case lltok::kw_ule: P = CmpInst::ICMP_ULE; break;
3323 case lltok::kw_uge: P = CmpInst::ICMP_UGE; break;
3383 if (ParseToken(lltok::comma, "expected ',' after branch condition") ||
3385 ParseToken(lltok::comma, "expected ',' after true destination") ||
3403 ParseToken(lltok::comma, "expected ',' after switch condition") ||
3405 ParseToken(lltok::lsquare, "expected '[' with switch table"))
3414 while (Lex.getKind() != lltok::rsquare) {
3419 ParseToken(lltok::comma, "expected ',' after case value") ||
3447 ParseToken(lltok::comma, "expected ',' after indirectbr address") ||
3448 ParseToken(lltok::lsquare, "expected '[' with indirectbr"))
3457 if (Lex.getKind() != lltok::rsquare) {
3463 while (EatIfPresent(lltok::comma)) {
3470 if (ParseToken(lltok::rsquare, "expected ']' at end of block list"))
3503 ParseToken(lltok::kw_to, "expected 'to' in invoke") ||
3505 ParseToken(lltok::kw_unwind, "expected 'unwind' in invoke") ||
3607 ParseToken(lltok::comma, "expected ',' in arithmetic operation") ||
3635 ParseToken(lltok::comma, "expected ',' in logical operation") ||
3658 ParseToken(lltok::comma, "expected ',' after compare value") ||
3689 ParseToken(lltok::kw_to, "expected 'to' after cast value") ||
3709 ParseToken(lltok::comma, "expected ',' after select condition") ||
3711 ParseToken(lltok::comma, "expected ',' after select value") ||
3729 ParseToken(lltok::comma, "expected ',' after vaarg operand") ||
3746 ParseToken(lltok::comma, "expected ',' after extract value") ||
3763 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
3765 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
3782 ParseToken(lltok::comma, "expected ',' after shuffle mask") ||
3784 ParseToken(lltok::comma, "expected ',' after shuffle value") ||
3802 ParseToken(lltok::lsquare, "expected '[' in phi value list") ||
3804 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
3806 ParseToken(lltok::rsquare, "expected ']' in phi value list"))
3814 if (!EatIfPresent(lltok::comma))
3817 if (Lex.getKind() == lltok::MetadataVar) {
3822 if (ParseToken(lltok::lsquare, "expected '[' in phi value list") ||
3824 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
3826 ParseToken(lltok::rsquare, "expected ']' in phi value list"))
3851 ParseToken(lltok::kw_personality, "expected 'personality'") ||
3856 LP->setCleanup(EatIfPresent(lltok::kw_cleanup));
3858 while (Lex.getKind() == lltok::kw_catch || Lex.getKind() == lltok::kw_filter){
3860 if (EatIfPresent(lltok::kw_catch))
3862 else if (EatIfPresent(lltok::kw_filter))
3905 if ((isTail && ParseToken(lltok::kw_call, "expected 'tail call'")) ||
4003 if (EatIfPresent(lltok::comma)) {
4004 if (Lex.getKind() == lltok::kw_align) {
4006 } else if (Lex.getKind() == lltok::MetadataVar) {
4034 if (Lex.getKind() == lltok::kw_atomic) {
4040 if (Lex.getKind() == lltok::kw_volatile) {
4075 if (Lex.getKind() == lltok::kw_atomic) {
4081 if (Lex.getKind() == lltok::kw_volatile) {
4087 ParseToken(lltok::comma, "expected ',' after store operand") ||
4118 if (EatIfPresent(lltok::kw_volatile))
4122 ParseToken(lltok::comma, "expected ',' after cmpxchg address") ||
4124 ParseToken(lltok::comma, "expected ',' after cmpxchg cmp operand") ||
4162 if (EatIfPresent(lltok::kw_volatile))
4167 case lltok::kw_xchg: Operation = AtomicRMWInst::Xchg; break;
4168 case lltok::kw_add: Operation = AtomicRMWInst::Add; break;
4169 case lltok::kw_sub: Operation = AtomicRMWInst::Sub; break;
4170 case lltok::kw_and: Operation = AtomicRMWInst::And; break;
4171 case lltok::kw_nand: Operation = AtomicRMWInst::Nand; break;
4172 case lltok::kw_or: Operation = AtomicRMWInst::Or; break;
4173 case lltok::kw_xor: Operation = AtomicRMWInst::Xor; break;
4174 case lltok::kw_max: Operation = AtomicRMWInst::Max; break;
4175 case lltok::kw_min: Operation = AtomicRMWInst::Min; break;
4176 case lltok::kw_umax: Operation = AtomicRMWInst::UMax; break;
4177 case lltok::kw_umin: Operation = AtomicRMWInst::UMin; break;
4182 ParseToken(lltok::comma, "expected ',' after atomicrmw address") ||
4231 bool InBounds = EatIfPresent(lltok::kw_inbounds);
4240 while (EatIfPresent(lltok::comma)) {
4241 if (Lex.getKind() == lltok::MetadataVar) {
4294 ParseToken(lltok::comma, "expected comma after insertvalue operand") ||
4319 if (Lex.getKind() == lltok::rbrace)
4324 if (EatIfPresent(lltok::kw_null)) {
4332 } while (EatIfPresent(lltok::comma));