mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
Return std::unique_ptr from SplitFunctionsOutOfModule. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255084 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -303,13 +303,8 @@ static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// SplitFunctionsOutOfModule - Given a module and a list of functions in the
|
||||
/// module, split the functions OUT of the specified module, and place them in
|
||||
/// the new module.
|
||||
Module *
|
||||
llvm::SplitFunctionsOutOfModule(Module *M,
|
||||
const std::vector<Function*> &F,
|
||||
std::unique_ptr<Module>
|
||||
llvm::SplitFunctionsOutOfModule(Module *M, const std::vector<Function *> &F,
|
||||
ValueToValueMapTy &VMap) {
|
||||
// Make sure functions & globals are all external so that linkage
|
||||
// between the two modules will work.
|
||||
@@ -323,7 +318,7 @@ llvm::SplitFunctionsOutOfModule(Module *M,
|
||||
}
|
||||
|
||||
ValueToValueMapTy NewVMap;
|
||||
Module *New = CloneModule(M, NewVMap).release();
|
||||
std::unique_ptr<Module> New = CloneModule(M, NewVMap);
|
||||
|
||||
// Remove the Test functions from the Safe module
|
||||
std::set<Function *> TestFunctions;
|
||||
@@ -364,9 +359,9 @@ llvm::SplitFunctionsOutOfModule(Module *M,
|
||||
|
||||
// Make sure that there is a global ctor/dtor array in both halves of the
|
||||
// module if they both have static ctor/dtor functions.
|
||||
SplitStaticCtorDtor("llvm.global_ctors", M, New, NewVMap);
|
||||
SplitStaticCtorDtor("llvm.global_dtors", M, New, NewVMap);
|
||||
|
||||
SplitStaticCtorDtor("llvm.global_ctors", M, New.get(), NewVMap);
|
||||
SplitStaticCtorDtor("llvm.global_dtors", M, New.get(), NewVMap);
|
||||
|
||||
return New;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user