[llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Jim Laskey
jlaskey at apple.com
Tue Mar 7 18:07:15 PST 2006
Changes in directory llvm/lib/CodeGen:
MachineDebugInfo.cpp updated: 1.25 -> 1.26
---
Log message:
libstdc++-v3 was failing to build. Needed to handle composite types with empty
members (running into a zero initializer.)
---
Diffs of the changes: (+8 -5)
MachineDebugInfo.cpp | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.25 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.26
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.25 Tue Mar 7 16:00:35 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Tue Mar 7 20:07:02 2006
@@ -263,12 +263,15 @@
virtual void Apply(std::vector<DebugInfoDesc *> &Field) {
Constant *C = CI->getOperand(I++);
GlobalVariable *GV = getGlobalVariable(C);
- ConstantArray *CA = cast<ConstantArray>(GV->getInitializer());
Field.resize(0);
- for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) {
- GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i));
- DebugInfoDesc *DE = DR.Deserialize(GVE);
- Field.push_back(DE);
+ // Have to be able to deal with the empty array case (zero initializer)
+ if (!GV->hasInitializer()) return;
+ if (ConstantArray *CA = dyn_cast<ConstantArray>(GV->getInitializer())) {
+ for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) {
+ GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i));
+ DebugInfoDesc *DE = DR.Deserialize(GVE);
+ Field.push_back(DE);
+ }
}
}
};
More information about the llvm-commits
mailing list