This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Improve feature validation error messages
ClosedPublic

Authored by tlively on May 30 2019, 2:18 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

tlively created this revision.May 30 2019, 2:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2019, 2:18 PM
sbc100 accepted this revision.May 30 2019, 2:32 PM
sbc100 added inline comments.
lld/wasm/Writer.cpp
379 ↗(On Diff #202301)

So in the case the multiple files use a given feature it will show just one them? (i.e. this insert fails after the first one?)

419 ↗(On Diff #202301)

Why not StringRef?

This revision is now accepted and ready to land.May 30 2019, 2:32 PM
tlively updated this revision to Diff 202307.May 30 2019, 2:53 PM
tlively marked 2 inline comments as done.
  • Use StringRefs
This revision was automatically updated to reflect the committed changes.
tlively added inline comments.May 30 2019, 2:54 PM
lld/wasm/Writer.cpp
379 ↗(On Diff #202301)

That's correct. I figured that printing all relevant files could get overwhelming rather quickly and that even when it would be reasonable, we still get 80% of the benefit by printing just one file.

419 ↗(On Diff #202301)

Switched, and also above. I'm always wary about StringRef because I've been burned by it not owning its contents one too many times. I assume when it is used to insert something into a StringMap the string value is copied, so it should be ok here.