On Oct 11, 2009, at 1:25 PM, Kenneth Uildriks wrote:> On Sun, Oct 11, 2009 at 3:09 PM, Chris Lattner <clattner at apple.com> > wrote: >> >> Isn't LLVMHasInitializer just LLVMGetInitializer(x) != 0? > > Last time I tried that, LLVMGetInitializer threw an assertion when the > global variable didn't actually have one. Has this changed?No idea. It would be more C like to return null. The C implementation of the function can check and return null if not set.> I was following the pattern of Functions, Globals, etc., where you get > a Use* (not a use_iterator), and then pass it back to a GetNextUse > call, which turns it back into an iterator and advances it.Conceptually you're returning an iterator. It happens to be implemented as a tight wrapper around the Use.> > So you want the whole patch, or just the pieces you highlighted?Please resend an updated patch (the whole thing) -Chris
On Sun, Oct 11, 2009 at 3:35 PM, Chris Lattner <clattner at apple.com> wrote:> > On Oct 11, 2009, at 1:25 PM, Kenneth Uildriks wrote: > >> On Sun, Oct 11, 2009 at 3:09 PM, Chris Lattner <clattner at apple.com> wrote: >>> >>> Isn't LLVMHasInitializer just LLVMGetInitializer(x) != 0? >> >> Last time I tried that, LLVMGetInitializer threw an assertion when the >> global variable didn't actually have one. Has this changed? > > No idea. It would be more C like to return null. The C implementation of > the function can check and return null if not set. > >> I was following the pattern of Functions, Globals, etc., where you get >> a Use* (not a use_iterator), and then pass it back to a GetNextUse >> call, which turns it back into an iterator and advances it. > > Conceptually you're returning an iterator. It happens to be implemented as > a tight wrapper around the Use. >> >> So you want the whole patch, or just the pieces you highlighted? > > Please resend an updated patch (the whole thing) > > -Chris >All right. You should see it by tonight.
On Sun, Oct 11, 2009 at 3:35 PM, Chris Lattner <clattner at apple.com> wrote:> > Please resend an updated patch (the whole thing)Here it is. -------------- next part -------------- A non-text attachment was scrubbed... Name: cbindings.patch Type: text/x-patch Size: 8857 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091011/4d96baa3/attachment.bin>
thanks, applied in r83821 On Oct 11, 2009, at 3:50 PM, Kenneth Uildriks wrote:> On Sun, Oct 11, 2009 at 3:35 PM, Chris Lattner <clattner at apple.com> > wrote: >> >> Please resend an updated patch (the whole thing) > > Here it is. > <cbindings.patch>