[PATCH] [lld] Start of a test suite for the Darwin driver

Joe Ranieri joe at alacatialabs.com
Tue May 21 07:35:41 PDT 2013


On Tue, May 21, 2013 at 1:39 AM, Nick Kledzik <kledzik at apple.com> wrote:

> Joe, Thanks for starting to help out with the mach-o part of lld.
>  Comments below:
>
>
> +std::string MachOTargetInfo::PackedVersion::unparse() const {
> +  std::string buffer;
> +  llvm::raw_string_ostream str(buffer);
> +  str << llvm::format("%i.%i.%i", _value >> 16, (_value >> 8) & 0xFF,
> +                      _value & 0xFF);
> +  return str.str();
> +}
>
> If you change this function to take a stream to write to, you won't need
> the stream and buffer temporaries.
>

Good point.


> +  if (parsedArgs->getLastArg(OPT_dump_args)) {
> +    info.dumpArgs(llvm::outs());
> +    return true;
> +  }
> +
>
> This is called after validate() which sets up some defaults.  That will
> make for some unexpected output.  For instance, dumpArgs() will also add
> the -e option even if it was not specified.   We need to decide if
> dumpArgs() prints the minimal arguments or every possible argument with its
> default value (e.g. -image_base 0).
>

My idea was that dumpArgs() should print out every possible argument so
that it can also be used to test that validate() is doing the correct
thing. For example, testing that -pie gets properly ignored if building a
bundle or a dylib.

-- Joe Ranieri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130521/c8421c3e/attachment.html>


More information about the llvm-commits mailing list