diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-03-08 02:07:02 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-03-08 02:07:02 +0000 |
commit | 237026555076a7169eab73f76ebb9b2eed2962a6 (patch) | |
tree | 26615ccd44722acbbff20294f966eb9308ea1b6d | |
parent | fc34f8bb48cad4e332af0b16b810152b7e9536aa (diff) | |
download | bcm5719-llvm-237026555076a7169eab73f76ebb9b2eed2962a6.tar.gz bcm5719-llvm-237026555076a7169eab73f76ebb9b2eed2962a6.zip |
libstdc++-v3 was failing to build. Needed to handle composite types with empty
members (running into a zero initializer.)
llvm-svn: 26607
-rw-r--r-- | llvm/lib/CodeGen/MachineDebugInfo.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineDebugInfo.cpp b/llvm/lib/CodeGen/MachineDebugInfo.cpp index 9e76daa4b78..45ded8e426e 100644 --- a/llvm/lib/CodeGen/MachineDebugInfo.cpp +++ b/llvm/lib/CodeGen/MachineDebugInfo.cpp @@ -263,12 +263,15 @@ public: 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); + } } } }; |