Lines Matching refs:PFS
1915 PerFunctionState &PFS, bool IsMustTailCall,
1947 if (ParseMetadataAsValue(V, PFS))
1951 if (ParseOptionalParamAttrs(ArgAttrs) || ParseValue(ArgTy, V, PFS))
1977 SmallVectorImpl<OperandBundleDef> &BundleList, PerFunctionState &PFS) {
2004 if (ParseType(Ty) || ParseValue(Ty, Input, PFS))
2514 /// sanity. PFS is used to convert function-local operands of metadata (since
2516 /// PFS can be null when we are not parsing metadata values inside a function.
2517 bool LLParser::ParseValID(ValID &ID, PerFunctionState *PFS) {
2729 // We found the function; now find the basic block. Don't use PFS, since we
4077 bool LLParser::ParseMetadataAsValue(Value *&V, PerFunctionState &PFS) {
4080 if (ParseMetadata(MD, &PFS))
4092 PerFunctionState *PFS) {
4101 if (ParseValue(Ty, V, PFS))
4116 bool LLParser::ParseMetadata(Metadata *&MD, PerFunctionState *PFS) {
4128 return ParseValueAsMetadata(MD, "expected metadata operand", PFS);
4160 PerFunctionState *PFS) {
4166 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
4167 V = PFS->GetVal(ID.UIntVal, Ty, ID.Loc);
4170 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
4171 V = PFS->GetVal(ID.StrVal, Ty, ID.Loc);
4277 if (ParseValID(ID, /*PFS=*/nullptr))
4287 if (ConvertValIDToValue(Ty, ID, V, /*PFS=*/nullptr))
4298 bool LLParser::ParseValue(Type *Ty, Value *&V, PerFunctionState *PFS) {
4301 return ParseValID(ID, PFS) || ConvertValIDToValue(Ty, ID, V, PFS);
4304 bool LLParser::ParseTypeAndValue(Value *&V, PerFunctionState *PFS) {
4307 ParseValue(Ty, V, PFS);
4311 PerFunctionState &PFS) {
4314 if (ParseTypeAndValue(V, PFS)) return true;
4608 PerFunctionState PFS(*this, Fn, FunctionNumber);
4612 if (PFS.resolveForwardRefBlockAddresses())
4614 SaveAndRestore<PerFunctionState *> ScopeExit(BlockAddressPFS, &PFS);
4622 if (ParseBasicBlock(PFS)) return true;
4625 if (ParseUseListOrder(&PFS))
4632 return PFS.FinishFunction();
4637 bool LLParser::ParseBasicBlock(PerFunctionState &PFS) {
4646 BasicBlock *BB = PFS.DefineBB(Name, NameLoc);
4674 switch (ParseInstruction(Inst, BB, PFS)) {
4697 if (PFS.SetInstName(NameID, NameStr, NameLoc, Inst)) return true;
4710 PerFunctionState &PFS) {
4722 case lltok::kw_ret: return ParseRet(Inst, BB, PFS);
4723 case lltok::kw_br: return ParseBr(Inst, PFS);
4724 case lltok::kw_switch: return ParseSwitch(Inst, PFS);
4725 case lltok::kw_indirectbr: return ParseIndirectBr(Inst, PFS);
4726 case lltok::kw_invoke: return ParseInvoke(Inst, PFS);
4727 case lltok::kw_resume: return ParseResume(Inst, PFS);
4728 case lltok::kw_cleanupret: return ParseCleanupRet(Inst, PFS);
4729 case lltok::kw_catchret: return ParseCatchRet(Inst, PFS);
4730 case lltok::kw_catchswitch: return ParseCatchSwitch(Inst, PFS);
4731 case lltok::kw_catchpad: return ParseCatchPad(Inst, PFS);
4732 case lltok::kw_cleanuppad: return ParseCleanupPad(Inst, PFS);
4742 if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true;
4754 int Res = ParseArithmetic(Inst, PFS, KeywordVal, 2);
4768 if (ParseArithmetic(Inst, PFS, KeywordVal, 1)) return true;
4774 case lltok::kw_srem: return ParseArithmetic(Inst, PFS, KeywordVal, 1);
4777 case lltok::kw_xor: return ParseLogical(Inst, PFS, KeywordVal);
4778 case lltok::kw_icmp: return ParseCompare(Inst, PFS, KeywordVal);
4781 int Res = ParseCompare(Inst, PFS, KeywordVal);
4802 case lltok::kw_ptrtoint: return ParseCast(Inst, PFS, KeywordVal);
4804 case lltok::kw_select: return ParseSelect(Inst, PFS);
4805 case lltok::kw_va_arg: return ParseVA_Arg(Inst, PFS);
4806 case lltok::kw_extractelement: return ParseExtractElement(Inst, PFS);
4807 case lltok::kw_insertelement: return ParseInsertElement(Inst, PFS);
4808 case lltok::kw_shufflevector: return ParseShuffleVector(Inst, PFS);
4809 case lltok::kw_phi: return ParsePHI(Inst, PFS);
4810 case lltok::kw_landingpad: return ParseLandingPad(Inst, PFS);
4812 case lltok::kw_call: return ParseCall(Inst, PFS, CallInst::TCK_None);
4813 case lltok::kw_tail: return ParseCall(Inst, PFS, CallInst::TCK_Tail);
4814 case lltok::kw_musttail: return ParseCall(Inst, PFS, CallInst::TCK_MustTail);
4815 case lltok::kw_notail: return ParseCall(Inst, PFS, CallInst::TCK_NoTail);
4817 case lltok::kw_alloca: return ParseAlloc(Inst, PFS);
4818 case lltok::kw_load: return ParseLoad(Inst, PFS);
4819 case lltok::kw_store: return ParseStore(Inst, PFS);
4820 case lltok::kw_cmpxchg: return ParseCmpXchg(Inst, PFS);
4821 case lltok::kw_atomicrmw: return ParseAtomicRMW(Inst, PFS);
4822 case lltok::kw_fence: return ParseFence(Inst, PFS);
4823 case lltok::kw_getelementptr: return ParseGetElementPtr(Inst, PFS);
4824 case lltok::kw_extractvalue: return ParseExtractValue(Inst, PFS);
4825 case lltok::kw_insertvalue: return ParseInsertValue(Inst, PFS);
4878 PerFunctionState &PFS) {
4883 Type *ResType = PFS.getFunction().getReturnType();
4895 if (ParseValue(Ty, RV, PFS)) return true;
4909 bool LLParser::ParseBr(Instruction *&Inst, PerFunctionState &PFS) {
4913 if (ParseTypeAndValue(Op0, Loc, PFS)) return true;
4924 ParseTypeAndBasicBlock(Op1, Loc, PFS) ||
4926 ParseTypeAndBasicBlock(Op2, Loc2, PFS))
4938 bool LLParser::ParseSwitch(Instruction *&Inst, PerFunctionState &PFS) {
4942 if (ParseTypeAndValue(Cond, CondLoc, PFS) ||
4944 ParseTypeAndBasicBlock(DefaultBB, BBLoc, PFS) ||
4958 if (ParseTypeAndValue(Constant, CondLoc, PFS) ||
4960 ParseTypeAndBasicBlock(DestBB, PFS))
4983 bool LLParser::ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS) {
4986 if (ParseTypeAndValue(Address, AddrLoc, PFS) ||
4999 if (ParseTypeAndBasicBlock(DestBB, PFS))
5004 if (ParseTypeAndBasicBlock(DestBB, PFS))
5024 bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
5039 ParseValID(CalleeID) || ParseParameterList(ArgList, PFS) ||
5042 ParseOptionalOperandBundles(BundleList, PFS) ||
5044 ParseTypeAndBasicBlock(NormalBB, PFS) ||
5046 ParseTypeAndBasicBlock(UnwindBB, PFS))
5069 if (ConvertValIDToValue(PointerType::getUnqual(Ty), CalleeID, Callee, &PFS))
5129 bool LLParser::ParseResume(Instruction *&Inst, PerFunctionState &PFS) {
5131 if (ParseTypeAndValue(Exn, ExnLoc, PFS))
5140 PerFunctionState &PFS) {
5158 if (ParseMetadataAsValue(V, PFS))
5161 if (ParseValue(ArgTy, V, PFS))
5173 bool LLParser::ParseCleanupRet(Instruction *&Inst, PerFunctionState &PFS) {
5179 if (ParseValue(Type::getTokenTy(Context), CleanupPad, PFS))
5191 if (ParseTypeAndBasicBlock(UnwindBB, PFS)) {
5202 bool LLParser::ParseCatchRet(Instruction *&Inst, PerFunctionState &PFS) {
5208 if (ParseValue(Type::getTokenTy(Context), CatchPad, PFS))
5213 ParseTypeAndBasicBlock(BB, PFS))
5222 bool LLParser::ParseCatchSwitch(Instruction *&Inst, PerFunctionState &PFS) {
5233 if (ParseValue(Type::getTokenTy(Context), ParentPad, PFS))
5242 if (ParseTypeAndBasicBlock(DestBB, PFS))
5259 if (ParseTypeAndBasicBlock(UnwindBB, PFS))
5273 bool LLParser::ParseCatchPad(Instruction *&Inst, PerFunctionState &PFS) {
5282 if (ParseValue(Type::getTokenTy(Context), CatchSwitch, PFS))
5286 if (ParseExceptionArgs(Args, PFS))
5295 bool LLParser::ParseCleanupPad(Instruction *&Inst, PerFunctionState &PFS) {
5305 if (ParseValue(Type::getTokenTy(Context), ParentPad, PFS))
5309 if (ParseExceptionArgs(Args, PFS))
5325 bool LLParser::ParseArithmetic(Instruction *&Inst, PerFunctionState &PFS,
5328 if (ParseTypeAndValue(LHS, Loc, PFS) ||
5330 ParseValue(LHS->getType(), RHS, PFS))
5353 bool LLParser::ParseLogical(Instruction *&Inst, PerFunctionState &PFS,
5356 if (ParseTypeAndValue(LHS, Loc, PFS) ||
5358 ParseValue(LHS->getType(), RHS, PFS))
5372 bool LLParser::ParseCompare(Instruction *&Inst, PerFunctionState &PFS,
5379 ParseTypeAndValue(LHS, Loc, PFS) ||
5381 ParseValue(LHS->getType(), RHS, PFS))
5405 bool LLParser::ParseCast(Instruction *&Inst, PerFunctionState &PFS,
5410 if (ParseTypeAndValue(Op, Loc, PFS) ||
5427 bool LLParser::ParseSelect(Instruction *&Inst, PerFunctionState &PFS) {
5430 if (ParseTypeAndValue(Op0, Loc, PFS) ||
5432 ParseTypeAndValue(Op1, PFS) ||
5434 ParseTypeAndValue(Op2, PFS))
5446 bool LLParser::ParseVA_Arg(Instruction *&Inst, PerFunctionState &PFS) {
5450 if (ParseTypeAndValue(Op, PFS) ||
5464 bool LLParser::ParseExtractElement(Instruction *&Inst, PerFunctionState &PFS) {
5467 if (ParseTypeAndValue(Op0, Loc, PFS) ||
5469 ParseTypeAndValue(Op1, PFS))
5481 bool LLParser::ParseInsertElement(Instruction *&Inst, PerFunctionState &PFS) {
5484 if (ParseTypeAndValue(Op0, Loc, PFS) ||
5486 ParseTypeAndValue(Op1, PFS) ||
5488 ParseTypeAndValue(Op2, PFS))
5500 bool LLParser::ParseShuffleVector(Instruction *&Inst, PerFunctionState &PFS) {
5503 if (ParseTypeAndValue(Op0, Loc, PFS) ||
5505 ParseTypeAndValue(Op1, PFS) ||
5507 ParseTypeAndValue(Op2, PFS))
5519 int LLParser::ParsePHI(Instruction *&Inst, PerFunctionState &PFS) {
5525 ParseValue(Ty, Op0, PFS) ||
5527 ParseValue(Type::getLabelTy(Context), Op1, PFS) ||
5545 ParseValue(Ty, Op0, PFS) ||
5547 ParseValue(Type::getLabelTy(Context), Op1, PFS) ||
5568 bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) {
5588 if (ParseTypeAndValue(V, VLoc, PFS))
5620 bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
5643 ParseParameterList(ArgList, PFS, TCK == CallInst::TCK_MustTail,
5644 PFS.getFunction().isVarArg()) ||
5646 ParseOptionalOperandBundles(BundleList, PFS))
5673 if (ConvertValIDToValue(PointerType::getUnqual(Ty), CalleeID, Callee, &PFS))
5739 int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
5759 if (ParseTypeAndValue(Size, SizeLoc, PFS) ||
5778 int LLParser::ParseLoad(Instruction *&Inst, PerFunctionState &PFS) {
5801 ParseTypeAndValue(Val, Loc, PFS) ||
5826 int LLParser::ParseStore(Instruction *&Inst, PerFunctionState &PFS) {
5845 if (ParseTypeAndValue(Val, Loc, PFS) ||
5847 ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
5870 int LLParser::ParseCmpXchg(Instruction *&Inst, PerFunctionState &PFS) {
5885 if (ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
5887 ParseTypeAndValue(Cmp, CmpLoc, PFS) ||
5889 ParseTypeAndValue(New, NewLoc, PFS) ||
5924 int LLParser::ParseAtomicRMW(Instruction *&Inst, PerFunctionState &PFS) {
5951 if (ParseTypeAndValue(Ptr, PtrLoc, PFS) ||
5953 ParseTypeAndValue(Val, ValLoc, PFS) ||
5979 int LLParser::ParseFence(Instruction *&Inst, PerFunctionState &PFS) {
5996 int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
6007 ParseTypeAndValue(Ptr, Loc, PFS))
6031 if (ParseTypeAndValue(Val, EltLoc, PFS)) return true;
6059 int LLParser::ParseExtractValue(Instruction *&Inst, PerFunctionState &PFS) {
6063 if (ParseTypeAndValue(Val, Loc, PFS) ||
6078 int LLParser::ParseInsertValue(Instruction *&Inst, PerFunctionState &PFS) {
6082 if (ParseTypeAndValue(Val0, Loc0, PFS) ||
6084 ParseTypeAndValue(Val1, Loc1, PFS) ||
6205 bool LLParser::ParseUseListOrder(PerFunctionState *PFS) {
6212 if (ParseTypeAndValue(V, PFS) ||