[llvm-dev] TableGen 'code' type to be eliminated

Paul C. Anagnostopoulos via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 20 08:50:33 PST 2020


We are seriously considering eliminating the 'code' type from TableGen. The 'code' type is used to represent code sequences, which are specified with the [{ ... }] brackets. The bracket syntax will be retained, but the type distinction will be eliminated.

A code sequence is stored as a string, but with the type of 'code'. Some string operations, such as the paste operator (#), work on code, too. But other operations, such as !strconcat and !eq, do not. There does not appear to be any reason to maintain the distinction between string and code, except when formatting the value of a field. We will retain the two formats "..." and [{...}] when printing a field value.

I have checked all the TableGen backends and none appear to make any semantic distinction between strings and code. 



More information about the llvm-dev mailing list