Mercurial > projects > ldc
comparison gen/toir.cpp @ 656:a15ccbf7451d
Support structs that are merely a forward reference. See mini/forwdecl1.d
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 06 Oct 2008 14:06:55 +0200 |
parents | 2a0bcf7f7b3d |
children | 43d2ab9833bf |
comparison
equal
deleted
inserted
replaced
655:93433f4b6963 | 656:a15ccbf7451d |
---|---|
127 Logger::println("a normal variable"); | 127 Logger::println("a normal variable"); |
128 // take care of forward references of global variables | 128 // take care of forward references of global variables |
129 if (vd->isDataseg() || (vd->storage_class & STCextern)) { | 129 if (vd->isDataseg() || (vd->storage_class & STCextern)) { |
130 vd->toObjFile(0); // TODO: multiobj | 130 vd->toObjFile(0); // TODO: multiobj |
131 } | 131 } |
132 if (!vd->ir.isSet() || !vd->ir.getIrValue() || DtoType(vd->type)->isAbstract()) { | 132 if (!vd->ir.isSet() || !vd->ir.getIrValue()) { |
133 error("global variable %s not resolved", vd->toChars()); | 133 error("variable %s not resolved", vd->toChars()); |
134 if (Logger::enabled()) | 134 if (Logger::enabled()) |
135 Logger::cout() << "unresolved global had type: " << *DtoType(vd->type) << '\n'; | 135 Logger::cout() << "unresolved variable had type: " << *DtoType(vd->type) << '\n'; |
136 fatal(); | 136 fatal(); |
137 } | 137 } |
138 if (vd->isDataseg() || (vd->storage_class & STCextern)) { | 138 if (vd->isDataseg() || (vd->storage_class & STCextern)) { |
139 DtoConstInitGlobal(vd); | 139 DtoConstInitGlobal(vd); |
140 } | 140 } |