[PATCH] D50457: [MC][PredicateExpander] Extend the grammar to support simple switch and return statements.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 10:14:00 PDT 2018


mattd added inline comments.


================
Comment at: utils/TableGen/PredicateExpander.cpp:186
+
+void PredicateExpander::expandOpcodeSwitchCase(formatted_raw_ostream &OS,
+                                         const Record *Rec) {
----------------
andreadb wrote:
> mattd wrote:
> > I'm curious, do we assume all cases are fall-through?  I don't see a break statement being generated, perhaps I overlooked that?
> Your analysis is correct.
> By construction, this new grammar only allows structures that end with return statements. Since there cannot be a fall-through, I avoided to generate a redundant `break` at the end of each case.
Ah, yep.  That makes sense, thanks!


https://reviews.llvm.org/D50457





More information about the llvm-commits mailing list