File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 33
44# Folder util
55
6- \author Martin Brain
6+ \author Martin Brain, Owen Jones
77
88\section data_structures Data Structures
99
@@ -82,6 +82,19 @@ recurse on the expression on either side.
8282[ ^ 2 ] : Unless ` USE_STD_STRING ` is set, this is actually
8383a ` dstring ` and thus an integer which is a reference into a string table
8484
85+ \subsection irep_idt Irep_idt and Dstringt
86+
87+ Inside ` irept ` s, strings are stored as ` irep_idt ` s, or ` irep_namet ` s for
88+ keys to ` named_sub ` or ` comments ` . If ` USE_STD_STRING ` is set then both
89+ ` irep_idt ` and ` irep_namet ` are ` typedef ` ed to ` std::string ` , but by default
90+ it is not set and they are ` typedef ` ed to ` dstringt ` . ` dstringt ` has one
91+ field, an unsigned integer which is an index into a static table of strings.
92+ This makes it expensive to create a new string (because you have to look
93+ through the whole table to see if it is already there, and add it if it
94+ isn't) but very cheap to compare strings (just compare the two integers). It
95+ also means that when you have lots of copies of the same string you only have
96+ to store the whole string once, which saves space.
97+
8598\dot
8699digraph G {
87100 node [ shape=box] ;
You can’t perform that action at this time.
0 commit comments