This is an archive of the discontinued LLVM Phabricator instance.

[WebAssebmly] Remove use of Optional to fix assertion in gcc
ClosedPublic

Authored by sbc100 on Feb 14 2018, 2:26 PM.

Details

Summary

This was causing GCC builds with fail with:
Symbols.h:240:3: error: static assertion failed: Symbol types must be
trivially destructible

static_assert(std::is_trivially_destructible<T>(

The reason this is a gcc-only failure is that OptionalStorage has
as specialization for POD types that isn't built under GCC.

Event Timeline

sbc100 created this revision.Feb 14 2018, 2:26 PM
ruiu added a subscriber: ruiu.Feb 14 2018, 2:30 PM

If they can't be 0, 0 is a good initial value that represents "no value". If 0 is a valid value, we can use (uint32_t)-1. We do that in other ports, and it is perhaps better for consistency.

I just removed the failing static_assert to unbreak buildbots. Please add it back to this patch.

sbc100 edited the summary of this revision. (Show Details)Feb 14 2018, 2:31 PM
sbc100 updated this revision to Diff 134319.Feb 14 2018, 2:42 PM
  • feedback
  • Revert "Remove a failing static_assert."
ruiu added a comment.Feb 14 2018, 2:45 PM

Did you verify that this compiles with gcc?

Yup.. repro'd the failure then confirmed fix.

ruiu accepted this revision.Feb 14 2018, 2:51 PM

LGTM

This revision is now accepted and ready to land.Feb 14 2018, 2:51 PM
This revision was automatically updated to reflect the committed changes.