Commit ebeca8d
committed
[CHERIoT] Add
The first two are used from the front-end to indicate that an extern
global declaration refers to a specific compartment import. The third is
the attribute consumed by the back-end to generate the necessary
compartment import entry and the correct sequence of instructions when
taking the address of the global.
Add documentation for newly introduced attributes
`cheriot_mmio` is documented in `CHERIMMIODeviceDocs`, and similarly for
`cheriot_shared_object`.
Add documentation for the piece of code that translates clang-level attributes to LLVM IR ones.
Add semantic checks to permissions encoding
Change `CapabilityImportAttr` to `GlobalCapabilityImportAttr`, to reflect that it must be used on global (variables) not functions.
Move the "global must be extern check" to verifier, replace with assertion in previous location
Pull permission symbols out as symbolic values (`EncodedPermissions`->`Permissions`, +`encodePermissions()`)
Add a test with multiple references to the same imported global
Use enum to show the kind of import, remove "export_" from the string, minor changes to reduce flow nesting
Reduce flow nesting
Change mtriple
Add more comments to `GlobalCapabilityImportAttr`
Remove extraneous change
Repurpose `ImportedFunctions` to be used with global variables as well, use `emitEndOfAsm` to generate relevant entries
fix formatting
Fix typo in docs for attributes.
Rename `CHERIMMIODevice` and `CHERISharedObject` to `CHERIOT...`
Specify, in the docs, that the global must have the `extern` and `volatile` qualifiers
Minor fixes to formatting in RISCV.cpp
Factor `getElfSection` for `IsGlobal` together with `IsPublic`
Minor changes to respect idiomatic LLVM style
Refactor syntactic and semantic checks of permissions strings out of the attribute handlers
Remove spurious import
Reduce nesting in syntax check of permissions string.
Fix tests concerning attributes and warnings
fix tests concerning import section entries for functions
Reduce nesting in `ExpandPseudoInsts`
Move `GlobalCapabilityImportAttr` to `llvm/include/llvm/IR/Attributes.h`
Remove `namespace cheri` in Attributes.h, rename `GlobalCapabilityImportAttr` to `CHERIoTGlobalCapabilityImportAttr`
simplify import objects
Add warnings and errors for ill constructed global variables with the `cheriot_mmio` or `cheriot_shared_object` attributes
Namely, an ad-hoc error is now generated if the variable with the
attribute has an explicit initializer, and a warning is now emitted if a
`cheriot_mmio` is not marked as volatile.
chore: fix formatting
Remove unwanted import
Simplify `AUIPCC` expansion.
remove unused import
remove unused import
remove unused imports
remove unused imports/replace with `Attributes.h` where neededcheriot_mmio, cheriot_shared_object and cheriot_cap_import attributes1 parent 1153d07 commit ebeca8d
File tree
23 files changed
+1300
-65
lines changed- clang
- include/clang/Basic
- lib
- CodeGen/Targets
- Sema
- test
- CodeGen/cheri/riscv
- Misc
- Sema/cheri
- llvm
- include/llvm/IR
- lib
- IR
- Target/RISCV
- test/CodeGen/RISCV/cheri
23 files changed
+1300
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2892 | 2892 | | |
2893 | 2893 | | |
2894 | 2894 | | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
2895 | 2908 | | |
2896 | 2909 | | |
2897 | 2910 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1473 | 1473 | | |
1474 | 1474 | | |
1475 | 1475 | | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1476 | 1543 | | |
1477 | 1544 | | |
1478 | 1545 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
635 | 662 | | |
636 | 663 | | |
637 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13501 | 13501 | | |
13502 | 13502 | | |
13503 | 13503 | | |
| 13504 | + | |
| 13505 | + | |
| 13506 | + | |
| 13507 | + | |
| 13508 | + | |
| 13509 | + | |
| 13510 | + | |
| 13511 | + | |
| 13512 | + | |
| 13513 | + | |
| 13514 | + | |
| 13515 | + | |
| 13516 | + | |
| 13517 | + | |
| 13518 | + | |
| 13519 | + | |
| 13520 | + | |
| 13521 | + | |
| 13522 | + | |
| 13523 | + | |
13504 | 13524 | | |
13505 | 13525 | | |
13506 | 13526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
2103 | 2106 | | |
2104 | 2107 | | |
2105 | 2108 | | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
2106 | 2230 | | |
2107 | 2231 | | |
2108 | 2232 | | |
| |||
7350 | 7474 | | |
7351 | 7475 | | |
7352 | 7476 | | |
| 7477 | + | |
| 7478 | + | |
| 7479 | + | |
| 7480 | + | |
| 7481 | + | |
| 7482 | + | |
7353 | 7483 | | |
7354 | 7484 | | |
7355 | 7485 | | |
| |||
0 commit comments