[llvm] r255078 - Return a std::unique_ptr from CloneModule. NFC.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 8 16:14:22 PST 2015


>> Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=255078&r1=255077&r2=255078&view=diff
>> ==============================================================================
>> --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
>> +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Tue Dec  8 17:57:17 2015
>> @@ -143,7 +143,7 @@ ReduceCrashingGlobalVariables::TestGloba
>>                                std::vector<GlobalVariable*> &GVs) {
>>    // Clone the program to try hacking it apart...
>>    ValueToValueMapTy VMap;
>> -  Module *M = CloneModule(BD.getProgram(), VMap);
>> +  Module *M = CloneModule(BD.getProgram(), VMap).release();
>
> Why not update these `Module *`s to be std::unique_ptrs?

That is how I noticed the CloneModule return actually.

I will update at least some of them, but bugpoint's memory management
is complicated and it seemed a good idea to do it in another patch.

Cheers,
Rafael


More information about the llvm-commits mailing list