This is an archive of the discontinued LLVM Phabricator instance.

TableGen: Explicitly check whether a record has been resolved
ClosedPublic

Authored by nhaehnle on Feb 26 2018, 12:30 AM.

Details

Summary

There are various places where resolving and constant folds can
get stuck, especially around casts. We don't always signal an
error for those, because in many cases they can legitimately
occur without being an error in the "untaken branch" of an !if.

Change-Id: I3befc0e4234c8e6cc61190504702918c9f29ce5c

Diff Detail

Repository
rL LLVM

Event Timeline

nhaehnle created this revision.Feb 26 2018, 12:30 AM
tra accepted this revision.Feb 26 2018, 4:21 PM

Few minor nits/suggestions. LGTM otherwise.

lib/TableGen/TGParser.cpp
75 ↗(On Diff #135859)

Nit. HasValue would be more descriptive. OK is too generic. HasValue gives a hint what exactly do we consider to be OK.

84 ↗(On Diff #135859)

This may be my personal preference, but I find it easier to grasp expressions with smaller number of negations. E.g. for me if(!(Ok || Bit->isConcrete())) is easier for to understand without having to stop and think about it.

100–104 ↗(On Diff #135859)

I'd fold it into bool OK = isa<BitsInit>(V)) ? checkBitsConcrete(R, RV) : V->isConcrete();

This revision is now accepted and ready to land.Feb 26 2018, 4:21 PM
nhaehnle updated this revision to Diff 136994.Mar 5 2018, 7:14 AM
nhaehnle marked 3 inline comments as done.

Address style issues, will commit later.

This revision was automatically updated to reflect the committed changes.