[PATCH] D145300: [TableGen] add !toupper and !tolower operators to change the casing of strings.

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 01:44:48 PST 2023


fpetrogalli added a comment.

Thank you @zjaffal  for working on this.

Please update also the docs at https://llvm.org/docs/TableGen/ProgRef.html

Francesco



================
Comment at: llvm/test/TableGen/string_ops.td:32
+class Derived<string Str> :
+  Base<!if(!eq(!tolower(Str), "str"), 1, 0)>;
+
----------------
Unless there are compelling reasons for redirecting the test via `!eq` and `!if`, may I ask you to test the new operators directly? Something along the lines of:


```
class ToLower<string str> {
  string s = !tolower(str)
}

// CHECK-LABEL: def TEST1 {
// CHECK: string ="str";
// CHECK: }
def  TEST1: ToLower<"sTr">;
```

(something similar for `!toupper`)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145300



More information about the llvm-commits mailing list