Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
Show First 20 Lines • Show All 312 Lines • ▼ Show 20 Lines | void moveFunctionBody(Function &OrigF, ValueToValueMapTy &VMap, | ||||
else | else | ||||
assert(VMap[&OrigF] == NewF && "Incorrect function mapping in VMap."); | assert(VMap[&OrigF] == NewF && "Incorrect function mapping in VMap."); | ||||
assert(NewF && "Function mapping missing from VMap."); | assert(NewF && "Function mapping missing from VMap."); | ||||
assert(NewF->getParent() != OrigF.getParent() && | assert(NewF->getParent() != OrigF.getParent() && | ||||
"moveFunctionBody should only be used to move bodies between " | "moveFunctionBody should only be used to move bodies between " | ||||
"modules."); | "modules."); | ||||
SmallVector<ReturnInst *, 8> Returns; // Ignore returns cloned. | SmallVector<ReturnInst *, 8> Returns; // Ignore returns cloned. | ||||
CloneFunctionInto(NewF, &OrigF, VMap, /*ModuleLevelChanges=*/true, Returns, | CloneFunctionInto(NewF, &OrigF, VMap, CloneType::ModuleLevelChanges, Returns, | ||||
"", nullptr, nullptr, Materializer); | "", nullptr, nullptr, Materializer); | ||||
OrigF.deleteBody(); | OrigF.deleteBody(); | ||||
} | } | ||||
GlobalVariable* cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV, | GlobalVariable* cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV, | ||||
ValueToValueMapTy *VMap) { | ValueToValueMapTy *VMap) { | ||||
GlobalVariable *NewGV = new GlobalVariable( | GlobalVariable *NewGV = new GlobalVariable( | ||||
Dst, GV.getValueType(), GV.isConstant(), | Dst, GV.getValueType(), GV.isConstant(), | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |