From e526d74ed51a3955bd8559a8ef7560b9d6bfc675 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Fri, 12 Sep 2014 16:06:03 +0400 Subject: [PATCH] Const and immutable fields with initializers are not globals since 2.064 --- gen/declarations.cpp | 6 ++---- gen/llvmhelpers.cpp | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gen/declarations.cpp b/gen/declarations.cpp index f52aff7046..a2820abad4 100644 --- a/gen/declarations.cpp +++ b/gen/declarations.cpp @@ -227,14 +227,12 @@ public: } // global variable - if (decl->isDataseg() || (decl->storage_class & (STCconst | STCimmutable) && decl->init)) + if (decl->isDataseg()) { Logger::println("data segment"); - #if 0 // TODO: assert(!(decl->storage_class & STCmanifest) && - "manifest constant being codegen'd!"); - #endif + "manifest constant being codegen'd!"); IrGlobal *irGlobal = getIrGlobal(decl); llvm::GlobalVariable *gvar = llvm::cast(irGlobal->value); diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index d3a63bd2cd..ce6155b9e3 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1018,14 +1018,12 @@ void DtoResolveVariable(VarDeclaration* vd) DtoResolveDsymbol(ad); // global variable - if (vd->isDataseg() || (vd->storage_class & (STCconst | STCimmutable) && vd->init)) + if (vd->isDataseg()) { Logger::println("data segment"); - #if 0 // TODO: - assert(!(storage_class & STCmanifest) && + assert(!(vd->storage_class & STCmanifest) && "manifest constant being codegen'd!"); - #endif // don't duplicate work if (vd->ir.isResolved()) return;