Skip to content

Commit

Permalink
fix bug in type definition (libgccjit)
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Jul 6, 2015
1 parent 02681b1 commit d65d2e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/ravi_gcccodegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,7 @@ int raviV_compile(struct lua_State *L, struct Proto *p, int manual_request,
}

if (def.dump_ir) {
gcc_jit_context_dump_to_file(def.ravi->context, "cdump.txt", 0);
gcc_jit_context_dump_to_file(def.function_context, "fdump.txt", 0);
gcc_jit_context_dump_reproducer_to_file(def.function_context, "rdump.txt");
}
Expand Down
8 changes: 3 additions & 5 deletions src/ravi_gcctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ bool ravi_setup_lua_types(ravi_gcc_context_t *ravi) {
fields[5] =
gcc_jit_context_new_field(ravi->context, NULL, t->C_size_t, "len");
fields[6] =
gcc_jit_context_new_field(ravi->context, NULL, t->pTStringT, "hash");
gcc_jit_context_new_field(ravi->context, NULL, t->pTStringT, "hnext");
gcc_jit_struct_set_fields(t->TStringT, NULL, 7, fields);

// Table
Expand Down Expand Up @@ -338,7 +338,7 @@ bool ravi_setup_lua_types(ravi_gcc_context_t *ravi) {
// Instruction *code;
// struct Proto **p; /* functions defined inside the function */
// int *lineinfo; /* map from opcodes to source lines (debug information) */
// LocVar *locvars; /* information about local variables (debug information)
// LocVar *locvars; /* information about local variables (debug information)
// */
// Upvaldesc *upvalues; /* upvalue information */
// struct LClosure *cache; /* last created closure with this prototype */
Expand Down Expand Up @@ -561,7 +561,7 @@ bool ravi_setup_lua_types(ravi_gcc_context_t *ravi) {
// struct lua_longjmp; /* defined in ldo.c */
t->lua_longjumpT = gcc_jit_context_new_opaque_struct(ravi->context, NULL,
"ravi_lua_longjmp");
t->plua_longjumpT = gcc_jit_struct_as_type(t->lua_longjumpT);
t->plua_longjumpT = gcc_jit_type_get_pointer(gcc_jit_struct_as_type(t->lua_longjumpT));

// lzio.h
// typedef struct Mbuffer {
Expand Down Expand Up @@ -1131,7 +1131,5 @@ bool ravi_setup_lua_types(ravi_gcc_context_t *ravi) {
GCC_JIT_FUNCTION_IMPORTED,
t->C_intT, "printf", 1, params, 1);

gcc_jit_context_dump_to_file(ravi->context, "dump.txt", 0);

return ravi_jit_has_errored(ravi) ? false : true;
}

0 comments on commit d65d2e6

Please sign in to comment.