[PATCH] Add MachOObjectFile::findAndGetUuidCommand (better name suggestions welcome)

Nick Kledzik kledzik at apple.com
Mon Oct 13 09:46:03 PDT 2014


The MachOObjectFile constructor is already walking the load commands.  If there is a LC_UUID, you can have the constructor save it off in an ivar.

The name findAndGetUuidCommand() is different than the other methods.  Can it just be getUUID() and have it return the 16-bytes?  Perhaps an ArrayRef<uint8_t> that has zero length if there is no UUID? Seems like that would be more convenient for the client.

-Nick

On Oct 13, 2014, at 5:46 AM, Alexander Potapenko <glider at google.com> wrote:
> Hi kledzik, rafael,
> 
> This CL introduces MachOObjectFile::findAndGetUuidCommand(). This function returns the MachO::uuid_command for the object file, or object_error::parse_failed if the file is malformed and doesn't contain LC_UUID.
> The new function is gonna be used by llvm-symbolizer.
> 
> http://reviews.llvm.org/D5752
> 
> Files:
>  include/llvm/Object/MachO.h
>  lib/Object/MachOObjectFile.cpp
> <D5752.14797.patch>




More information about the llvm-commits mailing list