Commit 2aa7780
committed
[StrTable] Switch intrinsics to
Historically, the main example of *very* large string tables used the
`EmitCharArray`, but that was switched (without removing the API) in
order to consolidate on a nicer emission primitive.
While this large string table in `IntrinsicsImpl.inc` seems to compile
correctly on MSVC without the workaround this adds back to the nicer
emission path, other users have repeatedly hit this MSVC limitation.
This PR teaches the string offset table emission to look at the size of
the table and fall back to the char array emission strategy when the
table becomes too large.
The workaround does have the downside of making compile times worse for
large string tables, but that appears unavoidable until we can identify
known good MSVC versions and switch to requiring them for all LLVM
users. It also reduces searchability of the generated string table --
I looked at emitting a comment with each string but it is tricky because
the escaping rules for an inline comment are different from those of of
a string literal, and there's no real way to turn the string literal
into a comment.
This PR also switches the `IntrinsicsImpl.inc` string tables over to the
new `StringTable` runtime abstraction. I didn't want to do this until
landing the MSVC workaround in case it caused even this example to start
hitting the MSVC bug, but I wanted to switch here so that I could
simplify the API for emitting the string table. With the two different
emission strategies, its important to use a very exact syntax and that
seems better encapsulated in the API.
Follow-up patches will try to consolidate the remaining users onto the
single interface, but those at least were easy to separate into
follow-ups and keep this PR somewhat smaller.StringTable and workaround MSVC1 parent 01ad3c5 commit 2aa7780
File tree
6 files changed
+67
-57
lines changed- clang/utils/TableGen
- llvm
- include/llvm/TableGen
- lib/IR
- test/TableGen
- utils/TableGen
- Basic
6 files changed
+67
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1785 | 1785 | | |
1786 | 1786 | | |
1787 | 1787 | | |
1788 | | - | |
1789 | | - | |
| 1788 | + | |
1790 | 1789 | | |
1791 | 1790 | | |
1792 | 1791 | | |
| |||
1939 | 1938 | | |
1940 | 1939 | | |
1941 | 1940 | | |
1942 | | - | |
1943 | | - | |
1944 | | - | |
1945 | 1941 | | |
1946 | 1942 | | |
1947 | 1943 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
58 | 73 | | |
59 | 74 | | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
63 | | - | |
64 | | - | |
| 78 | + | |
| 79 | + | |
65 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
66 | 88 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
70 | 105 | | |
71 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
72 | 109 | | |
73 | 110 | | |
74 | 111 | | |
75 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
76 | 116 | | |
77 | 117 | | |
78 | 118 | | |
| |||
110 | 150 | | |
111 | 151 | | |
112 | 152 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 153 | | |
134 | 154 | | |
135 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
652 | | - | |
| 653 | + | |
653 | 654 | | |
654 | | - | |
| 655 | + | |
655 | 656 | | |
656 | 657 | | |
657 | 658 | | |
658 | | - | |
| 659 | + | |
659 | 660 | | |
660 | | - | |
| 661 | + | |
661 | 662 | | |
662 | 663 | | |
663 | 664 | | |
664 | | - | |
665 | | - | |
| 665 | + | |
| 666 | + | |
666 | 667 | | |
667 | 668 | | |
668 | 669 | | |
| |||
672 | 673 | | |
673 | 674 | | |
674 | 675 | | |
675 | | - | |
| 676 | + | |
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
| |||
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
719 | | - | |
| 720 | + | |
720 | 721 | | |
721 | 722 | | |
722 | 723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
256 | | - | |
| 255 | + | |
257 | 256 | | |
258 | 257 | | |
259 | 258 | | |
| |||
759 | 758 | | |
760 | 759 | | |
761 | 760 | | |
762 | | - | |
| 761 | + | |
763 | 762 | | |
764 | 763 | | |
765 | 764 | | |
766 | 765 | | |
767 | 766 | | |
768 | | - | |
| 767 | + | |
769 | 768 | | |
770 | 769 | | |
771 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | 290 | | |
295 | 291 | | |
296 | 292 | | |
| |||
303 | 299 | | |
304 | 300 | | |
305 | 301 | | |
306 | | - | |
307 | | - | |
308 | | - | |
| 302 | + | |
309 | 303 | | |
310 | 304 | | |
311 | 305 | | |
| |||
0 commit comments