This is an archive of the discontinued LLVM Phabricator instance.

Improve helpfulness of assert message when number of diagnostics overflows number of available enum values.
ClosedPublic

Authored by richard.barton.arm on Oct 7 2015, 1:30 AM.

Details

Reviewers
rafael
rsmith
Summary

There are two asserts that can trigger if the number of diagnostic messages in a
kind overflows the number of available enums values. The one that fires if you
exceed this limit by one is helpful. The one that fires if you exceed it by more than
one is not as helpful. Combining the two makes sense I think.

Diff Detail

Event Timeline

richard.barton.arm retitled this revision from to Improve helpfulness of assert message when number of diagnostics overflows number of available enum values..
richard.barton.arm updated this object.
richard.barton.arm added a reviewer: rafael.
richard.barton.arm added a subscriber: cfe-commits.
rsmith accepted this revision.Oct 9 2015, 12:46 PM
rsmith edited edge metadata.

It'd be great if we could check this during compilation somehow. But anyway, LGTM.

lib/Basic/DiagnosticIDs.cpp
104

Maybe drop the .DiagIDs here?

This revision is now accepted and ready to land.Oct 9 2015, 12:46 PM

Committed as r250546 with the suggested change.