[llvm-commits] [llvm] r58727 - in /llvm/trunk: include/llvm/Module.h lib/CodeGen/StackProtector.cpp lib/VMCore/Module.cpp

Chris Lattner clattner at apple.com
Thu Nov 6 09:57:13 PST 2008


On Nov 5, 2008, at 4:19 PM, Bill Wendling wrote:
>> Awesome, thanks Bill!  One minor nit: getOrInsertFunction takes a
>> function, not a pointer to the function.  Do you think it makes sense
>> for getOrInsertGlobal to take the "contained" type of the global,
>> instead of the pointer?
>>
> If I understand correctly, that's what this change is doing. :-) Or do
> you want to create another "derived type" called GlobalType similar to
> FunctionType and use that?

I believe that if you pass in an i32 to the current implementation  
that it will get an assert fail or invalid IR, not a global that holds  
an i32.  To get a global that holds an i32, you have to pass in i32*  
(which is different than how the globalvariable ctor works, which is  
confusing).

If it doesn't work like this, then please ignore me :)

-Chris



More information about the llvm-commits mailing list