OSDN Git Service

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)
commit23e40368ee00a37d619926f2d380c571a539be39
tree2af99a0880572c195678ecdddf5330feb90d4cd4
parenteb8001aa9a519e4f98439af3a26315f791aa6d5f
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265276 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/ValueMap.h
lib/Transforms/Utils/ValueMapper.cpp