diff options
| author | Victor Hernandez <vhernandez@apple.com> | 2010-01-29 21:19:19 +0000 |
|---|---|---|
| committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-29 21:19:19 +0000 |
| commit | 64567fba2277d1634a8873561105c381b185be06 (patch) | |
| tree | 2515b55669aa633c03e31497b32d23591d736a56 /lib/Bitcode | |
| parent | 91d8d168e7176caad2fe1e1c6fc4c9620f70f526 (diff) | |
| download | external_llvm-64567fba2277d1634a8873561105c381b185be06.zip external_llvm-64567fba2277d1634a8873561105c381b185be06.tar.gz external_llvm-64567fba2277d1634a8873561105c381b185be06.tar.bz2 | |
We were not writing bitcode for function-local metadata whose operands have been erased (making it not have any more function-local operands)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
| -rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 54f756f..a5bb526 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -498,7 +498,7 @@ static void WriteModuleMetadata(const ValueEnumerator &VE, for (unsigned i = 0, e = Vals.size(); i != e; ++i) { if (const MDNode *N = dyn_cast<MDNode>(Vals[i].first)) { - if (!N->isFunctionLocal()) { + if (!N->isFunctionLocal() || !N->getFunction()) { if (!StartedMetadataBlock) { Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3); StartedMetadataBlock = true; @@ -562,7 +562,7 @@ static void WriteFunctionLocalMetadata(const Function &F, for (unsigned i = 0, e = Vals.size(); i != e; ++i) if (const MDNode *N = dyn_cast<MDNode>(Vals[i].first)) - if (N->getFunction() == &F) { + if (N->isFunctionLocal() && N->getFunction() == &F) { if (!StartedMetadataBlock) { Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3); StartedMetadataBlock = true; |
