示例#1
0
文件: rttibuilder.cpp 项目: Doeme/ldc
void RTTIBuilder::push_funcptr(FuncDeclaration *fd, Type *castto) {
  if (fd) {
    DtoResolveFunction(fd);
    LLConstant *F = getIrFunc(fd)->func;
    if (castto) {
      F = DtoBitCast(F, DtoType(castto));
    }
    push(F);
  } else if (castto) {
    push_null(castto);
  } else {
    push_null_vp();
  }
}
示例#2
0
void RTTIBuilder::push_funcptr(FuncDeclaration* fd, Type* castto)
{
    if (fd)
    {
        fd->codegen(Type::sir);
        LLConstant* F = fd->ir.irFunc->func;
        if (castto)
            F = DtoBitCast(F, DtoType(castto));
        inits.push_back(F);
    }
    else if (castto)
    {
        push_null(castto);
    }
    else
    {
        push_null_vp();
    }
}