Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm not up to speed on this code: is the current convention for tblgen to exit(1) after errors? If so, this looks reasonable to me.
llvm/utils/TableGen/CodeEmitterGen.cpp | ||
---|---|---|
124–131 | Do I understand correctly: the fix is to do this check even if the "while" loop above executed 0 times? |
llvm/utils/TableGen/CodeEmitterGen.cpp | ||
---|---|---|
124–131 | Yes. With the original code control may reach the OpIdx = NumberedOp++; below several times. As the index gets increased every time, it can at some point become equal to the total number of operands, meaning we would never enter the loop. Doing PrintFatalError() as the patch intends makes it impossible to catch the error twice, but it still feels better to have the check outside of the loop. |
Do I understand correctly: the fix is to do this check even if the "while" loop above executed 0 times?