[LLVMdev] llvm::Type as llvm::Value in metadata

Marcus Frenkel marcus.frenkel at FernUni-Hagen.de
Mon Mar 26 23:48:47 PDT 2012


On Tue, Mar 27, 2012 at 01:55 AM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Mon, Mar 26, 2012 at 3:08 PM, Marcus Frenkel
> <marcus.frenkel at fernuni-hagen.de> wrote:
>> Hi all,
>>
>> I've a question about something that's bothering me for quite some time now: why is a llvm::Function seen as a llvm::Value (in a sense that llvm::Function is a subclass of llvm::Value), but llvm::Type is not? Should they not - technically seen - be equal?
>
> llvm::Function is a subclass of llvm::Value because you can use a
> llvm::Function as a value (of type pointer-to-function).  The same is
> not true for llvm::Type.

Yeah, I know that (in fact, I hoped to express exactly that ;) ). The question is, why is that so? And how can you store references to llvm::Types in the metadata section of a module?


Greetings,

Marcus



More information about the llvm-dev mailing list