Lines Matching defs:VMap

38                                   ValueToValueMapTy &VMap,
53 VMap[II] = NewInst; // Add instruction map to value.
74 // VMap values.
77 ValueToValueMapTy &VMap,
88 assert(VMap.count(I) && "No mapping from source argument specified!");
92 // Clone any argument attributes that are present in the VMap.
96 if (Argument *Anew = dyn_cast<Argument>(VMap[I])) {
121 BasicBlock *CBB = CloneBasicBlock(&BB, VMap, NameSuffix, NewFunc, CodeInfo);
124 VMap[&BB] = CBB;
135 VMap[OldBBAddr] = BlockAddress::get(NewFunc, CBB);
144 // references as we go. This uses VMap to do all the hard work.
145 for (Function::iterator BB = cast<BasicBlock>(VMap[OldFunc->begin()]),
149 RemapInstruction(II, VMap,
156 /// in the VMap are changed to refer to their mapped value instead of the
157 /// original one. If any of the arguments to the function are in the VMap,
158 /// the arguments are deleted from the resultant function. The VMap is
162 Function *llvm::CloneFunction(const Function *F, ValueToValueMapTy &VMap,
168 // the VMap. If so, we need to not add the arguments to the arg ty vector
172 if (VMap.count(I) == 0) // Haven't mapped the argument to anything yet?
186 if (VMap.count(I) == 0) { // Is this argument preserved?
188 VMap[I] = DestI++; // Add mapping to VMap
192 CloneFunctionInto(NewF, F, VMap, ModuleLevelChanges, Returns, "", CodeInfo);
204 ValueToValueMapTy &VMap;
217 VMap(valueMap), ModuleLevelChanges(moduleLevelChanges),
232 WeakVH &BBEntry = VMap[BB];
254 VMap[OldBBAddr] = BlockAddress::get(NewFunc, NewBB);
269 RemapInstruction(NewInst, VMap,
278 if (Value *MappedV = VMap.lookup(V))
281 VMap[II] = V;
289 VMap[II] = NewInst; // Add instruction map to value.
309 Value *V = VMap[BI->getCondition()];
316 VMap[OldTI] = BranchInst::Create(Dest, NewBB);
325 Value *V = VMap[SI->getCondition()];
331 VMap[OldTI] = BranchInst::Create(Dest, NewBB);
342 VMap[OldTI] = NewInst; // Add instruction map to value.
366 ValueToValueMapTy &VMap,
378 assert(VMap.count(II) && "No mapping from source argument specified!");
381 PruningFunctionCloner PFC(NewFunc, OldFunc, VMap, ModuleLevelChanges,
401 Value *V = VMap[BI];
418 RemapInstruction(NewBB->getTerminator(), VMap,
428 BasicBlock *NewBB = cast<BasicBlock>(VMap[OldBB]);
435 PHINode *PN = cast<PHINode>(VMap[OPN]);
437 Value *V = VMap[PN->getIncomingBlock(pred)];
440 VMap,
495 assert(VMap[OldI] == PN && "VMap mismatch");
496 VMap[OldI] = NV;
506 // WeakVH in the VMap. Notably, we rely on that so that if we coalesce
511 if (PHINode *PN = dyn_cast<PHINode>(VMap[PHIToResolve[Idx]]))
518 Function::iterator Begin = cast<BasicBlock>(VMap[&OldFunc->getEntryBlock()]);
569 for (Function::iterator I = cast<BasicBlock>(VMap[&OldFunc->getEntryBlock()]),