mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-08 19:36:02 +00:00
libstdc++-v3 was failing to build. Needed to handle composite types with empty
members (running into a zero initializer.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26607 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
25de486263
commit
2b0e309640
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user