Lines Matching refs:PFS
133 PerFunctionState *PFS) {
137 if (PFS) {
139 Res = PFS->GetBB(Refs[i].first.StrVal, Refs[i].first.Loc);
141 Res = PFS->GetBB(Refs[i].first.UIntVal, Refs[i].first.Loc);
1066 PerFunctionState *PFS) {
1087 if (ParseMetadataListValue(ID, PFS))
1348 PerFunctionState &PFS) {
1368 if (ParseOptionalAttrs(ArgAttrs1, 0) || ParseValue(ArgTy, V, PFS))
1889 /// sanity. PFS is used to convert function-local operands of metadata (since
1891 /// PFS can be null when we are not parsing metadata values inside a function.
1892 bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
1913 return ParseMetadataValue(ID, PFS);
2390 bool LLParser::ParseMetadataListValue(ValID &ID, PerFunctionState *PFS) {
2395 if (ParseMDNodeVector(Elts, PFS) ||
2408 bool LLParser::ParseMetadataValue(ValID &ID, PerFunctionState *PFS) {
2415 return ParseMetadataListValue(ID, PFS);
2438 PerFunctionState *PFS) {
2445 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
2446 V = PFS->GetVal(ID.UIntVal, Ty, ID.Loc);
2449 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
2450 V = PFS->GetVal(ID.StrVal, Ty, ID.Loc);
2554 bool LLParser::ParseValue(Type *Ty, Value *&V, PerFunctionState *PFS) {
2557 return ParseValID(ID, PFS) ||
2558 ConvertValIDToValue(Ty, ID, V, PFS);
2561 bool LLParser::ParseTypeAndValue(Value *&V, PerFunctionState *PFS) {
2564 ParseValue(Ty, V, PFS);
2568 PerFunctionState &PFS) {
2571 if (ParseTypeAndValue(V, PFS)) return true;
2783 PerFunctionState PFS(*this, Fn, FunctionNumber);
2790 if (ParseBasicBlock(PFS)) return true;
2796 return PFS.FinishFunction();
2801 bool LLParser::ParseBasicBlock(PerFunctionState &PFS) {
2810 BasicBlock *BB = PFS.DefineBB(Name, NameLoc);
2837 switch (ParseInstruction(Inst, BB, PFS)) {
2846 if (ParseInstructionMetadata(Inst, &PFS))
2854 if (ParseInstructionMetadata(Inst, &PFS))
2860 if (PFS.SetInstName(NameID, NameStr, NameLoc, Inst)) return true;
2873 PerFunctionState &PFS) {
2886 case lltok::kw_ret: return ParseRet(Inst, BB, PFS);
2887 case lltok::kw_br: return ParseBr(Inst, PFS);
2888 case lltok::kw_switch: return ParseSwitch(Inst, PFS);
2889 case lltok::kw_indirectbr: return ParseIndirectBr(Inst, PFS);
2890 case lltok::kw_invoke: return ParseInvoke(Inst, PFS);
2891 case lltok::kw_resume: return ParseResume(Inst, PFS);
2901 if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true;
2909 case lltok::kw_fmul: return ParseArithmetic(Inst, PFS, KeywordVal, 2);
2917 if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true;
2923 case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1);
2925 case lltok::kw_frem: return ParseArithmetic(Inst, PFS, KeywordVal, 2);
2928 case lltok::kw_xor: return ParseLogical(Inst, PFS, KeywordVal);
2930 case lltok::kw_fcmp: return ParseCompare(Inst, PFS, KeywordVal);
2943 case lltok::kw_ptrtoint: return ParseCast(Inst, PFS, KeywordVal);
2945 case lltok::kw_select: return ParseSelect(Inst, PFS);
2946 case lltok::kw_va_arg: return ParseVA_Arg(Inst, PFS);
2947 case lltok::kw_extractelement: return ParseExtractElement(Inst, PFS);
2948 case lltok::kw_insertelement: return ParseInsertElement(Inst, PFS);
2949 case lltok::kw_shufflevector: return ParseShuffleVector(Inst, PFS);
2950 case lltok::kw_phi: return ParsePHI(Inst, PFS);
2951 case lltok::kw_landingpad: return ParseLandingPad(Inst, PFS);
2952 case lltok::kw_call: return ParseCall(Inst, PFS, false);
2953 case lltok::kw_tail: return ParseCall(Inst, PFS, true);
2955 case lltok::kw_alloca: return ParseAlloc(Inst, PFS);
2956 case lltok::kw_load: return ParseLoad(Inst, PFS, false);
2957 case lltok::kw_store: return ParseStore(Inst, PFS, false);
2958 case lltok::kw_cmpxchg: return ParseCmpXchg(Inst, PFS);
2959 case lltok::kw_atomicrmw: return ParseAtomicRMW(Inst, PFS);
2960 case lltok::kw_fence: return ParseFence(Inst, PFS);
2964 return ParseLoad(Inst, PFS, true);
2966 return ParseStore(Inst, PFS, true);
2969 case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
2970 case lltok::kw_extractvalue: return ParseExtractValue(Inst, PFS);
2971 case lltok::kw_insertvalue: return ParseInsertValue(Inst, PFS);
3024 PerFunctionState &PFS) {
3029 Type *ResType = PFS.getFunction().getReturnType();
3041 if (ParseValue(Ty, RV, PFS)) return true;
3055 bool LLParser::ParseBr(Instruction *&Inst, PerFunctionState &PFS) {
3059 if (ParseTypeAndValue(Op0, Loc, PFS)) return true;
3070 ParseTypeAndBasicBlock(Op1, Loc, PFS) ||
3072 ParseTypeAndBasicBlock(Op2, Loc2, PFS))
3084 bool LLParser::ParseSwitch(Instruction *&Inst, PerFunctionState &PFS) {
3088 if (ParseTypeAndValue(Cond, CondLoc, PFS) ||
3090 ParseTypeAndBasicBlock(DefaultBB, BBLoc, PFS) ||
3104 if (ParseTypeAndValue(Constant, CondLoc, PFS) ||
3106 ParseTypeAndBasicBlock(DestBB, PFS))
3129 bool LLParser::ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS) {
3132 if (ParseTypeAndValue(Address, AddrLoc, PFS) ||
3145 if (ParseTypeAndBasicBlock(DestBB, PFS))
3150 if (ParseTypeAndBasicBlock(DestBB, PFS))
3170 bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
3184 ParseParameterList(ArgList, PFS) ||
3187 ParseTypeAndBasicBlock(NormalBB, PFS) ||
3189 ParseTypeAndBasicBlock(UnwindBB, PFS))
3213 if (ConvertValIDToValue(PFTy, CalleeID, Callee, &PFS)) return true;
3260 bool LLParser::ParseResume(Instruction *&Inst, PerFunctionState &PFS) {
3262 if (ParseTypeAndValue(Exn, ExnLoc, PFS))
3279 bool LLParser::ParseArithmetic(Instruction *&Inst, PerFunctionState &PFS,
3282 if (ParseTypeAndValue(LHS, Loc, PFS) ||
3284 ParseValue(LHS->getType(), RHS, PFS))
3307 bool LLParser::ParseLogical(Instruction *&Inst, PerFunctionState &PFS,
3310 if (ParseTypeAndValue(LHS, Loc, PFS) ||
3312 ParseValue(LHS->getType(), RHS, PFS))
3326 bool LLParser::ParseCompare(Instruction *&Inst, PerFunctionState &PFS,
3333 ParseTypeAndValue(LHS, Loc, PFS) ||
3335 ParseValue(LHS->getType(), RHS, PFS))
3359 bool LLParser::ParseCast(Instruction *&Inst, PerFunctionState &PFS,
3364 if (ParseTypeAndValue(Op, Loc, PFS) ||
3381 bool LLParser::ParseSelect(Instruction *&Inst, PerFunctionState &PFS) {
3384 if (ParseTypeAndValue(Op0, Loc, PFS) ||
3386 ParseTypeAndValue(Op1, PFS) ||
3388 ParseTypeAndValue(Op2, PFS))
3400 bool LLParser::ParseVA_Arg(Instruction *&Inst, PerFunctionState &PFS) {
3404 if (ParseTypeAndValue(Op, PFS) ||
3418 bool LLParser::ParseExtractElement(Instruction *&Inst, PerFunctionState &PFS) {
3421 if (ParseTypeAndValue(Op0, Loc, PFS) ||
3423 ParseTypeAndValue(Op1, PFS))
3435 bool LLParser::ParseInsertElement(Instruction *&Inst, PerFunctionState &PFS) {
3438 if (ParseTypeAndValue(Op0, Loc, PFS) ||
3440 ParseTypeAndValue(Op1, PFS) ||
3442 ParseTypeAndValue(Op2, PFS))
3454 bool LLParser::ParseShuffleVector(Instruction *&Inst, PerFunctionState &PFS) {
3457 if (ParseTypeAndValue(Op0, Loc, PFS) ||
3459 ParseTypeAndValue(Op1, PFS) ||
3461 ParseTypeAndValue(Op2, PFS))
3473 int LLParser::ParsePHI(Instruction *&Inst, PerFunctionState &PFS) {
3479 ParseValue(Ty, Op0, PFS) ||
3481 ParseValue(Type::getLabelTy(Context), Op1, PFS) ||
3499 ParseValue(Ty, Op0, PFS) ||
3501 ParseValue(Type::getLabelTy(Context), Op1, PFS) ||
3522 bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) {
3528 ParseTypeAndValue(PersFn, PersFnLoc, PFS))
3544 if (ParseTypeAndValue(V, VLoc, PFS)) {
3569 bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
3584 ParseParameterList(ArgList, PFS) ||
3609 if (ConvertValIDToValue(PFTy, CalleeID, Callee, &PFS)) return true;
3661 int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
3675 if (ParseTypeAndValue(Size, SizeLoc, PFS) ||
3694 int LLParser::ParseLoad(Instruction *&Inst, PerFunctionState &PFS,
3717 if (ParseTypeAndValue(Val, Loc, PFS) ||
3741 int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS,
3764 if (ParseTypeAndValue(Val, Loc, PFS) ||
3766 ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
3789 int LLParser::ParseCmpXchg(Instruction *&Inst, PerFunctionState &PFS) {
3799 if (ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
3801 ParseTypeAndValue(Cmp, CmpLoc, PFS) ||
3803 ParseTypeAndValue(New, NewLoc, PFS) ||
3832 int LLParser::ParseAtomicRMW(Instruction *&Inst, PerFunctionState &PFS) {
3859 if (ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
3861 ParseTypeAndValue(Val, ValLoc, PFS) ||
3887 int LLParser::ParseFence(Instruction *&Inst, PerFunctionState &PFS) {
3904 int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
3909 if (ParseTypeAndValue(Ptr, Loc, PFS)) return true;
3921 if (ParseTypeAndValue(Val, EltLoc, PFS)) return true;
3937 int LLParser::ParseExtractValue(Instruction *&Inst, PerFunctionState &PFS) {
3941 if (ParseTypeAndValue(Val, Loc, PFS) ||
3956 int LLParser::ParseInsertValue(Instruction *&Inst, PerFunctionState &PFS) {
3960 if (ParseTypeAndValue(Val0, Loc0, PFS) ||
3962 ParseTypeAndValue(Val1, Loc1, PFS) ||
3984 PerFunctionState *PFS) {
3997 if (ParseTypeAndValue(V, PFS)) return true;