summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-10 03:48:55 +0000
committerChris Lattner <sabre@nondot.org>2008-11-10 03:48:55 +0000
commitbc09b36016dffee65097b492494e74a626afca77 (patch)
treee072862cf5f905fdaddadbc81f60983105eb761a /llvm/lib/CodeGen/MachineModuleInfo.cpp
parent85af1ee10d43309b358e27af042b05a76ce7b919 (diff)
downloadbcm5719-llvm-bc09b36016dffee65097b492494e74a626afca77.tar.gz
bcm5719-llvm-bc09b36016dffee65097b492494e74a626afca77.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineModuleInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index 4b64901bd4e..9e0e9025a4b 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<ConstantArray>(GV->getInitializer())) {
for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) {
GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i));
OpenPOWER on IntegriCloud