void FuncDeclaration::codegen(Ir* p) { // don't touch function aliases, they don't contribute any new symbols if (!isFuncAliasDeclaration()) { DtoResolveDsymbol(this); } }
void ClassDeclaration::codegen(Ir*) { if (type->ty == Terror) { error("had semantic errors when compiling"); return; } if (members && symtab) DtoResolveDsymbol(this); }
RTTIBuilder::RTTIBuilder(AggregateDeclaration* base_class) { DtoResolveDsymbol(base_class); base = base_class; basetype = static_cast<TypeClass*>(base->type); baseir = getIrAggr(base); assert(baseir && "no IrStruct for TypeInfo base class"); if (base->isClassDeclaration()) { // just start with adding the vtbl inits.push_back(baseir->getVtblSymbol()); // and monitor push_null_vp(); } }
void DtoResolveNestedContext(Loc loc, AggregateDeclaration *decl, LLValue *value) { Logger::println("Resolving nested context"); LOG_SCOPE; // get context LLValue* nest = DtoNestedContext(loc, decl); // store into right location if (!llvm::dyn_cast<llvm::UndefValue>(nest)) { // Need to make sure the declaration has already been resolved, because // when multiple source files are specified on the command line, the // frontend sometimes adds "nested" (i.e. a template in module B // instantiated from module A with a type from module A instantiates // another template from module B) into the wrong module, messing up // our codegen order. DtoResolveDsymbol(decl); size_t idx = decl->vthis->ir.irField->index; LLValue* gep = DtoGEPi(value,0,idx,".vthis"); DtoStore(DtoBitCast(nest, gep->getType()->getContainedType(0)), gep); } }