mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 23:20:40 +03:00
Const and immutable fields with initializers are not globals since 2.064
This commit is contained in:
parent
960d84508b
commit
e526d74ed5
2 changed files with 4 additions and 8 deletions
|
@ -227,14 +227,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// global variable
|
// global variable
|
||||||
if (decl->isDataseg() || (decl->storage_class & (STCconst | STCimmutable) && decl->init))
|
if (decl->isDataseg())
|
||||||
{
|
{
|
||||||
Logger::println("data segment");
|
Logger::println("data segment");
|
||||||
|
|
||||||
#if 0 // TODO:
|
|
||||||
assert(!(decl->storage_class & STCmanifest) &&
|
assert(!(decl->storage_class & STCmanifest) &&
|
||||||
"manifest constant being codegen'd!");
|
"manifest constant being codegen'd!");
|
||||||
#endif
|
|
||||||
|
|
||||||
IrGlobal *irGlobal = getIrGlobal(decl);
|
IrGlobal *irGlobal = getIrGlobal(decl);
|
||||||
llvm::GlobalVariable *gvar = llvm::cast<llvm::GlobalVariable>(irGlobal->value);
|
llvm::GlobalVariable *gvar = llvm::cast<llvm::GlobalVariable>(irGlobal->value);
|
||||||
|
|
|
@ -1018,14 +1018,12 @@ void DtoResolveVariable(VarDeclaration* vd)
|
||||||
DtoResolveDsymbol(ad);
|
DtoResolveDsymbol(ad);
|
||||||
|
|
||||||
// global variable
|
// global variable
|
||||||
if (vd->isDataseg() || (vd->storage_class & (STCconst | STCimmutable) && vd->init))
|
if (vd->isDataseg())
|
||||||
{
|
{
|
||||||
Logger::println("data segment");
|
Logger::println("data segment");
|
||||||
|
|
||||||
#if 0 // TODO:
|
assert(!(vd->storage_class & STCmanifest) &&
|
||||||
assert(!(storage_class & STCmanifest) &&
|
|
||||||
"manifest constant being codegen'd!");
|
"manifest constant being codegen'd!");
|
||||||
#endif
|
|
||||||
|
|
||||||
// don't duplicate work
|
// don't duplicate work
|
||||||
if (vd->ir.isResolved()) return;
|
if (vd->ir.isResolved()) return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue