LLParser.cpp (193323) | LLParser.cpp (193574) |
---|---|
1//===-- LLParser.cpp - Parser Class ---------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 698 unchanged lines hidden (view full) --- 707 default: // End of attributes. 708 if (AttrKind != 2 && (Attrs & Attribute::FunctionOnly)) 709 return Error(AttrLoc, "invalid use of function-only attribute"); 710 711 if (AttrKind != 0 && AttrKind != 3 && (Attrs & Attribute::ParameterOnly)) 712 return Error(AttrLoc, "invalid use of parameter-only attribute"); 713 714 return false; | 1//===-- LLParser.cpp - Parser Class ---------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 698 unchanged lines hidden (view full) --- 707 default: // End of attributes. 708 if (AttrKind != 2 && (Attrs & Attribute::FunctionOnly)) 709 return Error(AttrLoc, "invalid use of function-only attribute"); 710 711 if (AttrKind != 0 && AttrKind != 3 && (Attrs & Attribute::ParameterOnly)) 712 return Error(AttrLoc, "invalid use of parameter-only attribute"); 713 714 return false; |
715 case lltok::kw_zeroext: Attrs |= Attribute::ZExt; break; 716 case lltok::kw_signext: Attrs |= Attribute::SExt; break; 717 case lltok::kw_inreg: Attrs |= Attribute::InReg; break; 718 case lltok::kw_sret: Attrs |= Attribute::StructRet; break; 719 case lltok::kw_noalias: Attrs |= Attribute::NoAlias; break; 720 case lltok::kw_nocapture: Attrs |= Attribute::NoCapture; break; 721 case lltok::kw_byval: Attrs |= Attribute::ByVal; break; 722 case lltok::kw_nest: Attrs |= Attribute::Nest; break; | 715 case lltok::kw_zeroext: Attrs |= Attribute::ZExt; break; 716 case lltok::kw_signext: Attrs |= Attribute::SExt; break; 717 case lltok::kw_inreg: Attrs |= Attribute::InReg; break; 718 case lltok::kw_sret: Attrs |= Attribute::StructRet; break; 719 case lltok::kw_noalias: Attrs |= Attribute::NoAlias; break; 720 case lltok::kw_nocapture: Attrs |= Attribute::NoCapture; break; 721 case lltok::kw_byval: Attrs |= Attribute::ByVal; break; 722 case lltok::kw_nest: Attrs |= Attribute::Nest; break; |
723 | 723 |
724 case lltok::kw_noreturn: Attrs |= Attribute::NoReturn; break; 725 case lltok::kw_nounwind: Attrs |= Attribute::NoUnwind; break; 726 case lltok::kw_noinline: Attrs |= Attribute::NoInline; break; 727 case lltok::kw_readnone: Attrs |= Attribute::ReadNone; break; 728 case lltok::kw_readonly: Attrs |= Attribute::ReadOnly; break; 729 case lltok::kw_alwaysinline: Attrs |= Attribute::AlwaysInline; break; 730 case lltok::kw_optsize: Attrs |= Attribute::OptimizeForSize; break; 731 case lltok::kw_ssp: Attrs |= Attribute::StackProtect; break; 732 case lltok::kw_sspreq: Attrs |= Attribute::StackProtectReq; break; 733 | 724 case lltok::kw_noreturn: Attrs |= Attribute::NoReturn; break; 725 case lltok::kw_nounwind: Attrs |= Attribute::NoUnwind; break; 726 case lltok::kw_noinline: Attrs |= Attribute::NoInline; break; 727 case lltok::kw_readnone: Attrs |= Attribute::ReadNone; break; 728 case lltok::kw_readonly: Attrs |= Attribute::ReadOnly; break; 729 case lltok::kw_alwaysinline: Attrs |= Attribute::AlwaysInline; break; 730 case lltok::kw_optsize: Attrs |= Attribute::OptimizeForSize; break; 731 case lltok::kw_ssp: Attrs |= Attribute::StackProtect; break; 732 case lltok::kw_sspreq: Attrs |= Attribute::StackProtectReq; break; 733 case lltok::kw_noredzone: Attrs |= Attribute::NoRedZone; break; 734 case lltok::kw_noimplicitfloat: Attrs |= Attribute::NoImplicitFloat; break; |
734 735 case lltok::kw_align: { 736 unsigned Alignment; 737 if (ParseOptionalAlignment(Alignment)) 738 return true; 739 Attrs |= Attribute::constructAlignmentFromInt(Alignment); 740 continue; 741 } --- 1088 unchanged lines hidden (view full) --- 1830 ID.ConstantVal = ConstantExpr::getVICmp(Pred, Val0, Val1); 1831 } 1832 ID.Kind = ValID::t_Constant; 1833 return false; 1834 } 1835 1836 // Binary Operators. 1837 case lltok::kw_add: | 735 736 case lltok::kw_align: { 737 unsigned Alignment; 738 if (ParseOptionalAlignment(Alignment)) 739 return true; 740 Attrs |= Attribute::constructAlignmentFromInt(Alignment); 741 continue; 742 } --- 1088 unchanged lines hidden (view full) --- 1831 ID.ConstantVal = ConstantExpr::getVICmp(Pred, Val0, Val1); 1832 } 1833 ID.Kind = ValID::t_Constant; 1834 return false; 1835 } 1836 1837 // Binary Operators. 1838 case lltok::kw_add: |
1839 case lltok::kw_fadd: |
|
1838 case lltok::kw_sub: | 1840 case lltok::kw_sub: |
1841 case lltok::kw_fsub: |
|
1839 case lltok::kw_mul: | 1842 case lltok::kw_mul: |
1843 case lltok::kw_fmul: |
|
1840 case lltok::kw_udiv: 1841 case lltok::kw_sdiv: 1842 case lltok::kw_fdiv: 1843 case lltok::kw_urem: 1844 case lltok::kw_srem: 1845 case lltok::kw_frem: { 1846 unsigned Opc = Lex.getUIntVal(); 1847 Constant *Val0, *Val1; --- 547 unchanged lines hidden (view full) --- 2395 case lltok::kw_unreachable: Inst = new UnreachableInst(); return false; 2396 case lltok::kw_ret: return ParseRet(Inst, BB, PFS); 2397 case lltok::kw_br: return ParseBr(Inst, PFS); 2398 case lltok::kw_switch: return ParseSwitch(Inst, PFS); 2399 case lltok::kw_invoke: return ParseInvoke(Inst, PFS); 2400 // Binary Operators. 2401 case lltok::kw_add: 2402 case lltok::kw_sub: | 1844 case lltok::kw_udiv: 1845 case lltok::kw_sdiv: 1846 case lltok::kw_fdiv: 1847 case lltok::kw_urem: 1848 case lltok::kw_srem: 1849 case lltok::kw_frem: { 1850 unsigned Opc = Lex.getUIntVal(); 1851 Constant *Val0, *Val1; --- 547 unchanged lines hidden (view full) --- 2399 case lltok::kw_unreachable: Inst = new UnreachableInst(); return false; 2400 case lltok::kw_ret: return ParseRet(Inst, BB, PFS); 2401 case lltok::kw_br: return ParseBr(Inst, PFS); 2402 case lltok::kw_switch: return ParseSwitch(Inst, PFS); 2403 case lltok::kw_invoke: return ParseInvoke(Inst, PFS); 2404 // Binary Operators. 2405 case lltok::kw_add: 2406 case lltok::kw_sub: |
2403 case lltok::kw_mul: return ParseArithmetic(Inst, PFS, KeywordVal, 0); 2404 | 2407 case lltok::kw_mul: 2408 // API compatibility: Accept either integer or floating-point types. 2409 return ParseArithmetic(Inst, PFS, KeywordVal, 0); 2410 case lltok::kw_fadd: 2411 case lltok::kw_fsub: 2412 case lltok::kw_fmul: return ParseArithmetic(Inst, PFS, KeywordVal, 2); 2413 |
2405 case lltok::kw_udiv: 2406 case lltok::kw_sdiv: 2407 case lltok::kw_urem: 2408 case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1); 2409 case lltok::kw_fdiv: 2410 case lltok::kw_frem: return ParseArithmetic(Inst, PFS, KeywordVal, 2); 2411 case lltok::kw_shl: 2412 case lltok::kw_lshr: --- 867 unchanged lines hidden --- | 2414 case lltok::kw_udiv: 2415 case lltok::kw_sdiv: 2416 case lltok::kw_urem: 2417 case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1); 2418 case lltok::kw_fdiv: 2419 case lltok::kw_frem: return ParseArithmetic(Inst, PFS, KeywordVal, 2); 2420 case lltok::kw_shl: 2421 case lltok::kw_lshr: --- 867 unchanged lines hidden --- |