This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Remove ubig32_t cast from ARMAttributeParser
ClosedPublic

Authored by samparker on Jan 13 2017, 3:46 AM.

Details

Summary

Multiple buildbots are failing to cast ubig32_t (no conversion from 'const llvm::support::ubig32_t' to 'const llvm::support::ulittle32_t) so i'm removing it.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker updated this revision to Diff 84275.Jan 13 2017, 3:46 AM
samparker retitled this revision from to [ARM] Remove ubig32_t cast from ARMAttributeParser.
samparker updated this object.
samparker added a subscriber: llvm-commits.
RKSimon added inline comments.
lib/Support/ARMAttributeParser.cpp
689 ↗(On Diff #84275)

If you replace the ternary operator with an if - else pair - then MSVC would be happy with the casts and you keep endian support

samparker added inline comments.Jan 13 2017, 4:01 AM
lib/Support/ARMAttributeParser.cpp
689 ↗(On Diff #84275)

ah, ok! thanks!

samparker updated this revision to Diff 84278.Jan 13 2017, 4:14 AM

Re-adding ubig32_t, but now using if/else to select the cast.

can we just use support::endian::read32le and support::endian::read32be instead of the casting magic? They do the same thing but should have no problem with implicit conversions in a ternary expression.

this works for me.

samparker updated this revision to Diff 84290.Jan 13 2017, 6:05 AM

Now using read32le and read32be to access memory. Also included a small fix for attribute printing.

can we just use support::endian::read32le and support::endian::read32be instead of the casting magic? They do the same thing but should have no problem with implicit conversions in a ternary expression.

Confirmed - this works fine too.

RKSimon added inline comments.Jan 13 2017, 6:15 AM
lib/Support/ARMAttributeParser.cpp
680 ↗(On Diff #84290)

This seems unnecessary - or at least is a different problem.

691 ↗(On Diff #84290)

clang-format

samparker updated this revision to Diff 84296.Jan 13 2017, 6:40 AM

removed the extra bug fix and will upload as separate patch. clang-formatted the remaining.

RKSimon accepted this revision.Jan 13 2017, 6:43 AM
RKSimon added a reviewer: RKSimon.

LGTM - thanks

This revision is now accepted and ready to land.Jan 13 2017, 6:43 AM
This revision was automatically updated to reflect the committed changes.