Fix memory leak in sample profile pass.
authorDiego Novillo <dnovillo@google.com>
Wed, 26 Aug 2015 20:00:27 +0000 (20:00 +0000)
committerDiego Novillo <dnovillo@google.com>
Wed, 26 Aug 2015 20:00:27 +0000 (20:00 +0000)
commita7a6da103b90bd3118980ecd0b4f3bd5f02dbfed
treec7145a8eacee0161bfb102acc91efd40e8e4fdc0
parent4d3decd55fee12b1d48fbe48a658a62c3a6b4a7a
Fix memory leak in sample profile pass.

The problem here were the function analyses invoked by the function pass
manager from the new IPO pass. I looked at other IPO passes needing
dominance information and the only one that requires it (partial
inliner) does not use the standard dependency mechanism.

This patch mimics what the partial inliner does to compute dominance,
post-dominance and loop info. One thing I like about this approach is
that I can delay the computation of all this until I actually need it.

This should bring the ASAN buildbot back to green. If there's a better
way to fix this, I'll do it in a follow-up patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246066 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/SampleProfile.cpp