Mercurial > projects > ldc
comparison gen/toobj.c @ 84:169711a7126e trunk
[svn r88] fixed global given initializers when they don't deserve
author | lindquist |
---|---|
date | Fri, 02 Nov 2007 02:27:41 +0100 |
parents | d8dd47ef3973 |
children | f869c636a113 |
comparison
equal
deleted
inserted
replaced
83:339422268de1 | 84:169711a7126e |
---|---|
596 | 596 |
597 llvm::GlobalVariable* gvar = new llvm::GlobalVariable(_type,_isconst,_linkage,0,_name,M); | 597 llvm::GlobalVariable* gvar = new llvm::GlobalVariable(_type,_isconst,_linkage,0,_name,M); |
598 llvmValue = gvar; | 598 llvmValue = gvar; |
599 | 599 |
600 // if extern don't emit initializer | 600 // if extern don't emit initializer |
601 if (!(storage_class & STCextern)) | 601 if (!(storage_class & STCextern) && getModule() == gIR->dmodule) |
602 { | 602 { |
603 _init = DtoConstInitializer(t, init); | 603 _init = DtoConstInitializer(t, init); |
604 | 604 |
605 //Logger::cout() << "initializer: " << *_init << '\n'; | 605 //Logger::cout() << "initializer: " << *_init << '\n'; |
606 if (_type != _init->getType()) { | 606 if (_type != _init->getType()) { |