示例#1
0
static Value *emit_bounds_check(Value *i, Value *len, jl_codectx_t *ctx)
{
    Value *im1 = builder.CreateSub(i, ConstantInt::get(T_size, 1));
    Value *ok = builder.CreateICmpULT(im1, len);
    raise_exception_unless(ok, jlboundserr_var, ctx);
    return im1;
}
示例#2
0
文件: cgutils.cpp 项目: fpepin/julia
static void null_pointer_check(Value *v, jl_codectx_t *ctx)
{
    raise_exception_unless(builder.CreateICmpNE(v,V_null), jlundeferr_var, ctx);
}
示例#3
0
文件: cgutils.cpp 项目: fpepin/julia
static void raise_exception_if(Value *cond, Value *exc, jl_codectx_t *ctx)
{
    raise_exception_unless(builder.CreateXor(cond, ConstantInt::get(T_int1,-1)),
                           exc, ctx);
}
示例#4
0
文件: cgutils.cpp 项目: fpepin/julia
static void raise_exception_unless(Value *cond, GlobalVariable *exc,
                                   jl_codectx_t *ctx)
{
    raise_exception_unless(cond, (Value*)builder.CreateLoad(exc, false), ctx);
}
示例#5
0
static void null_pointer_check(Value *v, jl_codectx_t *ctx)
{
    raise_exception_unless(builder.CreateICmpNE(v,Constant::getNullValue(v->getType())),
                           jlundeferr_var, ctx);
}