mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-17 16:31:02 +00:00
![Nathan Sidwell](/assets/img/avatar_default.png)
We need to parse operator names in 3 places -- expressions, names & fold expressions. Currently we have 3 separate pieces to do this, and a FIXME. The operator name and expression parsing are implemented as handwritten two-character nested switches, the fold expression is a sequence of string comparisons. This adds a new OperatorInfo class to encode the operator info (encoding, kind, name), and has a table that it can binary search. From that each of the above 3 uses are altered to use the new scheme. Existing tests cover parsing operator encodings. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D119467