diff options
author | Victor Hernandez <vhernandez@apple.com> | 2010-02-06 01:21:09 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2010-02-06 01:21:09 +0000 |
commit | 1b08138152d59c26f81386e05188baf73a3efa8f (patch) | |
tree | 21fae983a85c096616e90d5a5a77d9ea886c30fe /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | |
parent | 74bb06c0f02e650ea9ec73729f41a620fc55a8ee (diff) | |
download | bcm5719-llvm-1b08138152d59c26f81386e05188baf73a3efa8f.tar.gz bcm5719-llvm-1b08138152d59c26f81386e05188baf73a3efa8f.zip |
Function-local metadata whose operands had been optimized to no longer refer to function-local IR were not getting written by BitcodeWriter; solution is for these metadata to be enumerated just like global metadata.
llvm-svn: 95467
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index 3eacc5e2be0..595497f6de5 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -93,7 +93,7 @@ ValueEnumerator::ValueEnumerator(const Module *M) { for (User::const_op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) { if (MDNode *MD = dyn_cast<MDNode>(*OI)) - if (MD->isFunctionLocal()) + if (MD->isFunctionLocal() && MD->getFunction()) // These will get enumerated during function-incorporation. continue; EnumerateOperandType(*OI); @@ -415,7 +415,7 @@ void ValueEnumerator::incorporateFunction(const Function &F) { for (User::const_op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) { if (MDNode *MD = dyn_cast<MDNode>(*OI)) - if (MD->isFunctionLocal()) + if (MD->isFunctionLocal() && MD->getFunction()) // Enumerate metadata after the instructions they might refer to. FunctionLocalMDs.push_back(MD); } |