From bc09b36016dffee65097b492494e74a626afca77 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Nov 2008 03:48:55 +0000 Subject: 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 --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp') diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index 4b64901..9e0e902 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -363,7 +363,7 @@ public: Field.resize(0); Constant *C = CI->getOperand(I++); GlobalVariable *GV = getGlobalVariable(C); - if (GV->hasInitializer()) { + if (GV && GV->hasInitializer()) { if (ConstantArray *CA = dyn_cast(GV->getInitializer())) { for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) { GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i)); -- cgit v1.1