Fix an over aggressive assumption that struct decls will have a pointer to
an array that is empty. Instead of requiring this array, allow a null pointer. This shrinks all forward references of structs. llvm-svn: 58959
This commit is contained in:
@@ -363,7 +363,7 @@ public:
|
|||||||
Field.resize(0);
|
Field.resize(0);
|
||||||
Constant *C = CI->getOperand(I++);
|
Constant *C = CI->getOperand(I++);
|
||||||
GlobalVariable *GV = getGlobalVariable(C);
|
GlobalVariable *GV = getGlobalVariable(C);
|
||||||
if (GV->hasInitializer()) {
|
if (GV && GV->hasInitializer()) {
|
||||||
if (ConstantArray *CA = dyn_cast<ConstantArray>(GV->getInitializer())) {
|
if (ConstantArray *CA = dyn_cast<ConstantArray>(GV->getInitializer())) {
|
||||||
for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) {
|
for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) {
|
||||||
GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i));
|
GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i));
|
||||||
|
|||||||
Reference in New Issue
Block a user