Skip to content

Commit c8f04da

Browse files
committed
Use std::forward_list instead of std::map in irept by default
This reduces the size of an irept by 5 pointers (i.e., 40 bytes on 64-bit systems). Also make typet constructor compatible with the STL shipped with GCC 5.
1 parent 18da0b1 commit c8f04da

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/util/irep.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Author: Daniel Kroening, [email protected]
1818

1919
#define SHARING
2020
// #define HASH_CODE
21-
// #define NAMED_SUB_IS_FORWARD_LIST
21+
#define NAMED_SUB_IS_FORWARD_LIST
2222

2323
#ifdef NAMED_SUB_IS_FORWARD_LIST
2424
#include <forward_list>

src/util/type.h

+8
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ class typet:public irept
3232

3333
explicit typet(const irep_idt &_id):irept(_id) { }
3434

35+
#if !defined(__GNUC__) || __GNUC__ >= 6
3536
typet(irep_idt _id, typet _subtype)
3637
: irept(std::move(_id), {}, {std::move(_subtype)})
3738
{
3839
}
40+
#else
41+
typet(irep_idt _id, typet _subtype)
42+
: irept(std::move(_id))
43+
{
44+
subtype() = std::move(_subtype);
45+
}
46+
#endif
3947

4048
const typet &subtype() const
4149
{

0 commit comments

Comments
 (0)