Home | History | Annotate | Download | only in AsmParser

Lines Matching full:lltok

175     case lltok::Eof: return false;
176 case lltok::kw_declare: if (ParseDeclare()) return true; break;
177 case lltok::kw_define: if (ParseDefine()) return true; break;
178 case lltok::kw_module: if (ParseModuleAsm()) return true; break;
179 case lltok::kw_target: if (ParseTargetDefinition()) return true; break;
180 case lltok::kw_deplibs: if (ParseDepLibs()) return true; break;
181 case lltok::LocalVarID: if (ParseUnnamedType()) return true; break;
182 case lltok::LocalVar: if (ParseNamedType()) return true; break;
183 case lltok::GlobalID: if (ParseUnnamedGlobal()) return true; break;
184 case lltok::GlobalVar: if (ParseNamedGlobal()) return true; break;
185 case lltok::ComdatVar: if (parseComdat()) return true; break;
186 case lltok::exclaim: if (ParseStandaloneMetadata()) return true; break;
187 case lltok::MetadataVar:if (ParseNamedMetadata()) return true; break;
194 case lltok::kw_private: // OptionalLinkage
195 case lltok::kw_internal: // OptionalLinkage
196 case lltok::kw_weak: // OptionalLinkage
197 case lltok::kw_weak_odr: // OptionalLinkage
198 case lltok::kw_linkonce: // OptionalLinkage
199 case lltok::kw_linkonce_odr: // OptionalLinkage
200 case lltok::kw_appending: // OptionalLinkage
201 case lltok::kw_common: // OptionalLinkage
202 case lltok::kw_extern_weak: // OptionalLinkage
203 case lltok::kw_external: // OptionalLinkage
204 case lltok::kw_default: // OptionalVisibility
205 case lltok::kw_hidden: // OptionalVisibility
206 case lltok::kw_protected: // OptionalVisibility
207 case lltok::kw_dllimport: // OptionalDLLStorageClass
208 case lltok::kw_dllexport: // OptionalDLLStorageClass
209 case lltok::kw_thread_local: // OptionalThreadLocal
210 case lltok::kw_addrspace: // OptionalAddrSpace
211 case lltok::kw_constant: // GlobalType
212 case lltok::kw_global: { // GlobalType
228 case lltok::kw_attributes: if (ParseUnnamedAttrGrp()) return true; break;
229 case lltok::kw_uselistorder: if (ParseUseListOrder()) return true; break;
230 case lltok::kw_uselistorder_bb:
240 assert(Lex.getKind() == lltok::kw_module);
244 if (ParseToken(lltok::kw_asm, "expected 'module asm'") ||
255 assert(Lex.getKind() == lltok::kw_target);
259 case lltok::kw_triple:
261 if (ParseToken(lltok::equal, "expected '=' after target triple") ||
266 case lltok::kw_datalayout:
268 if (ParseToken(lltok::equal, "expected '=' after target datalayout") ||
281 assert(Lex.getKind() == lltok::kw_deplibs);
283 if (ParseToken(lltok::equal, "expected '=' after deplibs") ||
284 ParseToken(lltok::lsquare, "expected '=' after deplibs"))
287 if (EatIfPresent(lltok::rsquare))
293 } while (EatIfPresent(lltok::comma));
295 return ParseToken(lltok::rsquare, "expected ']' at end of list");
305 if (ParseToken(lltok::equal, "expected '=' after name") ||
306 ParseToken(lltok::kw_type, "expected 'type' after '='"))
332 if (ParseToken(lltok::equal, "expected '=' after name") ||
333 ParseToken(lltok::kw_type, "expected 'type' after name"))
355 assert(Lex.getKind() == lltok::kw_declare);
365 assert(Lex.getKind() == lltok::kw_define);
377 if (Lex.getKind() == lltok::kw_constant)
379 else if (Lex.getKind() == lltok::kw_global)
402 if (Lex.getKind() == lltok::GlobalID) {
408 if (ParseToken(lltok::equal, "expected '=' after name"))
423 if (Lex.getKind() != lltok::kw_alias)
435 assert(Lex.getKind() == lltok::GlobalVar);
444 if (ParseToken(lltok::equal, "expected '=' in global variable") ||
452 if (Lex.getKind() != lltok::kw_alias)
461 assert(Lex.getKind() == lltok::ComdatVar);
466 if (ParseToken(lltok::equal, "expected '=' here"))
469 if (ParseToken(lltok::kw_comdat, "expected comdat keyword"))
476 case lltok::kw_any:
479 case lltok::kw_exactmatch:
482 case lltok::kw_largest:
485 case lltok::kw_noduplicates:
488 case lltok::kw_samesize:
546 assert(Lex.getKind() == lltok::MetadataVar);
550 if (ParseToken(lltok::equal, "expected '=' here") ||
551 ParseToken(lltok::exclaim, "Expected '!' here") ||
552 ParseToken(lltok::lbrace, "Expected '{' here"))
556 if (Lex.getKind() != lltok::rbrace)
558 if (ParseToken(lltok::exclaim, "Expected '!' here"))
564 } while (EatIfPresent(lltok::comma));
566 if (ParseToken(lltok::rbrace, "expected end of metadata node"))
575 assert(Lex.getKind() == lltok::exclaim);
581 ParseToken(lltok::equal, "expected '=' here"))
585 if (Lex.getKind() == lltok::Type)
588 bool IsDistinct = EatIfPresent(lltok::kw_distinct);
589 if (Lex.getKind() == lltok::MetadataVar) {
592 } else if (ParseToken(lltok::exclaim, "Expected '!' here") ||
631 assert(Lex.getKind() == lltok::kw_alias);
645 if (Lex.getKind() != lltok::kw_bitcast &&
646 Lex.getKind() != lltok::kw_getelementptr &&
647 Lex.getKind() != lltok::kw_addrspacecast &&
648 Lex.getKind() != lltok::kw_inttoptr) {
737 ParseOptionalToken(lltok::kw_externally_initialized,
805 while (Lex.getKind() == lltok::comma) {
808 if (Lex.getKind() == lltok::kw_section) {
811 if (ParseToken(lltok::StringConstant, "expected global section string"))
813 } else if (Lex.getKind() == lltok::kw_align) {
834 assert(Lex.getKind() == lltok::kw_attributes);
838 if (Lex.getKind() != lltok::AttrGrpID)
846 if (ParseToken(lltok::equal, "expected '=' here") ||
847 ParseToken(lltok::lbrace, "expected '{' here") ||
850 ParseToken(lltok::rbrace, "expected end of attribute group"))
869 lltok::Kind Token = Lex.getKind();
870 if (Token == lltok::kw_builtin)
876 case lltok::rbrace:
880 case lltok::AttrGrpID: {
897 case lltok::StringConstant: {
901 if (EatIfPresent(lltok::equal) &&
910 case lltok::kw_align: {
917 if (ParseToken(lltok::equal, "expected '=' here") ||
927 case lltok::kw_alignstack: {
931 if (ParseToken(lltok::equal, "expected '=' here") ||
941 case lltok::kw_alwaysinline: B.addAttribute(Attribute::AlwaysInline); break;
942 case lltok::kw_builtin: B.addAttribute(Attribute::Builtin); break;
943 case lltok::kw_cold: B.addAttribute(Attribute::Cold); break;
944 case lltok::kw_inlinehint: B.addAttribute(Attribute::InlineHint); break;
945 case lltok::kw_jumptable: B.addAttribute(Attribute::JumpTable); break;
946 case lltok::kw_minsize: B.addAttribute(Attribute::MinSize); break;
947 case lltok::kw_naked: B.addAttribute(Attribute::Naked); break;
948 case lltok::kw_nobuiltin: B.addAttribute(Attribute::NoBuiltin); break;
949 case lltok::kw_noduplicate: B.addAttribute(Attribute::NoDuplicate); break;
950 case lltok::kw_noimplicitfloat: B.addAttribute(Attribute::NoImplicitFloat); break;
951 case lltok::kw_noinline: B.addAttribute(Attribute::NoInline); break;
952 case lltok
953 case lltok::kw_noredzone: B.addAttribute(Attribute::NoRedZone); break;
954 case lltok::kw_noreturn: B.addAttribute(Attribute::NoReturn); break;
955 case lltok::kw_nounwind: B.addAttribute(Attribute::NoUnwind); break;
956 case lltok::kw_optnone: B.addAttribute(Attribute::OptimizeNone); break;
957 case lltok::kw_optsize: B.addAttribute(Attribute::OptimizeForSize); break;
958 case lltok::kw_readnone: B.addAttribute(Attribute::ReadNone); break;
959 case lltok::kw_readonly: B.addAttribute(Attribute::ReadOnly); break;
960 case lltok::kw_returns_twice: B.addAttribute(Attribute::ReturnsTwice); break;
961 case lltok::kw_ssp: B.addAttribute(Attribute::StackProtect); break;
962 case lltok::kw_sspreq: B.addAttribute(Attribute::StackProtectReq); break;
963 case lltok::kw_sspstrong: B.addAttribute(Attribute::StackProtectStrong); break;
964 case lltok::kw_sanitize_address: B.addAttribute(Attribute::SanitizeAddress); break;
965 case lltok::kw_sanitize_thread: B.addAttribute(Attribute::SanitizeThread); break;
966 case lltok::kw_sanitize_memory: B.addAttribute(Attribute::SanitizeMemory); break;
967 case lltok::kw_uwtable: B.addAttribute(Attribute::UWTable); break;
970 case lltok::kw_inreg:
971 case lltok::kw_signext:
972 case lltok::kw_zeroext:
977 case lltok::kw_byval:
978 case lltok::kw_dereferenceable:
979 case lltok::kw_dereferenceable_or_null:
980 case lltok::kw_inalloca:
981 case lltok::kw_nest:
982 case lltok::kw_noalias:
983 case lltok::kw_nocapture:
984 case lltok::kw_nonnull:
985 case lltok::kw_returned:
986 case lltok::kw_sret:
1110 bool LLParser::ParseToken(lltok::Kind T, const char *ErrMsg) {
1120 if (Lex.getKind() != lltok::StringConstant)
1130 if (Lex.getKind() != lltok::APSInt || Lex.getAPSIntVal().isSigned())
1143 if (Lex.getKind() != lltok::APSInt || Lex.getAPSIntVal().isSigned())
1158 case lltok::kw_localdynamic:
1161 case lltok::kw_initialexec:
1164 case lltok::kw_localexec:
1179 if (!EatIfPresent(lltok::kw_thread_local))
1183 if (Lex.getKind() == lltok::lparen) {
1186 ParseToken(lltok::rparen, "expected ')' after thread local model");
1196 if (!EatIfPresent(lltok::kw_addrspace))
1198 return ParseToken(lltok::lparen, "expected '(' in address space") ||
1200 ParseToken(lltok::rparen, "expected ')' in address space");
1210 lltok::Kind Token = Lex.getKind();
1214 case lltok::kw_align: {
1221 case lltok::kw_byval: B.addAttribute(Attribute::ByVal); break;
1222 case lltok::kw_dereferenceable: {
1224 if (ParseOptionalDerefAttrBytes(lltok::kw_dereferenceable, Bytes))
1229 case lltok::kw_dereferenceable_or_null: {
1231 if (ParseOptionalDerefAttrBytes(lltok::kw_dereferenceable_or_null, Bytes))
1236 case lltok::kw_inalloca: B.addAttribute(Attribute::InAlloca); break;
1237 case lltok::kw_inreg: B.addAttribute(Attribute::InReg); break;
1238 case lltok::kw_nest: B.addAttribute(Attribute::Nest); break;
1239 case lltok::kw_noalias: B.addAttribute(Attribute::NoAlias); break;
1240 case lltok::kw_nocapture: B.addAttribute(Attribute::NoCapture); break;
1241 case lltok::kw_nonnull: B.addAttribute(Attribute::NonNull); break;
1242 case lltok::kw_readnone: B.addAttribute(Attribute::ReadNone); break;
1243 case lltok::kw_readonly: B.addAttribute(Attribute::ReadOnly); break;
1244 case lltok::kw_returned: B.addAttribute(Attribute::Returned); break;
1245 case lltok::kw_signext: B.addAttribute(Attribute::SExt); break;
1246 case lltok::kw_sret: B.addAttribute(Attribute::StructRet); break;
1247 case lltok::kw_zeroext: B.addAttribute(Attribute::ZExt); break;
1249 case lltok::kw_alignstack:
1250 case lltok::kw_alwaysinline:
1251 case lltok::kw_builtin:
1252 case lltok::kw_inlinehint:
1253 case lltok::kw_jumptable:
1254 case lltok::kw_minsize:
1255 case lltok::kw_naked:
1256 case lltok::kw_nobuiltin:
1257 case lltok::kw_noduplicate:
1258 case lltok::kw_noimplicitfloat:
1259 case lltok::kw_noinline:
1260 case lltok::kw_nonlazybind:
1261 case lltok::kw_noredzone:
1262 case lltok::kw_noreturn:
1263 case lltok::kw_nounwind:
1264 case lltok::kw_optnone:
1265 case lltok::kw_optsize:
1266 case lltok::kw_returns_twice:
1267 case lltok::kw_sanitize_address:
1268 case lltok::kw_sanitize_memory:
1269 case lltok::kw_sanitize_thread:
1270 case lltok::kw_ssp:
1271 case lltok::kw_sspreq:
1272 case lltok::kw_sspstrong:
1273 case lltok::kw_uwtable:
1289 lltok::Kind Token = Lex.getKind();
1293 case lltok::kw_dereferenceable: {
1295 if (ParseOptionalDerefAttrBytes(lltok::kw_dereferenceable, Bytes))
1300 case lltok::kw_dereferenceable_or_null: {
1302 if (ParseOptionalDerefAttrBytes(lltok::kw_dereferenceable_or_null, Bytes))
1307 case lltok::kw_inreg: B.addAttribute(Attribute::InReg); break;
1308 case lltok::kw_noalias: B.addAttribute(Attribute::NoAlias); break;
1309 case lltok::kw_nonnull: B.addAttribute(Attribute::NonNull); break;
1310 case lltok::kw_signext: B.addAttribute(Attribute::SExt); break;
1311 case lltok::kw_zeroext: B.addAttribute(Attribute::ZExt); break;
1314 case lltok::kw_align:
1315 case lltok::kw_byval:
1316 case lltok::kw_inalloca:
1317 case lltok::kw_nest:
1318 case lltok::kw_nocapture:
1319 case lltok::kw_returned:
1320 case lltok::kw_sret:
1324 case lltok::kw_alignstack:
1325 case lltok::kw_alwaysinline:
1326 case lltok::kw_builtin:
1327 case lltok::kw_cold:
1328 case lltok::kw_inlinehint:
1329 case lltok::kw_jumptable:
1330 case lltok::kw_minsize:
1331 case lltok::kw_naked:
1332 case lltok::kw_nobuiltin:
1333 case lltok::kw_noduplicate:
1334 case lltok::kw_noimplicitfloat:
1335 case lltok::kw_noinline:
1336 case lltok::kw_nonlazybind:
1337 case lltok::kw_noredzone:
1338 case lltok::kw_noreturn:
1339 case lltok::kw_nounwind:
1340 case lltok::kw_optnone:
1341 case lltok::kw_optsize:
1342 case lltok::kw_returns_twice:
1343 case lltok::kw_sanitize_address:
1344 case lltok::kw_sanitize_memory:
1345 case lltok::kw_sanitize_thread:
1346 case lltok::kw_ssp:
1347 case lltok::kw_sspreq:
1348 case lltok::kw_sspstrong:
1349 case lltok::kw_uwtable:
1353 case lltok::kw_readnone:
1354 case lltok::kw_readonly:
1379 case lltok::kw_private: Res = GlobalValue::PrivateLinkage; break;
1380 case lltok::kw_internal: Res = GlobalValue::InternalLinkage; break;
1381 case lltok::kw_weak: Res = GlobalValue::WeakAnyLinkage; break;
1382 case lltok::kw_weak_odr: Res = GlobalValue::WeakODRLinkage; break;
1383 case lltok::kw_linkonce: Res = GlobalValue::LinkOnceAnyLinkage; break;
1384 case lltok::kw_linkonce_odr: Res = GlobalValue::LinkOnceODRLinkage; break;
1385 case lltok::kw_available_externally:
1388 case lltok::kw_appending: Res = GlobalValue::AppendingLinkage; break;
1389 case lltok::kw_common: Res = GlobalValue::CommonLinkage; break;
1390 case lltok::kw_extern_weak: Res = GlobalValue::ExternalWeakLinkage; break;
1391 case lltok::kw_external: Res = GlobalValue::ExternalLinkage; break;
1407 case lltok::kw_default: Res = GlobalValue::DefaultVisibility; break;
1408 case lltok::kw_hidden: Res = GlobalValue::HiddenVisibility; break;
1409 case lltok::kw_protected: Res = GlobalValue::ProtectedVisibility; break;
1423 case lltok::kw_dllimport: Res = GlobalValue::DLLImportStorageClass; break;
1424 case lltok::kw_dllexport: Res = GlobalValue::DLLExportStorageClass; break;
1460 case lltok::kw_ccc: CC = CallingConv::C; break;
1461 case lltok::kw_fastcc: CC = CallingConv::Fast; break;
1462 case lltok::kw_coldcc: CC = CallingConv::Cold; break;
1463 case lltok::kw_x86_stdcallcc: CC = CallingConv::X86_StdCall; break;
1464 case lltok::kw_x86_fastcallcc: CC = CallingConv::X86_FastCall; break;
1465 case lltok::kw_x86_thiscallcc: CC = CallingConv::X86_ThisCall; break;
1466 case lltok::kw_x86_vectorcallcc:CC = CallingConv::X86_VectorCall; break;
1467 case lltok::kw_arm_apcscc: CC = CallingConv::ARM_APCS; break;
1468 case lltok::kw_arm_aapcscc: CC = CallingConv::ARM_AAPCS; break;
1469 case lltok::kw_arm_aapcs_vfpcc:CC = CallingConv::ARM_AAPCS_VFP; break;
1470 case lltok::kw_msp430_intrcc: CC = CallingConv::MSP430_INTR; break;
1471 case lltok::kw_ptx_kernel: CC = CallingConv::PTX_Kernel; break;
1472 case lltok::kw_ptx_device: CC = CallingConv::PTX_Device; break;
1473 case lltok::kw_spir_kernel: CC = CallingConv::SPIR_KERNEL; break;
1474 case lltok::kw_spir_func: CC = CallingConv::SPIR_FUNC; break;
1475 case lltok::kw_intel_ocl_bicc: CC = CallingConv::Intel_OCL_BI; break;
1476 case lltok::kw_x86_64_sysvcc: CC = CallingConv::X86_64_SysV; break;
1477 case lltok::kw_x86_64_win64cc: CC = CallingConv::X86_64_Win64; break;
1478 case lltok::kw_webkit_jscc: CC = CallingConv::WebKit_JS; break;
1479 case lltok::kw_anyregcc: CC = CallingConv::AnyReg; break;
1480 case lltok::kw_preserve_mostcc:CC = CallingConv::PreserveMost; break;
1481 case lltok::kw_preserve_allcc: CC = CallingConv::PreserveAll; break;
1482 case lltok::kw_ghccc: CC = CallingConv::GHC; break;
1483 case lltok::kw_cc: {
1498 if (Lex.getKind() != lltok::MetadataVar)
1514 } while (EatIfPresent(lltok::comma));
1523 if (!EatIfPresent(lltok::kw_align))
1539 bool LLParser::ParseOptionalDerefAttrBytes(lltok::Kind AttrKind,
1541 assert((AttrKind == lltok::kw_dereferenceable ||
1542 AttrKind == lltok::kw_dereferenceable_or_null) &&
1549 if (!EatIfPresent(lltok::lparen))
1554 if (!EatIfPresent(lltok::rparen))
1570 while (EatIfPresent(lltok::comma)) {
1572 if (Lex.getKind() == lltok::MetadataVar) {
1577 if (Lex.getKind() != lltok::kw_align)
1597 if (EatIfPresent(lltok::kw_singlethread))
1610 case lltok::kw_unordered: Ordering = Unordered; break;
1611 case lltok::kw_monotonic: Ordering = Monotonic; break;
1612 case lltok::kw_acquire: Ordering = Acquire; break;
1613 case lltok::kw_release: Ordering = Release; break;
1614 case lltok::kw_acq_rel: Ordering = AcquireRelease; break;
1615 case lltok::kw_seq_cst: Ordering = SequentiallyConsistent; break;
1626 if (!EatIfPresent(lltok::kw_alignstack))
1629 if (!EatIfPresent(lltok::lparen))
1634 if (!EatIfPresent(lltok::rparen))
1654 if (Lex.getKind() != lltok::comma)
1657 while (EatIfPresent(lltok::comma)) {
1658 if (Lex.getKind() == lltok::MetadataVar) {
1681 case lltok::Type:
1686 case lltok::lbrace:
1691 case lltok::lsquare:
1697 case lltok::less: // Either vector or packed struct.
1700 if (Lex.getKind() == lltok::lbrace) {
1702 ParseToken(lltok::greater, "expected '>' at end of packed struct"))
1707 case lltok::LocalVar: {
1722 case lltok::LocalVarID: {
1748 case lltok::star:
1760 case lltok::kw_addrspace: {
1769 ParseToken(lltok::star, "expected '*' in address space"))
1777 case lltok::lparen:
1793 if (ParseToken(lltok::lparen, "expected '(' in call"))
1797 while (Lex.getKind() != lltok::rparen) {
1800 ParseToken(lltok::comma, "expected ',' in argument list"))
1804 if (Lex.getKind() == lltok::dotdotdot) {
1811 return ParseToken(lltok::rparen, "expected ')' at end of argument list");
1857 assert(Lex.getKind() == lltok::lparen);
1860 if (Lex.getKind() == lltok::rparen) {
1862 } else if (Lex.getKind() == lltok::dotdotdot) {
1877 if (Lex.getKind() == lltok::LocalVar) {
1890 while (EatIfPresent(lltok::comma)) {
1892 if (EatIfPresent(lltok::dotdotdot)) {
1904 if (Lex.getKind() == lltok::LocalVar) {
1921 return ParseToken(lltok::rparen, "expected ')' at end of argument list");
1927 assert(Lex.getKind() == lltok::lparen);
1974 if (EatIfPresent(lltok::kw_opaque)) {
1986 bool isPacked = EatIfPresent(lltok::less);
1991 if (Lex.getKind() != lltok::lbrace) {
2012 (isPacked && ParseToken(lltok::greater, "expected '>' in packed struct")))
2028 assert(Lex.getKind() == lltok::lbrace);
2032 if (EatIfPresent(lltok::rbrace))
2043 while (EatIfPresent(lltok::comma)) {
2053 return ParseToken(lltok::rbrace, "expected '}' at end of struct");
2062 if (Lex.getKind() != lltok::APSInt || Lex.getAPSIntVal().isSigned() ||
2070 if (ParseToken(lltok::kw_x, "expected 'x' after element count"))
2077 if (ParseToken(isVector ? lltok::greater : lltok::rsquare,
2346 case lltok::GlobalID: // @42
2350 case lltok::GlobalVar: // @foo
2354 case lltok::LocalVarID: // %42
2358 case lltok::LocalVar: // %foo
2362 case lltok::APSInt:
2366 case lltok::APFloat:
2370 case lltok::kw_true:
2374 case lltok::kw_false:
2378 case lltok::kw_null: ID.Kind = ValID::t_Null; break;
2379 case lltok::kw_undef: ID.Kind = ValID::t_Undef; break;
2380 case lltok::kw_zeroinitializer: ID.Kind = ValID::t_Zero; break;
2382 case lltok::lbrace: {
2387 ParseToken(lltok::rbrace, "expected end of struct constant"))
2396 case lltok::less: {
2400 bool isPackedStruct = EatIfPresent(lltok::lbrace);
2406 ParseToken(lltok::rbrace, "expected end of packed struct")) ||
2407 ParseToken(lltok::greater, "expected end of constant"))
2438 case lltok::lsquare: { // Array Constant
2443 ParseToken(lltok::rsquare, "expected end of array constant"))
2472 case lltok::kw_c: // c "foo"
2476 if (ParseToken(lltok::StringConstant, "expected string")) return true;
2480 case lltok::kw_asm: {
2485 if (ParseOptionalToken(lltok::kw_sideeffect, HasSideEffect) ||
2486 ParseOptionalToken(lltok::kw_alignstack, AlignStack) ||
2487 ParseOptionalToken(lltok::kw_inteldialect, AsmDialect) ||
2489 ParseToken(lltok::comma, "expected comma in inline asm expression") ||
2490 ParseToken(lltok::StringConstant, "expected constraint string"))
2499 case lltok::kw_blockaddress: {
2505 if (ParseToken(lltok::lparen, "expected '(' in block address expression") ||
2507 ParseToken(lltok::comma, "expected comma in block address expression")||
2509 ParseToken(lltok::rparen, "expected ')' in block address expression"))
2576 case lltok::kw_trunc:
2577 case lltok::kw_zext:
2578 case lltok::kw_sext:
2579 case lltok::kw_fptrunc:
2580 case lltok::kw_fpext:
2581 case lltok::kw_bitcast:
2582 case lltok::kw_addrspacecast:
2583 case lltok::kw_uitofp:
2584 case lltok::kw_sitofp:
2585 case lltok::kw_fptoui:
2586 case lltok::kw_fptosi:
2587 case lltok::kw_inttoptr:
2588 case lltok::kw_ptrtoint: {
2593 if (ParseToken(lltok::lparen, "expected '(' after constantexpr cast") ||
2595 ParseToken(lltok::kw_to, "expected 'to' in constantexpr cast") ||
2597 ParseToken(lltok::rparen, "expected ')' at end of constantexpr cast"))
2608 case lltok::kw_extractvalue: {
2612 if (ParseToken(lltok::lparen, "expected '(' in extractvalue constantexpr")||
2615 ParseToken(lltok::rparen, "expected ')' in extractvalue constantexpr"))
2626 case lltok::kw_insertvalue: {
2630 if (ParseToken(lltok::lparen, "expected '(' in insertvalue constantexpr")||
2632 ParseToken(lltok::comma, "expected comma in insertvalue constantexpr")||
2635 ParseToken(lltok::rparen, "expected ')' in insertvalue constantexpr"))
2652 case lltok::kw_icmp:
2653 case lltok::kw_fcmp: {
2658 ParseToken(lltok::lparen, "expected '(' in compare constantexpr") ||
2660 ParseToken(lltok::comma, "expected comma in compare constantexpr") ||
2662 ParseToken(lltok::rparen, "expected ')' in compare constantexpr"))
2686 case lltok::kw_add:
2687 case lltok::kw_fadd:
2688 case lltok::kw_sub:
2689 case lltok::kw_fsub:
2690 case lltok::kw_mul:
2691 case lltok::kw_fmul:
2692 case lltok::kw_udiv:
2693 case lltok::kw_sdiv:
2694 case lltok::kw_fdiv:
2695 case lltok::kw_urem:
2696 case lltok::kw_srem:
2697 case lltok::kw_frem:
2698 case lltok::kw_shl:
2699 case lltok::kw_lshr:
2700 case lltok::kw_ashr: {
2710 if (EatIfPresent(lltok::kw_nuw))
2712 if (EatIfPresent(lltok::kw_nsw)) {
2714 if (EatIfPresent(lltok::kw_nuw))
2719 if (EatIfPresent(lltok::kw_exact))
2722 if (ParseToken(lltok::lparen, "expected '(' in binary constantexpr") ||
2724 ParseToken(lltok::comma, "expected comma in binary constantexpr") ||
2726 ParseToken(lltok::rparen, "expected ')' in binary constantexpr"))
2772 case lltok::kw_and:
2773 case lltok::kw_or:
2774 case lltok::kw_xor: {
2778 if (ParseToken(lltok::lparen, "expected '(' in logical constantexpr") ||
2780 ParseToken(lltok::comma, "expected comma in logical constantexpr") ||
2782 ParseToken(lltok::rparen, "expected ')' in logical constantexpr"))
2794 case lltok::kw_getelementptr:
2795 case lltok::kw_shufflevector:
2796 case lltok::kw_insertelement:
2797 case lltok::kw_extractelement:
2798 case lltok::kw_select: {
2806 InBounds = EatIfPresent(lltok::kw_inbounds);
2808 if (ParseToken(lltok::lparen, "expected '(' in constantexpr"))
2814 ParseToken(lltok::comma, "expected comma after getelementptr's type"))
2819 ParseToken(lltok::rparen, "expected ')' in constantexpr"))
2921 if (!EatIfPresent(lltok::kw_comdat))
2924 if (EatIfPresent(lltok::lparen)) {
2925 if (Lex.getKind() != lltok::ComdatVar)
2929 if (ParseToken(lltok::rparen, "expected ')' after comdat var"))
2945 if (Lex.getKind() == lltok::rbrace ||
2946 Lex.getKind() == lltok::rsquare ||
2947 Lex.getKind() == lltok::greater ||
2948 Lex.getKind() == lltok::rparen)
2955 while (EatIfPresent(lltok::comma)) {
2977 if (Lex.getKind() == lltok::MetadataVar)
2980 return ParseToken(lltok::exclaim, "expected '!' here") ||
2986 if (Lex.getKind() == lltok::lbrace)
3078 if (Lex.getKind() != lltok::APSInt || Lex.getAPSIntVal().isSigned())
3102 if (Lex.getKind() == lltok::APSInt)
3105 if (Lex.getKind() != lltok::DwarfTag)
3121 if (Lex.getKind() == lltok::APSInt)
3124 if (Lex.getKind() != lltok::DwarfVirtuality)
3139 if (Lex.getKind() == lltok::APSInt)
3142 if (Lex.getKind() != lltok::DwarfLang)
3158 if (Lex.getKind() == lltok::APSInt)
3161 if (Lex.getKind() != lltok::DwarfAttEncoding)
3184 if (Lex.getKind() == lltok::APSInt && !Lex.getAPSIntVal().isSigned())
3187 if (Lex.getKind() != lltok::DIFlag)
3205 } while (EatIfPresent(lltok::bar));
3214 if (Lex.getKind() != lltok::APSInt)
3236 case lltok::kw_true:
3239 case lltok::kw_false:
3249 if (Lex.getKind() == lltok::kw_null) {
3304 if (Lex.getKind() != lltok::LabelStr)
3309 } while (EatIfPresent(lltok::comma));
3316 assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
3319 if (ParseToken(lltok::lparen, "expected '(' here"))
3321 if (Lex.getKind() != lltok::rparen)
3326 return ParseToken(lltok::rparen, "expected ')' here");
3340 assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
3728 assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
3731 if (ParseToken(lltok::lparen, "expected '(' here"))
3735 if (Lex.getKind() != lltok::rparen)
3737 if (Lex.getKind() == lltok::DwarfOp) {
3746 if (Lex.getKind() != lltok::APSInt || Lex.getAPSIntVal().isSigned())
3754 } while (EatIfPresent(lltok::comma));
3756 if (ParseToken(lltok::rparen, "expected ')' here"))
3854 if (Lex.getKind() == lltok::MetadataVar) {
3864 if (Lex.getKind() != lltok::exclaim)
3868 assert(Lex.getKind() == lltok::exclaim && "Expected '!' here");
3873 if (Lex.getKind() == lltok::StringConstant) {
4088 if (Lex.getKind() == lltok::GlobalVar) {
4090 } else if (Lex.getKind() == lltok::GlobalID) { // @42 is ok.
4102 if (Lex.getKind() != lltok::lparen)
4120 ParseOptionalToken(lltok::kw_unnamed_addr, UnnamedAddr,
4124 (EatIfPresent(lltok::kw_section) &&
4128 (EatIfPresent(lltok::kw_gc) &&
4130 (EatIfPresent(lltok::kw_prefix) &&
4132 (EatIfPresent(lltok::kw_prologue) &&
4309 if (Lex.getKind() != lltok::lbrace)
4325 if (Lex.getKind() == lltok::rbrace || Lex.getKind() == lltok::kw_uselistorder)
4328 while (Lex.getKind() != lltok::rbrace &&
4329 Lex.getKind() != lltok::kw_uselistorder)
4332 while (Lex.getKind() != lltok::rbrace)
4349 if (Lex.getKind() == lltok::LabelStr) {
4370 if (Lex.getKind() == lltok::LocalVarID) {
4373 if (ParseToken(lltok::equal, "expected '=' after instruction id"))
4375 } else if (Lex.getKind() == lltok::LocalVar) {
4378 if (ParseToken(lltok::equal, "expected '=' after instruction name"))
4390 if (EatIfPresent(lltok::comma))
4419 lltok::Kind Token = Lex.getKind();
4420 if (Token == lltok::Eof)
4429 case lltok::kw_unreachable: Inst = new UnreachableInst(Context); return false;
4430 case lltok::kw_ret: return ParseRet(Inst, BB, PFS);
4431 case lltok::kw_br: return ParseBr(Inst, PFS);
4432 case lltok::kw_switch: return ParseSwitch(Inst, PFS);
4433 case lltok::kw_indirectbr: return ParseIndirectBr(Inst, PFS);
4434 case lltok::kw_invoke: return ParseInvoke(Inst, PFS);
4435 case lltok::kw_resume: return ParseResume(Inst, PFS);
4437 case lltok::kw_add:
4438 case lltok::kw_sub:
4439 case lltok::kw_mul:
4440 case lltok::kw_shl: {
4441 bool NUW = EatIfPresent(lltok::kw_nuw);
4442 bool NSW = EatIfPresent(lltok::kw_nsw);
4443 if (!NUW) NUW = EatIfPresent(lltok::kw_nuw);
4451 case lltok::kw_fadd:
4452 case lltok::kw_fsub:
4453 case lltok::kw_fmul:
4454 case lltok::kw_fdiv:
4455 case lltok::kw_frem: {
4465 case lltok::kw_sdiv:
4466 case lltok::kw_udiv:
4467 case lltok::kw_lshr:
4468 case lltok::kw_ashr: {
4469 bool Exact = EatIfPresent(lltok::kw_exact);
4476 case lltok::kw_urem:
4477 case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1);
4478 case lltok::kw_and:
4479 case lltok::kw_or:
4480 case lltok::kw_xor: return ParseLogical(Inst, PFS, KeywordVal);
4481 case lltok::kw_icmp:
4482 case lltok::kw_fcmp: return ParseCompare(Inst, PFS, KeywordVal);
4484 case lltok::kw_trunc:
4485 case lltok::kw_zext:
4486 case lltok::kw_sext:
4487 case lltok::kw_fptrunc:
4488 case lltok::kw_fpext:
4489 case lltok::kw_bitcast:
4490 case lltok::kw_addrspacecast:
4491 case lltok::kw_uitofp:
4492 case lltok::kw_sitofp:
4493 case lltok::kw_fptoui:
4494 case lltok::kw_fptosi:
4495 case lltok::kw_inttoptr:
4496 case lltok::kw_ptrtoint: return ParseCast(Inst, PFS, KeywordVal);
4498 case lltok::kw_select: return ParseSelect(Inst, PFS);
4499 case lltok::kw_va_arg: return ParseVA_Arg(Inst, PFS);
4500 case lltok::kw_extractelement: return ParseExtractElement(Inst, PFS);
4501 case lltok::kw_insertelement: return ParseInsertElement(Inst, PFS);
4502 case lltok::kw_shufflevector: return ParseShuffleVector(Inst, PFS);
4503 case lltok::kw_phi: return ParsePHI(Inst, PFS);
4504 case lltok::kw_landingpad: return ParseLandingPad(Inst, PFS);
4506 case lltok::kw_call: return ParseCall(Inst, PFS, CallInst::TCK_None);
4507 case lltok::kw_tail: return ParseCall(Inst, PFS, CallInst::TCK_Tail);
4508 case lltok::kw_musttail: return ParseCall(Inst, PFS, CallInst::TCK_MustTail);
4510 case lltok::kw_alloca: return ParseAlloc(Inst, PFS);
4511 case lltok::kw_load: return ParseLoad(Inst, PFS);
4512 case lltok::kw_store: return ParseStore(Inst, PFS);
4513 case lltok::kw_cmpxchg: return ParseCmpXchg(Inst, PFS);
4514 case lltok::kw_atomicrmw: return ParseAtomicRMW(Inst, PFS);
4515 case lltok::kw_fence: return ParseFence(Inst, PFS);
4516 case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
4517 case lltok::kw_extractvalue: return ParseExtractValue(Inst, PFS);
4518 case lltok::kw_insertvalue: return ParseInsertValue(Inst, PFS);
4527 case lltok::kw_oeq: P = CmpInst::FCMP_OEQ; break;
4528 case lltok::kw_one: P = CmpInst::FCMP_ONE; break;
4529 case lltok::kw_olt: P = CmpInst::FCMP_OLT; break;
4530 case lltok::kw_ogt: P = CmpInst::FCMP_OGT; break;
4531 case lltok::kw_ole: P = CmpInst::FCMP_OLE; break;
4532 case lltok::kw_oge: P = CmpInst::FCMP_OGE; break;
4533 case lltok::kw_ord: P = CmpInst::FCMP_ORD; break;
4534 case lltok::kw_uno: P = CmpInst::FCMP_UNO; break;
4535 case lltok::kw_ueq: P = CmpInst::FCMP_UEQ; break;
4536 case lltok::kw_une: P = CmpInst::FCMP_UNE; break;
4537 case lltok::kw_ult: P = CmpInst::FCMP_ULT; break;
4538 case lltok::kw_ugt: P = CmpInst::FCMP_UGT; break;
4539 case lltok::kw_ule: P = CmpInst::FCMP_ULE; break;
4540 case lltok::kw_uge: P = CmpInst::FCMP_UGE; break;
4541 case lltok::kw_true: P = CmpInst::FCMP_TRUE; break;
4542 case lltok::kw_false: P = CmpInst::FCMP_FALSE; break;
4547 case lltok::kw_eq: P = CmpInst::ICMP_EQ; break;
4548 case lltok::kw_ne: P = CmpInst::ICMP_NE; break;
4549 case lltok::kw_slt: P = CmpInst::ICMP_SLT; break;
4550 case lltok::kw_sgt: P = CmpInst::ICMP_SGT; break;
4551 case lltok::kw_sle: P = CmpInst::ICMP_SLE; break;
4552 case lltok::kw_sge: P = CmpInst::ICMP_SGE; break;
4553 case lltok::kw_ult: P = CmpInst::ICMP_ULT; break;
4554 case lltok::kw_ugt: P = CmpInst::ICMP_UGT; break;
4555 case lltok::kw_ule: P = CmpInst::ICMP_ULE; break;
4556 case lltok::kw_uge: P = CmpInst::ICMP_UGE; break;
4616 if (ParseToken(lltok::comma, "expected ',' after branch condition") ||
4618 ParseToken(lltok::comma, "expected ',' after true destination") ||
4636 ParseToken(lltok::comma, "expected ',' after switch condition") ||
4638 ParseToken(lltok::lsquare, "expected '[' with switch table"))
4647 while (Lex.getKind() != lltok::rsquare) {
4652 ParseToken(lltok::comma, "expected ',' after case value") ||
4680 ParseToken(lltok::comma, "expected ',' after indirectbr address") ||
4681 ParseToken(lltok::lsquare, "expected '[' with indirectbr"))
4690 if (Lex.getKind() != lltok::rsquare) {
4696 while (EatIfPresent(lltok::comma)) {
4703 if (ParseToken(lltok::rsquare, "expected ']' at end of block list"))
4736 ParseToken(lltok::kw_to, "expected 'to' in invoke") ||
4738 ParseToken(lltok::kw_unwind, "expected 'unwind' in invoke") ||
4844 ParseToken(lltok::comma, "expected ',' in arithmetic operation") ||
4872 ParseToken(lltok::comma, "expected ',' in logical operation") ||
4895 ParseToken(lltok::comma, "expected ',' after compare value") ||
4926 ParseToken(lltok::kw_to, "expected 'to' after cast value") ||
4946 ParseToken(lltok::comma, "expected ',' after select condition") ||
4948 ParseToken(lltok::comma, "expected ',' after select value") ||
4966 ParseToken(lltok::comma, "expected ',' after vaarg operand") ||
4983 ParseToken(lltok::comma, "expected ',' after extract value") ||
5000 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
5002 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
5019 ParseToken(lltok::comma, "expected ',' after shuffle mask") ||
5021 ParseToken(lltok::comma, "expected ',' after shuffle value") ||
5039 ParseToken(lltok::lsquare, "expected '[' in phi value list") ||
5041 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
5043 ParseToken(lltok::rsquare, "expected ']' in phi value list"))
5051 if (!EatIfPresent(lltok::comma))
5054 if (Lex.getKind() == lltok::MetadataVar) {
5059 lltok::lsquare, "expected '[' in phi value list") ||
5061 ParseToken(lltok::comma, "expected ',' after insertelement value") ||
5063 ParseToken(lltok::rsquare, "expected ']' in phi value list"))
5088 ParseToken(lltok::kw_personality, "expected 'personality'") ||
5093 LP->setCleanup(EatIfPresent(lltok::kw_cleanup));
5095 while (Lex.getKind() == lltok::kw_catch || Lex.getKind() == lltok::kw_filter){
5097 if (EatIfPresent(lltok::kw_catch))
5099 else if (EatIfPresent(lltok::kw_filter))
5149 ParseToken(lltok::kw_call, "expected 'tail call'")) ||
5248 bool IsInAlloca = EatIfPresent(lltok::kw_inalloca);
5256 if (EatIfPresent(lltok::comma)) {
5257 if (Lex.getKind() == lltok::kw_align) {
5259 } else if (Lex.getKind() == lltok::MetadataVar) {
5289 if (Lex.getKind() == lltok::kw_atomic) {
5295 if (Lex.getKind() == lltok::kw_volatile) {
5303 ParseToken(lltok::comma, "expected comma after load's type") ||
5337 if (Lex.getKind() == lltok::kw_atomic) {
5343 if (Lex.getKind() == lltok::kw_volatile) {
5349 ParseToken(lltok::comma, "expected ',' after store operand") ||
5382 if (EatIfPresent(lltok::kw_weak))
5385 if (EatIfPresent(lltok::kw_volatile))
5389 ParseToken(lltok::comma, "expected ',' after cmpxchg address") ||
5391 ParseToken(lltok::comma, "expected ',' after cmpxchg cmp operand") ||
5435 if (EatIfPresent(lltok::kw_volatile))
5440 case lltok::kw_xchg: Operation = AtomicRMWInst::Xchg; break;
5441 case lltok::kw_add: Operation = AtomicRMWInst::Add; break;
5442 case lltok::kw_sub: Operation = AtomicRMWInst::Sub; break;
5443 case lltok::kw_and: Operation = AtomicRMWInst::And; break;
5444 case lltok::kw_nand: Operation = AtomicRMWInst::Nand; break;
5445 case lltok::kw_or: Operation = AtomicRMWInst::Or; break;
5446 case lltok::kw_xor: Operation = AtomicRMWInst::Xor; break;
5447 case lltok::kw_max: Operation = AtomicRMWInst::Max; break;
5448 case lltok::kw_min: Operation = AtomicRMWInst::Min; break;
5449 case lltok::kw_umax: Operation = AtomicRMWInst::UMax; break;
5450 case lltok::kw_umin: Operation = AtomicRMWInst::UMin; break;
5455 ParseToken(lltok::comma, "expected ',' after atomicrmw address") ||
5504 bool InBounds = EatIfPresent(lltok::kw_inbounds);
5509 ParseToken(lltok::comma, "expected comma after getelementptr's type") ||
5524 while (EatIfPresent(lltok::comma)) {
5525 if (Lex.getKind() == lltok::MetadataVar) {
5585 ParseToken(lltok::comma, "expected comma after insertvalue operand") ||
5613 if (ParseToken(lltok::lbrace, "expected '{' here"))
5617 if (EatIfPresent(lltok::rbrace))
5622 if (EatIfPresent(lltok::kw_null)) {
5631 } while (EatIfPresent(lltok::comma));
5633 return ParseToken(lltok::rbrace, "expected end of metadata node");
5667 if (ParseToken(lltok::lbrace, "expected '{' here"))
5669 if (Lex.getKind() == lltok::rbrace)
5690 } while (EatIfPresent(lltok::comma));
5692 if (ParseToken(lltok::rbrace, "expected '}' here"))
5709 if (ParseToken(lltok::kw_uselistorder, "expected uselistorder directive"))
5715 ParseToken(lltok::comma, "expected comma in uselistorder directive") ||
5725 assert(Lex.getKind() == lltok::kw_uselistorder_bb);
5732 ParseToken(lltok::comma, "expected comma in uselistorder_bb directive") ||
5734 ParseToken(lltok::comma, "expected comma in uselistorder_bb directive") ||