[PM] Add support for using SFINAE to reflect on an analysis's result
authorChandler Carruth <chandlerc@gmail.com>
Thu, 21 Nov 2013 09:10:21 +0000 (09:10 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 21 Nov 2013 09:10:21 +0000 (09:10 +0000)
commit212226e11498bc25af8b80375a3e0a49b13bdd03
treef43650760d65cd33a87759cf032c43918e47b1eb
parent6345249972b73a400e31c0618c4d67411a0387e6
[PM] Add support for using SFINAE to reflect on an analysis's result
type and detect whether or not it provides an 'invalidate' member the
analysis manager should use.

This lets the overwhelming common case of *not* caring about custom
behavior when an analysis is invalidated be the the obvious default
behavior with no code written by the author of an analysis. Only when
they write code specifically to handle invalidation does it get used.

Both cases are actually covered by tests here. The test analysis uses
the default behavior, and the proxy module analysis actually has custom
behavior on invalidation that is firing correctly. (In fact, this is the
analysis which was the primary motivation for having custom invalidation
behavior in the first place.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195332 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/PassManager.h
unittests/IR/PassManagerTest.cpp