This is an archive of the discontinued LLVM Phabricator instance.

Add the TableGen assert statement, step 2
ClosedPublic

Authored by Paul-C-Anagnostopoulos on Mar 24 2021, 9:11 AM.

Details

Summary

This second step to adding the assert statement supports it in class definitions.

I improved the description in the TableGen Programmer's Reference and enhanced the test.

Diff Detail

Event Timeline

Paul-C-Anagnostopoulos requested review of this revision.Mar 24 2021, 9:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2021, 9:11 AM
lattner accepted this revision.Mar 24 2021, 12:41 PM

Looking good, a couple suggestions above. Also please address teh clang format issues, thanks!

llvm/include/llvm/TableGen/Error.h
51

Why is this marked LLVM_ATTRIBUTE_NORETURN? It looks like it does return. I think this is copy/pasto?

llvm/lib/TableGen/Error.cpp
162

i'd recommend inverting this conditional (so it is written as if (!CondValue) which will allow turning the nested if into an else chain

This revision is now accepted and ready to land.Mar 24 2021, 12:41 PM
llvm/include/llvm/TableGen/Error.h
51

It's more of a stupido. It didn't register with me what it indicated.

dblaikie added inline comments.Mar 24 2021, 10:00 PM
llvm/lib/TableGen/Error.cpp
160–162

Usually we fold the variable into the condition

Incorporate everyone's comments.

I'll let this cook for another day before pushing it.

lattner accepted this revision.Mar 25 2021, 10:33 AM

LGTM thanks Paul!

This revision was landed with ongoing or failed builds.Mar 29 2021, 6:20 AM
This revision was automatically updated to reflect the committed changes.