Return a std::unique_ptr from CloneModule. NFC.
[oota-llvm.git] / include / llvm / Transforms / Utils / Cloning.h
index 2fccbb8029648afa175dddc6ad0f9e2974e0d445..5d5689c2c1acef353c738e40bbc1791cbd5de68b 100644 (file)
@@ -48,16 +48,16 @@ class AllocaInst;
 class AssumptionCacheTracker;
 class DominatorTree;
 
-/// CloneModule - Return an exact copy of the specified module
+/// Return an exact copy of the specified module
 ///
-Module *CloneModule(const Module *M);
-Module *CloneModule(const Module *M, ValueToValueMapTy &VMap);
+std::unique_ptr<Module> CloneModule(const Module *M);
+std::unique_ptr<Module> CloneModule(const Module *M, ValueToValueMapTy &VMap);
 
 /// Return a copy of the specified module. The ShouldCloneDefinition function
 /// controls whether a specific GlobalValue's definition is cloned. If the
 /// function returns false, the module copy will contain an external reference
 /// in place of the global definition.
-Module *
+std::unique_ptr<Module>
 CloneModule(const Module *M, ValueToValueMapTy &VMap,
             std::function<bool(const GlobalValue *)> ShouldCloneDefinition);