Commit 32a49c1
committed
SourceMgr: simplify API, keep file contents in memory, faster SrcLoc conversion
- add `string_buffer.Buf.detach()` to get buffer with ownership
- add `File.detach()` to get buffer with ownership
- simplify `string_buffer.Buf.newline()`
- add `File.is_const` and `SourceMgr.addResource()` for static contents
- unify `File` contents as `File.data_`/`File.data_size`
- improve `CheckPoint` system (simpler and much faster)
- remove `Max_open_files`
- remove `close_oldest()`, all files stay in memory until `clear()` or `free()`.1 parent b87070e commit 32a49c1
File tree
8 files changed
+203
-358
lines changed- ast_utils
- common
- file
- compiler
- tools
8 files changed
+203
-358
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| |||
97 | 114 | | |
98 | 115 | | |
99 | 116 | | |
100 | | - | |
101 | 117 | | |
102 | 118 | | |
103 | 119 | | |
| |||
109 | 125 | | |
110 | 126 | | |
111 | 127 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
124 | | - | |
125 | 130 | | |
126 | | - | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
0 commit comments