[llvm-commits] Move Module::getTypeByName to LLVMContext::getTypeByName

Maël Nison nison.mael at gmail.com
Thu Jan 10 09:58:26 PST 2013


Could it be possible to have a feedback, even negative, please ?


On 5 August 2012 14:44, Maël Nison <nison.mael at gmail.com> wrote:

> As a workaround, creating a temporary stack-alloced Module to use its
> getTypeByName() method works.
>
> But that's a workaround, it requires useless additional instructions. : /
>
>
> On 2 August 2012 18:40, Maël Nison <nison.mael at gmail.com> wrote:
>
>> Hi,
>>
>> This very short patch moves Module's getTypeByName into LLVMContext,
>> because :
>>
>> - Every types are linked to a Context, so it makes sense to get types
>> from the context and not from a module
>> - The Module::getTypeByName function doesn't actually use anything owned
>> by the Module class
>> - It is not possible to specialize the TypeBuilder to return a named
>> structure (we can only returns literal structures). By moving getTypeByName
>> into the LLVMContext class, we are able to do it (TypeBuilder's
>> specializations are called with a LLVMContext reference as parameter).
>>
>> In order to keep backward compatibility, Module::getTypeByName now
>> forwards to the new method.
>>
>> It's my first patch so .. am I doing it wrong ?
>>
>> --
>> Maël Nison
>> Epitech 2014, Paris - Astek
>>
>>
>
>
> --
> Maël Nison
> Epitech 2014, Paris - Astek
>
>


-- 
Maël Nison
JS Github hipster, Assistant C++ chez Epitech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130110/d5035aa3/attachment.html>


More information about the llvm-commits mailing list