diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2010-07-24 20:54:02 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2010-07-24 20:54:02 +0000 |
commit | 7bc0443f2be6cde74609d916e4e1b1379774167f (patch) | |
tree | 9dd961f59c8f52fb96538fd24355a274d60c4915 /llvm/lib/Transforms/Utils | |
parent | 3c8eb80d93d61628752cc94f7e1261118d6fd3b7 (diff) | |
download | bcm5719-llvm-7bc0443f2be6cde74609d916e4e1b1379774167f.tar.gz bcm5719-llvm-7bc0443f2be6cde74609d916e4e1b1379774167f.zip |
Revert this because we can't clone cyclic MDNodes which are creating during a
build of llvm-gcc.
llvm-svn: 109355
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 7b60d9697c6..3f6a90c94eb 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -27,9 +27,10 @@ Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) { // NOTE: VMSlot can be invalidated by any reference to VM, which can grow the // DenseMap. This includes any recursive calls to MapValue. - // Global values do not need to be seeded into the VM if they are using - // the identity mapping. - if (isa<GlobalValue>(V) || isa<InlineAsm>(V) || isa<MDString>(V)) + // Global values and non-function-local metadata do not need to be seeded into + // the VM if they are using the identity mapping. + if (isa<GlobalValue>(V) || isa<InlineAsm>(V) || isa<MDString>(V) || + (isa<MDNode>(V) && !cast<MDNode>(V)->isFunctionLocal())) return VMSlot = const_cast<Value*>(V); if (const MDNode *MD = dyn_cast<MDNode>(V)) { |