Lines Matching refs:PFS
198 PerFunctionState *PFS) {
202 if (PFS) {
204 Res = PFS->GetBB(Refs[i].first.StrVal, Refs[i].first.Loc);
206 Res = PFS->GetBB(Refs[i].first.UIntVal, Refs[i].first.Loc);
1546 PerFunctionState *PFS) {
1567 if (ParseMetadataListValue(ID, PFS))
1840 PerFunctionState &PFS) {
1860 if (ParseOptionalParamAttrs(ArgAttrs) || ParseValue(ArgTy, V, PFS))
2389 /// sanity. PFS is used to convert function-local operands of metadata (since
2391 /// PFS can be null when we are not parsing metadata values inside a function.
2392 bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
2413 return ParseMetadataValue(ID, PFS);
2909 bool LLParser::ParseMetadataListValue(ValID &ID, PerFunctionState *PFS) {
2914 if (ParseMDNodeVector(Elts, PFS) ||
2927 bool LLParser::ParseMetadataValue(ValID &ID, PerFunctionState *PFS) {
2934 return ParseMetadataListValue(ID, PFS);
2957 PerFunctionState *PFS) {
2963 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
2964 V = PFS->GetVal(ID.UIntVal, Ty, ID.Loc);
2967 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
2968 V = PFS->GetVal(ID.StrVal, Ty, ID.Loc);
3077 bool LLParser::ParseValue(Type *Ty, Value *&V, PerFunctionState *PFS) {
3080 return ParseValID(ID, PFS) ||
3081 ConvertValIDToValue(Ty, ID, V, PFS);
3084 bool LLParser::ParseTypeAndValue(Value *&V, PerFunctionState *PFS) {
3087 ParseValue(Ty, V, PFS);
3091 PerFunctionState &PFS) {
3094 if (ParseTypeAndValue(V, PFS)) return true;
3332 PerFunctionState PFS(*this, Fn, FunctionNumber);
3339 if (ParseBasicBlock(PFS)) return true;
3345 return PFS.FinishFunction();
3350 bool LLParser::ParseBasicBlock(PerFunctionState &PFS) {
3359 BasicBlock *BB = PFS.DefineBB(Name, NameLoc);
3385 switch (ParseInstruction(Inst, BB, PFS)) {
3394 if (ParseInstructionMetadata(Inst, &PFS))
3402 if (ParseInstructionMetadata(Inst, &PFS))
3408 if (PFS.SetInstName(NameID, NameStr, NameLoc, Inst)) return true;
3421 PerFunctionState &PFS) {
3433 case lltok::kw_ret: return ParseRet(Inst, BB, PFS);
3434 case lltok::kw_br: return ParseBr(Inst, PFS);
3435 case lltok::kw_switch: return ParseSwitch(Inst, PFS);
3436 case lltok::kw_indirectbr: return ParseIndirectBr(Inst, PFS);
3437 case lltok::kw_invoke: return ParseInvoke(Inst, PFS);
3438 case lltok::kw_resume: return ParseResume(Inst, PFS);
3448 if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true;
3460 int Res = ParseArithmetic(Inst, PFS, KeywordVal, 2);
3474 if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true;
3480 case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1);
3483 case lltok::kw_xor: return ParseLogical(Inst, PFS, KeywordVal);
3485 case lltok::kw_fcmp: return ParseCompare(Inst, PFS, KeywordVal);
3499 case lltok::kw_ptrtoint: return ParseCast(Inst, PFS, KeywordVal);
3501 case lltok::kw_select: return ParseSelect(Inst, PFS);
3502 case lltok::kw_va_arg: return ParseVA_Arg(Inst, PFS);
3503 case lltok::kw_extractelement: return ParseExtractElement(Inst, PFS);
3504 case lltok::kw_insertelement: return ParseInsertElement(Inst, PFS);
3505 case lltok::kw_shufflevector: return ParseShuffleVector(Inst, PFS);
3506 case lltok::kw_phi: return ParsePHI(Inst, PFS);
3507 case lltok::kw_landingpad: return ParseLandingPad(Inst, PFS);
3509 case lltok::kw_call: return ParseCall(Inst, PFS, CallInst::TCK_None);
3510 case lltok::kw_tail: return ParseCall(Inst, PFS, CallInst::TCK_Tail);
3511 case lltok::kw_musttail: return ParseCall(Inst, PFS, CallInst::TCK_MustTail);
3513 case lltok::kw_alloca: return ParseAlloc(Inst, PFS);
3514 case lltok::kw_load: return ParseLoad(Inst, PFS);
3515 case lltok::kw_store: return ParseStore(Inst, PFS);
3516 case lltok::kw_cmpxchg: return ParseCmpXchg(Inst, PFS);
3517 case lltok::kw_atomicrmw: return ParseAtomicRMW(Inst, PFS);
3518 case lltok::kw_fence: return ParseFence(Inst, PFS);
3519 case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
3520 case lltok::kw_extractvalue: return ParseExtractValue(Inst, PFS);
3521 case lltok::kw_insertvalue: return ParseInsertValue(Inst, PFS);
3574 PerFunctionState &PFS) {
3579 Type *ResType = PFS.getFunction().getReturnType();
3591 if (ParseValue(Ty, RV, PFS)) return true;
3605 bool LLParser::ParseBr(Instruction *&Inst, PerFunctionState &PFS) {
3609 if (ParseTypeAndValue(Op0, Loc, PFS)) return true;
3620 ParseTypeAndBasicBlock(Op1, Loc, PFS) ||
3622 ParseTypeAndBasicBlock(Op2, Loc2, PFS))
3634 bool LLParser::ParseSwitch(Instruction *&Inst, PerFunctionState &PFS) {
3638 if (ParseTypeAndValue(Cond, CondLoc, PFS) ||
3640 ParseTypeAndBasicBlock(DefaultBB, BBLoc, PFS) ||
3654 if (ParseTypeAndValue(Constant, CondLoc, PFS) ||
3656 ParseTypeAndBasicBlock(DestBB, PFS))
3679 bool LLParser::ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS) {
3682 if (ParseTypeAndValue(Address, AddrLoc, PFS) ||
3695 if (ParseTypeAndBasicBlock(DestBB, PFS))
3700 if (ParseTypeAndBasicBlock(DestBB, PFS))
3720 bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
3736 ParseParameterList(ArgList, PFS) ||
3740 ParseTypeAndBasicBlock(NormalBB, PFS) ||
3742 ParseTypeAndBasicBlock(UnwindBB, PFS))
3766 if (ConvertValIDToValue(PFTy, CalleeID, Callee, &PFS)) return true;
3820 bool LLParser::ParseResume(Instruction *&Inst, PerFunctionState &PFS) {
3822 if (ParseTypeAndValue(Exn, ExnLoc, PFS))
3839 bool LLParser::ParseArithmetic(Instruction *&Inst, PerFunctionState &PFS,
3842 if (ParseTypeAndValue(LHS, Loc, PFS) ||
3844 ParseValue(LHS->getType(), RHS, PFS))
3867 bool LLParser::ParseLogical(Instruction *&Inst, PerFunctionState &PFS,
3870 if (ParseTypeAndValue(LHS, Loc, PFS) ||
3872 ParseValue(LHS->getType(), RHS, PFS))
3886 bool LLParser::ParseCompare(Instruction *&Inst, PerFunctionState &PFS,
3893 ParseTypeAndValue(LHS, Loc, PFS) ||
3895 ParseValue(LHS->getType(), RHS, PFS))
3919 bool LLParser::ParseCast(Instruction *&Inst, PerFunctionState &PFS,
3924 if (ParseTypeAndValue(Op, Loc, PFS) ||
3941 bool LLParser::ParseSelect(Instruction *&Inst, PerFunctionState &PFS) {
3944 if (ParseTypeAndValue(Op0, Loc, PFS) ||
3946 ParseTypeAndValue(Op1, PFS) ||
3948 ParseTypeAndValue(Op2, PFS))
3960 bool LLParser::ParseVA_Arg(Instruction *&Inst, PerFunctionState &PFS) {
3964 if (ParseTypeAndValue(Op, PFS) ||
3978 bool LLParser::ParseExtractElement(Instruction *&Inst, PerFunctionState &PFS) {
3981 if (ParseTypeAndValue(Op0, Loc, PFS) ||
3983 ParseTypeAndValue(Op1, PFS))
3995 bool LLParser::ParseInsertElement(Instruction *&Inst, PerFunctionState &PFS) {
3998 if (ParseTypeAndValue(Op0, Loc, PFS) ||
4000 ParseTypeAndValue(Op1, PFS) ||
4002 ParseTypeAndValue(Op2, PFS))
4014 bool LLParser::ParseShuffleVector(Instruction *&Inst, PerFunctionState &PFS) {
4017 if (ParseTypeAndValue(Op0, Loc, PFS) ||
4019 ParseTypeAndValue(Op1, PFS) ||
4021 ParseTypeAndValue(Op2, PFS))
4033 int LLParser::ParsePHI(Instruction *&Inst, PerFunctionState &PFS) {
4039 ParseValue(Ty, Op0, PFS) ||
4041 ParseValue(Type::getLabelTy(Context), Op1, PFS) ||
4059 ParseValue(Ty, Op0, PFS) ||
4061 ParseValue(Type::getLabelTy(Context), Op1, PFS) ||
4082 bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) {
4088 ParseTypeAndValue(PersFn, PersFnLoc, PFS))
4105 if (ParseTypeAndValue(V, VLoc, PFS)) {
4134 bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
4152 ParseParameterList(ArgList, PFS) ||
4178 if (ConvertValIDToValue(PFTy, CalleeID, Callee, &PFS)) return true;
4237 int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
4254 if (ParseTypeAndValue(Size, SizeLoc, PFS) ||
4273 int LLParser::ParseLoad(Instruction *&Inst, PerFunctionState &PFS) {
4292 if (ParseTypeAndValue(Val, Loc, PFS) ||
4314 int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS) {
4333 if (ParseTypeAndValue(Val, Loc, PFS) ||
4335 ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
4358 int LLParser::ParseCmpXchg(Instruction *&Inst, PerFunctionState &PFS) {
4373 if (ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
4375 ParseTypeAndValue(Cmp, CmpLoc, PFS) ||
4377 ParseTypeAndValue(New, NewLoc, PFS) ||
4412 int LLParser::ParseAtomicRMW(Instruction *&Inst, PerFunctionState &PFS) {
4439 if (ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
4441 ParseTypeAndValue(Val, ValLoc, PFS) ||
4467 int LLParser::ParseFence(Instruction *&Inst, PerFunctionState &PFS) {
4484 int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
4491 if (ParseTypeAndValue(Ptr, Loc, PFS)) return true;
4505 if (ParseTypeAndValue(Val, EltLoc, PFS)) return true;
4533 int LLParser::ParseExtractValue(Instruction *&Inst, PerFunctionState &PFS) {
4537 if (ParseTypeAndValue(Val, Loc, PFS) ||
4552 int LLParser::ParseInsertValue(Instruction *&Inst, PerFunctionState &PFS) {
4556 if (ParseTypeAndValue(Val0, Loc0, PFS) ||
4558 ParseTypeAndValue(Val1, Loc1, PFS) ||
4580 PerFunctionState *PFS) {
4593 if (ParseTypeAndValue(V, PFS)) return true;