[llvm-commits] [PATCH] Object File Library

Chris Lattner clattner at apple.com
Sun Nov 14 13:08:21 PST 2010


On Nov 12, 2010, at 5:56 PM, Michael Spencer wrote:

> On Fri, Nov 12, 2010 at 8:00 PM, Chris Lattner <clattner at apple.com> wrote:
>> On Nov 11, 2010, at 6:23 PM, Michael Spencer wrote:
>>> Attached are updated patches to be reviewed. I've split them up into
>>> the generic API, the COFF and ELF implementations, tool changes, and
>>> tests.
>> 
>> I just took a look at the first patch.  You're following a very disciplined approach and your code is really clean and beautiful!  Here are some initial thoughts:
>> 
>> First, why the llvm::object namespace?  Conceptually this is part of the MC stuff, so it should use MC prefixes.  If namespaces are the right answer, we should move the MC stuff into a namespace.  By the same argument, instead of lib/Object and include/llvm/Object, it should be under lib/MC/ObjectFile.
> 
> I added the object namespace mainly because quite a few other places
> in LLVM talk about symbols, sections, and relocations and I didn't
> want to conflict. I have no problem dropping the object namespace, but
> I dislike prefixing something to all the names.
> 
> As for MC, this really isn't part of it for two reasons. The first is
> that object files are conceptually completely independent from any
> form of machine code. The second, and much more practical reason, is
> that I want to minimize dependencies, which MC has a lot of. I realize
> that just being under the same path and namespace as MC doesn't mean
> that you pay that cost, but it does make it a lot easier to pick it
> up.

Ok, if you're not going to end up depending on MC, then I agree that nesting it under MC directories doesn't make sense.  I'd prefer it if you would use an "OF" prefix (for object file) but if you strongly prefer the Object namespace, that is fine with me.  Thanks Michael!

-Chris



More information about the llvm-commits mailing list