Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/AsmParser/LLParser.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 3,478 Lines • ▼ Show 20 Lines | bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) { | ||||
case lltok::kw_udiv: | case lltok::kw_udiv: | ||||
return error(ID.Loc, "udiv constexprs are no longer supported"); | return error(ID.Loc, "udiv constexprs are no longer supported"); | ||||
case lltok::kw_sdiv: | case lltok::kw_sdiv: | ||||
return error(ID.Loc, "sdiv constexprs are no longer supported"); | return error(ID.Loc, "sdiv constexprs are no longer supported"); | ||||
case lltok::kw_urem: | case lltok::kw_urem: | ||||
return error(ID.Loc, "urem constexprs are no longer supported"); | return error(ID.Loc, "urem constexprs are no longer supported"); | ||||
case lltok::kw_srem: | case lltok::kw_srem: | ||||
return error(ID.Loc, "srem constexprs are no longer supported"); | return error(ID.Loc, "srem constexprs are no longer supported"); | ||||
case lltok::kw_fadd: | |||||
return error(ID.Loc, "fadd constexprs are no longer supported"); | |||||
case lltok::kw_fsub: | |||||
return error(ID.Loc, "fsub constexprs are no longer supported"); | |||||
case lltok::kw_fmul: | |||||
return error(ID.Loc, "fmul constexprs are no longer supported"); | |||||
case lltok::kw_fdiv: | |||||
return error(ID.Loc, "fdiv constexprs are no longer supported"); | |||||
case lltok::kw_frem: | |||||
return error(ID.Loc, "frem constexprs are no longer supported"); | |||||
case lltok::kw_icmp: | case lltok::kw_icmp: | ||||
case lltok::kw_fcmp: { | case lltok::kw_fcmp: { | ||||
unsigned PredVal, Opc = Lex.getUIntVal(); | unsigned PredVal, Opc = Lex.getUIntVal(); | ||||
Constant *Val0, *Val1; | Constant *Val0, *Val1; | ||||
Lex.Lex(); | Lex.Lex(); | ||||
if (parseCmpPredicate(PredVal, Opc) || | if (parseCmpPredicate(PredVal, Opc) || | ||||
parseToken(lltok::lparen, "expected '(' in compare constantexpr") || | parseToken(lltok::lparen, "expected '(' in compare constantexpr") || | ||||
parseGlobalTypeAndValue(Val0) || | parseGlobalTypeAndValue(Val0) || | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | case lltok::kw_fneg: { | ||||
unsigned Flags = 0; | unsigned Flags = 0; | ||||
Constant *C = ConstantExpr::get(Opc, Val, Flags); | Constant *C = ConstantExpr::get(Opc, Val, Flags); | ||||
ID.ConstantVal = C; | ID.ConstantVal = C; | ||||
ID.Kind = ValID::t_Constant; | ID.Kind = ValID::t_Constant; | ||||
return false; | return false; | ||||
} | } | ||||
// Binary Operators. | // Binary Operators. | ||||
case lltok::kw_add: | case lltok::kw_add: | ||||
case lltok::kw_fadd: | |||||
case lltok::kw_sub: | case lltok::kw_sub: | ||||
case lltok::kw_fsub: | |||||
case lltok::kw_mul: | case lltok::kw_mul: | ||||
case lltok::kw_fmul: | |||||
case lltok::kw_fdiv: | |||||
case lltok::kw_frem: | |||||
case lltok::kw_shl: | case lltok::kw_shl: | ||||
case lltok::kw_lshr: | case lltok::kw_lshr: | ||||
case lltok::kw_ashr: { | case lltok::kw_ashr: { | ||||
bool NUW = false; | bool NUW = false; | ||||
bool NSW = false; | bool NSW = false; | ||||
bool Exact = false; | bool Exact = false; | ||||
unsigned Opc = Lex.getUIntVal(); | unsigned Opc = Lex.getUIntVal(); | ||||
Constant *Val0, *Val1; | Constant *Val0, *Val1; | ||||
▲ Show 20 Lines • Show All 5,925 Lines • Show Last 20 Lines |