File tree 2 files changed +18
-12
lines changed
2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,11 @@ See \ref irept for more information.
16
16
17
17
\subsection irep_idt_section Irep_idt and Dstringt
18
18
19
- Inside ` irept ` s, strings are stored as ` irep_idt ` s, or ` irep_namet ` s for
20
- keys to ` named_sub ` or ` comments ` . If ` USE_STD_STRING ` is set then both
21
- ` irep_idt ` and ` irep_namet ` are ` typedef ` ed to ` std::string ` , but by default
22
- it is not set and they are ` typedef ` ed to ` dstringt ` . ` dstringt ` has one
23
- field, an unsigned integer which is an index into a static table of strings.
24
- This makes it expensive to create a new string (because you have to look
25
- through the whole table to see if it is already there, and add it if it
26
- isn't) but very cheap to compare strings (just compare the two integers). It
27
- also means that when you have lots of copies of the same string you only have
28
- to store the whole string once, which saves space.
19
+ Inside \ref irept, strings are stored as irep_idts, or irep_namets for
20
+ keys to named_sub or comments. By default both irep_idt and irep_namet
21
+ are typedefed to \ref dstringt, unless USE_STD_STRING is set, in which
22
+ case they are typedefed to std::string (this can be used for debugging
23
+ purposes).
29
24
30
25
\dot
31
26
digraph G {
Original file line number Diff line number Diff line change 16
16
17
17
#include " string_container.h"
18
18
19
- // Marked final to disable inheritance.
20
- // No virtual destructor, so runtime-polymorphic use would be unsafe.
19
+ // / `dstringt` has one field, an unsigned integer `no` which is an index into
20
+ // / a static table of strings. This makes it expensive to create a new string
21
+ // / (because you have to look through the whole table to see if it is already
22
+ // / there, and add it if it isn't) but very cheap to compare strings (just
23
+ // / compare the two integers). It also means that when you have lots of copies
24
+ // / of the same string you only have to store the whole string once, which
25
+ // / saves space.
26
+ // /
27
+ // / `irep_idt` and `irep_namet` are typedef-ed to `dstringt` in irep.h unless
28
+ // /
29
+ // /
30
+ // / Note: Marked final to disable inheritance. No virtual destructor, so
31
+ // / runtime-polymorphic use would be unsafe.
21
32
class dstringt final
22
33
{
23
34
public:
You can’t perform that action at this time.
0 commit comments