[PATCH] Remove CloneFunction VMap
Pete Cooper
peter_cooper at apple.com
Fri Apr 24 11:29:51 PDT 2015
> On Apr 24, 2015, at 11:02 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>
> While at it, can you remove the duplicated name from the comments?
Will do yeah.
>
> To make this less error prone, how about removing the argument and
> returning a std::pair<VMap, Function*>?
Sounds good. Going to write a test to double check that VMap gets move semantics here as I don’t want a deep copy to happen.
Will send out an updated patch once I know the answer to the VMap move.
Cheers,
Pete
>
> On 24 April 2015 at 13:13, Pete Cooper <peter_cooper at apple.com> wrote:
>> Hi Rafael
>>
>> The method llvm::CloneFunction takes a VMap in which "any references specified in the VMap are changed to refer to their mapped value instead of the original one".
>>
>> However, all callers of this function (AMDGPUAlwaysInlinePass, clang’s CGVTables, and PartialInlining) never make use of this functionality. That is, they always pass an empty map.
>>
>> Attached is a patch which removes the ability for this method to rewrite arguments, and asserts that no-one tries to. The function comment has been updated to state this.
>>
>> This also exposed some code cleanup due to the function types of the old and new functions being the same.
>>
>> Cheers,
>> Pete
More information about the llvm-commits
mailing list