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

Maël Nison nison.mael at gmail.com
Thu Aug 2 09:40:45 PDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120802/afe718c0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 2015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120802/afe718c0/attachment.obj>


More information about the llvm-commits mailing list