Commit 3793010
authored
[CIR] Simlipify string literal global creation (#1632)
Previously, when emitting a global for a string literal, we were
creating a GlobalOp, building a GlobalView attr for it, and looking up
the global from the symbol associated with the attr. This change splits
out the function that creates the global so that the global is returned
directly and the GlobalView attribute is only created in the case where
it is needed.
This also updates the mechanism used for uniquing the global name used
for the strings so that if different base names are used the uniquing
numbers each base name separately. The mangling of the global used for
strings is not implemented, but the uniquing was happening prior to the
mangling. This change drops the uniquing below the placeholder for
mangling.1 parent 0c944f9 commit 3793010
File tree
3 files changed
+49
-25
lines changed- clang/lib/CIR/CodeGen
3 files changed
+49
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1884 | 1884 | | |
1885 | 1885 | | |
1886 | 1886 | | |
1887 | | - | |
1888 | | - | |
1889 | | - | |
1890 | | - | |
1891 | | - | |
1892 | | - | |
1893 | | - | |
1894 | | - | |
1895 | | - | |
| 1887 | + | |
| 1888 | + | |
1896 | 1889 | | |
1897 | 1890 | | |
1898 | | - | |
| 1891 | + | |
1899 | 1892 | | |
1900 | 1893 | | |
1901 | | - | |
| 1894 | + | |
1902 | 1895 | | |
1903 | 1896 | | |
1904 | 1897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
1786 | | - | |
1787 | | - | |
1788 | | - | |
1789 | | - | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
1790 | 1812 | | |
1791 | 1813 | | |
1792 | 1814 | | |
| |||
1800 | 1822 | | |
1801 | 1823 | | |
1802 | 1824 | | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
1810 | 1825 | | |
1811 | 1826 | | |
1812 | 1827 | | |
| |||
1822 | 1837 | | |
1823 | 1838 | | |
1824 | 1839 | | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
1825 | 1843 | | |
1826 | 1844 | | |
1827 | 1845 | | |
1828 | 1846 | | |
1829 | | - | |
1830 | | - | |
| 1847 | + | |
1831 | 1848 | | |
1832 | 1849 | | |
1833 | 1850 | | |
1834 | 1851 | | |
1835 | 1852 | | |
1836 | 1853 | | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
1837 | 1862 | | |
1838 | 1863 | | |
1839 | 1864 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
341 | 344 | | |
342 | 345 | | |
343 | 346 | | |
| |||
444 | 447 | | |
445 | 448 | | |
446 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
447 | 454 | | |
448 | 455 | | |
449 | 456 | | |
450 | 457 | | |
451 | 458 | | |
452 | | - | |
453 | 459 | | |
454 | 460 | | |
455 | 461 | | |
| |||
0 commit comments