void PrototypeDialog::loadFWObject(FWObject *o) { obj=o; Prototype *s = dynamic_cast<Prototype*>(obj); assert(s!=NULL); init=true; fillLibraries(libs,obj); obj_name->setText( QString::fromUtf8(s->getName().c_str()) ); comment->setText( QString::fromUtf8(s->getComment().c_str()) ); apply->setEnabled( false ); init=false; }
void IrGen::visit(Prototype& proto) { std::vector<llvm::Type*> doubles(proto.getParamNames().size(), llvm::Type::getDoubleTy(context)); auto fnType = llvm::FunctionType::get(returnType, doubles, false); auto fn = llvm::Function::Create(fnType, llvm::Function::ExternalLinkage, proto.getName(), module); auto paramNameIter = proto.getParamNames().begin(); for (auto& arg : fn->args()) { arg.setName(*paramNameIter++); } values.push(fn); }