[PATCH] Change how MachOLinkingContext initializes defaults

Nick Kledzik kledzik at apple.com
Mon Dec 2 16:12:45 PST 2013


Joe,

It is a little odd to have some setXXX() methods be called before initialize() and some after.  I’d rather get rid of:
  setOS()
  setArch()
  setOutputFileType()

And instead have just:
  configure(HeaderFileType type, OS os, StringRef minOSVersion);  
which sets those values then does what your initialize() function does.  

-Nick

On Nov 26, 2013, at 6:22 PM, Joe Ranieri <joe at alacatialabs.com> wrote:
> Currently MachOLinkingContext::validateImpl tries to detect invalid
> values and also set default values for things that the user has not
> explicitly set. The attached patch splits out initialization into its
> own function should be called once the file type, operating system,
> and architecture are all known. Later calls to the MachOLinkingContext
> by the driver (or users of the library) can overwrite these values and
> validateImp doesn't have to perform any guessing games.
> 
> -- Joe Ranieri
> <macholinkingcontext_initialize.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list