[PATCH] D94529: [TableGen] Enhance !cast<string> to handle bit and bits types

Madhur Amilkanthwar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 10:41:06 PST 2021


madhur13490 added inline comments.


================
Comment at: llvm/test/TableGen/cast-string.td:41
+  bits<8> bits2 = 0b00100101;
+  string str = !cast<string>(bits1) # " and " # !cast<string>(bits2);
+}
----------------
Would it be useful if we can cast bits to the literal string also and not just to its decimal equivalent? e.g. something like 
```
!cast<stringref>(bits1) -> "0b0101".
```

I am not sure if this exists today or any backend needs it. 


================
Comment at: llvm/test/TableGen/cast-string.td:53
+
+// ERROR1: nitializer of 'str' in 'Rec5' could not be fully resolved
+
----------------
Typo - Initializer?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94529/new/

https://reviews.llvm.org/D94529



More information about the llvm-commits mailing list