Skip to content

Commit

Permalink
replace jl_is_utf8_string and jl_is_byte_string with jl_is_string
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed May 4, 2016
1 parent 530ba95 commit 16a5d05
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static native_sym_arg_t interpret_symbol_arg(jl_value_t *arg, jl_codectx_t *ctx,
}
if (jl_is_symbol(ptr))
f_name = jl_symbol_name((jl_sym_t*)ptr);
else if (jl_is_byte_string(ptr))
else if (jl_is_string(ptr))
f_name = jl_string_data(ptr);
if (f_name != NULL) {
// just symbol, default to JuliaDLHandle
Expand All @@ -383,13 +383,13 @@ static native_sym_arg_t interpret_symbol_arg(jl_value_t *arg, jl_codectx_t *ctx,
jl_value_t *t1 = jl_fieldref(ptr,1);
if (jl_is_symbol(t0))
f_name = jl_symbol_name((jl_sym_t*)t0);
else if (jl_is_byte_string(t0))
else if (jl_is_string(t0))
f_name = jl_string_data(t0);
else
JL_TYPECHKS(fname, symbol, t0);
if (jl_is_symbol(t1))
f_lib = jl_symbol_name((jl_sym_t*)t1);
else if (jl_is_byte_string(t1))
else if (jl_is_string(t1))
f_lib = jl_string_data(t1);
else
JL_TYPECHKS(fname, symbol, t1);
Expand Down Expand Up @@ -653,10 +653,10 @@ static jl_cgval_t emit_llvmcall(jl_value_t **args, size_t nargs, jl_codectx_t *c
jl_error("Tuple as first argument to llvmcall must have exactly two children");
decl = jl_fieldref(ir,0);
ir = jl_fieldref(ir,1);
if (!jl_is_byte_string(decl))
if (!jl_is_string(decl))
jl_error("Declarations passed to llvmcall must be a string");
}
bool isString = jl_is_byte_string(ir);
bool isString = jl_is_string(ir);
bool isPtr = jl_is_cpointer(ir);
if (!isString && !isPtr) {
jl_error("IR passed to llvmcall must be a string or pointer to an LLVM Function");
Expand Down
2 changes: 1 addition & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ static void emit_setfield(jl_datatype_t *sty, const jl_cgval_t &strct, size_t id
static bool might_need_root(jl_value_t *ex)
{
return (!jl_is_symbol(ex) && !jl_is_slot(ex) && !jl_is_ssavalue(ex) &&
!jl_is_bool(ex) && !jl_is_quotenode(ex) && !jl_is_byte_string(ex) &&
!jl_is_bool(ex) && !jl_is_quotenode(ex) && !jl_is_string(ex) &&
!jl_is_globalref(ex));
}

Expand Down
2 changes: 1 addition & 1 deletion src/interpreter.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static jl_value_t *eval(jl_value_t *e, jl_value_t **locals, jl_lambda_info_t *la
else if (ex->head == error_sym || ex->head == jl_incomplete_sym) {
if (nargs == 0)
jl_error("malformed \"error\" expression");
if (jl_is_byte_string(args[0]))
if (jl_is_string(args[0]))
jl_errorf("syntax: %s", jl_string_data(args[0]));
jl_throw(args[0]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/jlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static const char *git_info_string(const char *fld)
if (!GIT_VERSION_INFO)
GIT_VERSION_INFO = jl_get_global(jl_base_module, jl_symbol("GIT_VERSION_INFO"));
jl_value_t *f = jl_get_field(GIT_VERSION_INFO, fld);
assert(jl_is_byte_string(f));
assert(jl_is_string(f));
return jl_string_data(f);
}

Expand Down
3 changes: 1 addition & 2 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,7 @@ static inline uint32_t jl_fielddesc_size(int8_t fielddesc_type)
#define jl_is_module(v) jl_typeis(v,jl_module_type)
#define jl_is_mtable(v) jl_typeis(v,jl_methtable_type)
#define jl_is_task(v) jl_typeis(v,jl_task_type)
#define jl_is_utf8_string(v) jl_typeis(v,jl_string_type)
#define jl_is_byte_string(v) jl_is_utf8_string(v)
#define jl_is_string(v) jl_typeis(v,jl_string_type)
#define jl_is_cpointer(v) jl_is_cpointer_type(jl_typeof(v))
#define jl_is_pointer(v) jl_is_cpointer_type(jl_typeof(v))

Expand Down

0 comments on commit 16a5d05

Please sign in to comment.