Paul C. Anagnostopoulos via llvm-dev
2021-Apr-23 18:01 UTC
[llvm-dev] TableGen !find operator
I've implemented the !find operator for TableGen. !find(source_string, target_string [, start-pos]) It returns the position of the target_string in the source_string. The question is: What should it return if the there is no match? std::string::find() returns npos, which is ~size_t <https://llvm.org/doxygen/classsize__t.html>(0). TableGen's integers are signed. So it could return -1, or it could return the maximum positive signed integer. Or, it could break with tradition and return the length of the source_string. The easiest thing to test for is -1. Opinions, please. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210423/8a90fb5b/attachment.html>