ValueMapper: Disallow metadata mapping recursion through mapValue
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 3 Apr 2016 20:54:51 +0000 (20:54 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 3 Apr 2016 20:54:51 +0000 (20:54 +0000)
commit756e1c3db452165ddcc8b8d11df8a3d36fd427bb
tree4fe3249c92551ecf294b1fd977eca881fd54ab55
parenta997856b3d0610a7db795dbd03c511eabb6d0382
ValueMapper: Disallow metadata mapping recursion through mapValue

This adds an assertion to maintain the property from r265273.  When
Mapper::mapSimpleMetadata calls Mapper::mapValue, it should not find its
way back to mapMetadataImpl.  This guarantees that mapSimpleMetadata is
not involved in any recursion.

Since Mapper::mapValue calls out to arbitrary materializers, we need to
save a bit on the ValueMap to make this assertion effective.

There should be no functionality change here.  This co-recursion should
already have been impossible.

llvm-svn: 265276
llvm/include/llvm/IR/ValueMap.h
llvm/lib/Transforms/Utils/ValueMapper.cpp