When removing a function from the function set and adding it to deferred, wemaster
commitd62fa275bde5e2a4221f650fd50d94ad87e20ac1
authorNick Lewycky <nicholas@mxc.ca>
Wed, 9 Feb 2011 06:32:02 +0000 (9 06:32 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 9 Feb 2011 06:32:02 +0000 (9 06:32 +0000)
tree69b63cd233cc35d62b62475080d58246a0dd9ae2
parent07ce433417aaae64bb9f0d8b71f0f035eb0b17b3
When removing a function from the function set and adding it to deferred, we
could end up removing a different function than we intended because it was
functionally equivalent, then end up with a comparison of a function against
itself in the next round of comparisons (the one in the function set and the
one on the deferred list). To fix this, I introduce a choice in the form of
comparison for ComparableFunctions, either normal or "pointer only" used to
find exact Function*'s in lookups.

Also add some debugging statements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125180 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/MergeFunctions.cpp
test/Transforms/MergeFunc/2011-02-08-RemoveEqual.ll [new file with mode: 0644]