[LLVMdev] [PATCH] - Union types, replaceUsesOfWithOnConstant

Talin viridia at gmail.com
Wed Feb 17 12:37:59 PST 2010


On Wed, Feb 17, 2010 at 12:05 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Feb 16, 2010, at 12:38 PM, Talin wrote:
>
> > Here's the implementation of
> ConstantUnion::replaceUsesOfWithOnConstant(). No tests yet :(
>
> Seems basically ok, please commit.
>
> I suppose that means that I'll have to send in the info to get commit
access then :(

 >
> > Two questions:
> >
> > -- Any suggestions as to an existing test I could use as a model for
> testing this?
>
> IS this what is causing this to be broken?
>

No no, nothing's broken. I just wanted to write some tests for the
replaceAllUsesOf case, and wondered if there was an existing test to use as
a model.

>
> $ cat t.ll
> @union1 = constant union { i32*, i8 } { i32* @G }
> @G = global i32 4
> $ llvm-as <t.ll | llvm-dis
> ; ModuleID = '<stdin>'
>
> @union1 = constant union { i32*, i8 } undef       ; <union { i32*, i8 }*>
> [#uses=0]
> @G = global i32 4
>
> > -- I could also use some advice on what part of the code to work on next
> (in terms of finishing up union support).
>
> What is missing?
>
> Almost everything :) At this point, the only parts of the code that are
aware of unions are:

   - Derived type definitions (Type.cpp and so on)
   - BitReader and BitWriter.
   - LLParser.
   - Constants.

There's no code that calculates the offsets of the union fields for example.
None of the code generators know about unions yet.

That's why I was wondering what area to work on next - I'm unfamiliar with
the code and could use a few hints :)

-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100217/c27aba42/attachment.html>


More information about the llvm-dev mailing list