Fixing bugs in type manager memory management
authorAlan Baker <alanbaker@google.com>
Mon, 18 Dec 2017 22:02:19 +0000 (17:02 -0500)
committerAlan Baker <alanbaker@google.com>
Thu, 21 Dec 2017 13:59:06 +0000 (08:59 -0500)
commit1ab8ad654a550d28593b1b38ac303adc66b1a241
tree3c971cc7941bea3692f0c7d99445dec3c0b985a6
parent7505d2422551e5dbc2bf4e0ffccfdc5ca5ce1925
Fixing bugs in type manager memory management

* changed the way duplicate types are removed to stop copying
instructions
* Reworked RemoveDuplicatesPass::AreTypesSame to use type manager and
type equality
* Reworked TypeManager memory management to store a pool of unique
pointers of types
 * removed unique pointers from id map
 * fixed instances where free'd memory could be accessed
source/link/linker.cpp
source/opt/remove_duplicates_pass.cpp
source/opt/remove_duplicates_pass.h
source/opt/type_manager.cpp
source/opt/type_manager.h
test/opt/CMakeLists.txt
test/opt/type_manager_test.cpp
tools/opt/opt.cpp