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 | 2b3365ca1dd53b078714ec99b5b2ea6b67b23c9c (patch) | |
tree | b80aee81468c1d42724cb56b77054e28aad5bb58 /lib/Bitcode/Writer | |
parent | 570a4a5d9ca31f276a67502d1e0533d59d331fea (diff) | |
download | external_llvm-2b3365ca1dd53b078714ec99b5b2ea6b67b23c9c.zip external_llvm-2b3365ca1dd53b078714ec99b5b2ea6b67b23c9c.tar.gz external_llvm-2b3365ca1dd53b078714ec99b5b2ea6b67b23c9c.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer')
-rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index 3eacc5e..595497f 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/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); } |