diff --git a/gen/toobj.cpp b/gen/toobj.cpp index a479a5c3..886573f5 100644 --- a/gen/toobj.cpp +++ b/gen/toobj.cpp @@ -146,7 +146,7 @@ llvm::Module* Module::genLLVMModule(Ir* sir) sir->emitFunctionBodies(); // generate ModuleInfo - //genmoduleinfo(); + genmoduleinfo(); // emit usedArray if (!ir.usedArray.empty()) diff --git a/ir/irclass.cpp b/ir/irclass.cpp index 7ec4690b..15661639 100644 --- a/ir/irclass.cpp +++ b/ir/irclass.cpp @@ -66,8 +66,9 @@ LLGlobalVariable * IrStruct::getClassInfoSymbol() IrTypeClass* tc = cinfo->type->irtype->isClass(); assert(tc && "invalid ClassInfo type"); + // classinfos cannot be constants since they're used a locks for synchronized classInfo = new llvm::GlobalVariable( - tc->getPA().get(), true, _linkage, NULL, initname, gIR->module); + tc->getPA().get(), false, _linkage, NULL, initname, gIR->module); return classInfo; }