[PATCH] [LinkModules] Intelligently merge triples that differ only in the minimum version number if the vendor is apple

Akira Hatanaka ahatanak at gmail.com
Thu Feb 12 15:57:53 PST 2015


Thanks. I'll make the suggested change and commit the patch shortly.

On Thu, Feb 12, 2015 at 3:42 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

>
> > On 2015-Feb-12, at 14:23, Akira Hatanaka <ahatanak at gmail.com> wrote:
> >
> > Address review comments.
> >
> > In summary, this patch makes the following changes:
> >
> > - Change ModuleLinker to stop issuing a warning when the Triple objects
> compare equal even when the triple strings differ.
> > - On Apple platforms, choose the triple that has the larger version
> number.
> >
> >
> > http://reviews.llvm.org/D7591
> >
> > Files:
> >  include/llvm/ADT/Triple.h
> >  lib/Linker/LinkModules.cpp
> >  lib/Support/Triple.cpp
> >  test/Linker/Inputs/apple-version/1.ll
> >  test/Linker/Inputs/apple-version/2.ll
> >  test/Linker/Inputs/apple-version/3.ll
> >  test/Linker/Inputs/apple-version/4.ll
> >  test/Linker/Inputs/targettriple-a.ll
> >  test/Linker/Inputs/targettriple-b.ll
> >  test/Linker/Inputs/targettriple-c.ll
> >  test/Linker/apple-version.ll
> >  test/Linker/targettriple.ll
> >
> > EMAIL PREFERENCES
> >  http://reviews.llvm.org/settings/panel/emailpreferences/
> > <D7591.19858.patch>
> > Index: lib/Support/Triple.cpp
> > ===================================================================
> > --- lib/Support/Triple.cpp
> > +++ lib/Support/Triple.cpp
> > @@ -494,6 +494,12 @@
> >      ObjectFormat = getDefaultFormat(*this);
> >  }
> >
> > +bool Triple::operator==(const Triple &Other) const {
> > +  return Arch == Other.Arch && SubArch == Other.SubArch &&
> > +         Vendor == Other.Vendor && OS == Other.OS &&
> > +         Environment == Other.Environment && ObjectFormat ==
> Other.ObjectFormat;
> > +}
> > +
>
> I feel like this logic should just be inline in the header.  It's
> easier to verify by eye if it's close to where the fields are
> declared.
>
> Otherwise, LGTM.
>
> >  std::string Triple::normalize(StringRef Str) {
> >    bool IsMinGW32 = false;
> >    bool IsCygwin = false;
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150212/4734526e/attachment.html>


More information about the llvm-commits mailing list