Change the interfaces of in-memory representation to use pointers.
authorLei Zhang <antiagainst@google.com>
Tue, 9 Aug 2016 23:20:35 +0000 (19:20 -0400)
committerLei Zhang <antiagainst@google.com>
Wed, 10 Aug 2016 16:11:33 +0000 (12:11 -0400)
commit80c94a4fa854c65522c3869f4b991e57b24d3d9b
tree4a8a333ac8028426cca982814027ead40f631286
parent7784829b3adf3ec102133c8d1b48c9ad161aeac3
Change the interfaces of in-memory representation to use pointers.

Previously we use vectors of objects and move semantics to handle
ownership. That approach has the flaw that inserting an object into
the middle of a vector, which may trigger a vector reallocation,
can invalidate some addresses taken from instructions.

Now the in-memory representation internally uses vector of unique
pointers to handle ownership. Since objects are explicitly heap-
allocated now, pointers to them won't be invalidated by vector
resizing anymore.
source/opt/basic_block.h
source/opt/function.cpp
source/opt/function.h
source/opt/ir_loader.cpp
source/opt/module.cpp
source/opt/module.h
source/val/BasicBlock.h
test/opt/test_pass_manager.cpp