[llvm-commits] [PATCH][System::Path] Add isObjectFile()

Michael Spencer bigcheesegs at gmail.com
Wed Sep 15 14:32:20 PDT 2010


On Wed, Sep 15, 2010 at 3:17 PM, Rafael Espindola <espindola at google.com> wrote:
> So, do you consider "native object file" to include llvm bitcode
> files, right? You should probably make this explicit. Using a switch
> on the output of IdentifyFileType should accomplish that and also
> produce a warning if anyone adds something else is added to
> LLVMFileType.
>
> Also, should this function returns true for core files?
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>

I'm still not 100% sure how to treat bitcode files. It will really
depend on how well they fit the API. What I don't want is to end up
with special case code everywhere just for bitcode files. Optimally a
linker would be able to treat it just like every other object file
during symbol resolution, and then assemble the functions/data that
matter before layout and output.

The issue I have with explicitly listing every file type is that
IdentifyFileType returns more than just MachO or ELF. It also reads
the headers and tries to figure out a bunch of stuff that I don't care
about when constructing.

What I would actually prefer is adding enum members like
ELF_ObjectStart_FileType and ELF_ObjectEnd_FileType. With all the
subtypes in the middle. That way more file types can be added without
requiring updating other places that can already deal with whatever is
being added.

And core files are definitely object files.

Thanks for the review!

- Michael Spencer




More information about the llvm-commits mailing list