[lld] r308935 - Fix ObjCPass on big-endian host
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 24 16:20:54 PDT 2017
Without this, this test does not pass on BE host, right? If so, yes, we
should merge this.
On Mon, Jul 24, 2017 at 4:18 PM, Tom Stellard <tstellar at redhat.com> wrote:
> Is this OK to merge to the 5.0 branch?
>
> -Tom
>
> On 07/24/2017 07:13 PM, Tom Stellard via llvm-commits wrote:
> > Author: tstellar
> > Date: Mon Jul 24 16:13:31 2017
> > New Revision: 308935
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=308935&view=rev
> > Log:
> > Fix ObjCPass on big-endian host
> >
> > Summary:
> > This fixes test/mach-o/objc-image-info-pass-output.yaml on
> > big-endian hosts.
> >
> > Reviewers: lhames, kledzik, ruiu
> >
> > Reviewed By: ruiu
> >
> > Subscribers: llvm-commits
> >
> > Differential Revision: https://reviews.llvm.org/D35052
> >
> > Modified:
> > lld/trunk/lib/ReaderWriter/MachO/ObjCPass.cpp
> >
> > Modified: lld/trunk/lib/ReaderWriter/MachO/ObjCPass.cpp
> > URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/
> ReaderWriter/MachO/ObjCPass.cpp?rev=308935&r1=308934&r2=308935&view=diff
> > ============================================================
> ==================
> > --- lld/trunk/lib/ReaderWriter/MachO/ObjCPass.cpp (original)
> > +++ lld/trunk/lib/ReaderWriter/MachO/ObjCPass.cpp Mon Jul 24 16:13:31
> 2017
> > @@ -11,6 +11,7 @@
> >
> > #include "ArchHandler.h"
> > #include "File.h"
> > +#include "MachONormalizedFileBinaryUtils.h"
> > #include "MachOPasses.h"
> > #include "lld/Core/DefinedAtom.h"
> > #include "lld/Core/File.h"
> > @@ -29,7 +30,7 @@ namespace mach_o {
> > ///
> > class ObjCImageInfoAtom : public SimpleDefinedAtom {
> > public:
> > - ObjCImageInfoAtom(const File &file,
> > + ObjCImageInfoAtom(const File &file, bool isBig,
> > MachOLinkingContext::ObjCConstraint objCConstraint,
> > uint32_t swiftVersion)
> > : SimpleDefinedAtom(file) {
> > @@ -54,6 +55,8 @@ public:
> > }
> >
> > Data.info.flags |= (swiftVersion << 8);
> > +
> > + normalized::write32(Data.bytes + 4, Data.info.flags, isBig);
> > }
> >
> > ~ObjCImageInfoAtom() override = default;
> > @@ -109,7 +112,8 @@ public:
> > private:
> >
> > const DefinedAtom* getImageInfo() {
> > - return new (_file.allocator()) ObjCImageInfoAtom(_file,
> > + bool IsBig = MachOLinkingContext::isBigEndian(_ctx.arch());
> > + return new (_file.allocator()) ObjCImageInfoAtom(_file, IsBig,
> >
> _ctx.objcConstraint(),
> >
> _ctx.swiftVersion());
> > }
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170724/0f4964a2/attachment.html>
More information about the llvm-commits
mailing list