[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Dec 20 17:17:49 PST 2005
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.32 -> 1.33
---
Log message:
Don't emit a null terminator, nor anything after it, to the ctor/dtor list
---
Diffs of the changes: (+4 -1)
AsmPrinter.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.32 llvm/lib/CodeGen/AsmPrinter.cpp:1.33
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.32 Tue Dec 13 00:32:10 2005
+++ llvm/lib/CodeGen/AsmPrinter.cpp Tue Dec 20 19:17:37 2005
@@ -146,7 +146,10 @@
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i)
if (ConstantStruct *CS = dyn_cast<ConstantStruct>(InitList->getOperand(i))){
if (CS->getNumOperands() != 2) return; // Not array of 2-element structs.
- // Emit the function pointer.
+
+ if (CS->getOperand(1)->isNullValue())
+ return; // Found a null terminator, exit printing.
+ // Emit the function pointer.
EmitGlobalConstant(CS->getOperand(1));
}
}
More information about the llvm-commits
mailing list