[llvm-commits] [llvm] r94842 - /llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Victor Hernandez
vhernandez at apple.com
Fri Jan 29 13:19:19 PST 2010
Author: hernande
Date: Fri Jan 29 15:19:19 2010
New Revision: 94842
URL: http://llvm.org/viewvc/llvm-project?rev=94842&view=rev
Log:
We were not writing bitcode for function-local metadata whose operands have been erased (making it not have any more function-local operands)
Modified:
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=94842&r1=94841&r2=94842&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Fri Jan 29 15:19:19 2010
@@ -498,7 +498,7 @@
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 @@
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;
More information about the llvm-commits
mailing list